Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libraries/Matter: Add MatterPowerSource.h and battery reporting example #51

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LorbusChris
Copy link

I thought I'd share this fun little project here. It's a momentary Matter switch with battery reporting (Thing plus Matter inside).
IMG_0218
IMG_0217

This is really just intended as a reference, so feel free to close this out without pulling the code in.
Feedback is appreciated! :)

{
public:
enum Changed_t{
kChanged_BatPercentRemaining = kChanged_Last << 1,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be extended for other attributes, e.g. for voltage and alarm reporting.

@lboue
Copy link

lboue commented May 9, 2024

I love the idea! Can't wait to test this.

@LorbusChris
Copy link
Author

Home Assistant works well (as pictured above), Apple Home however doesn't seem to recognize the PowerSource cluster.

@silabs-bozont
Copy link
Collaborator

@LorbusChris this is AWESOME! Once we start with the community contributions this is going to be the first PR merged 🚀

@lboue
Copy link

lboue commented May 22, 2024

@LorbusChris

I've just done the test. I've noticed a issue with the PowerSource cluster.

It is presented on EP4 instead of EP3. Apple Home shows power source icon.

image

image

image

Could you fix it?

Regards

@lboue
Copy link

lboue commented May 22, 2024

To compare, here's how it looks for an EVE motion sensor

image

@lboue
Copy link

lboue commented May 24, 2024

I think the following attributes can be activated in our case:

  • 0x0002 Description CHAR_STRING
  • 0x0009 WiredPresent BOOLEAN
  • 0x000B BatVoltage Server INT32U
  • 0x000C BatPercentRemaining INT8U
  • 0x000E BatChargeLevel BATCHARGELEVELENUM
  • 0x0014 BatCommonDesignation BATCOMMONDESIGNATIONENUM
  • 0x0015 BatANSIDesignation CHAR_STRING
  • 0x0016 BatIECDesignation CHAR_STRING
  • 0x0019 BatQuantity INT8U
  • 0x001A BatChargeState BATCHARGESTATEENUM

Source: power-source-cluster.xml

We could:

  1. Change the value of the 0x0009 WiredPresent attribute when the battery is charging
  2. Indicate the battery type

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants