arduino
arduino copied to clipboard
libraries/Matter: Add MatterPowerSource.h and battery reporting example
I thought I'd share this fun little project here. It's a momentary Matter switch with battery reporting (Thing plus Matter inside).
This is really just intended as a reference, so feel free to close this out without pulling the code in. Feedback is appreciated! :)
I love the idea! Can't wait to test this.
Home Assistant works well (as pictured above), Apple Home however doesn't seem to recognize the PowerSource cluster.
@LorbusChris this is AWESOME! Once we start with the community contributions this is going to be the first PR merged 🚀
@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.
Could you fix it?
Regards
To compare, here's how it looks for an EVE motion sensor
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:
- Change the value of the 0x0009 WiredPresent attribute when the battery is charging
- Indicate the battery type
Regards