Unfortunalety the battery levels of devices like Philips motion sensor and Xiaomi/Aqara ambience, door/window and vibration sensors are modelled only as attributes of their sensor values/entities like temperature and humidity so they aren't directly accessible as own entities in Home Assistant and need to be integrated complicatedly and error-prone by using template sensors.
Contrary ZHA component of Home Assistent directly exports these battery levels correctly as own entities.
In addition current implementation provides the values redundantly but in fact its only one unique device attribute which should be exported as such one.
Looking forward to receive a reply.
The text was updated successfully, but these errors were encountered:
I’m all in favour of exposing the battery (or rather: the Power Configuration cluster 0x0001) as a separate resource, but I’m not sure whether we should do that before API v2.
Technically we could introduce a ZHABattery sensor type, exposing the battery as state.battery with a corresponding state.lastupdated (a long-time wish of mine). It would also enable us to expose the battery for devices that are currently exposed a /lights resources (like the IKEA FYRTUR). On the downside, this would almost double the amount of /sensors resources.
Indeed it double's the number of sensors for single sensor devices, but in reality it IS a sensor w/ important information. ZHA already grabbed this issue and provides battery levels for all battery based sensors (even if no Power Configuration cluster visible in deCONZ GUI!?)
Related to @erikced's reply I opened an mirror issue on pydeconz. Now I am really unsure to which this topic has to be associated to due to my lack of technical knowledge on internals.
Exposing it thru the REST API is one thing, actually using it in apps or plugins to home automation systems is another. That needs to be discussed in their respective repositories. We’d keep the current config.battery around, at least for a while for backwards compatibility, and probably forever in Hue compatibility mode.
Add `ZHABattery` and `CLIPBattery` sensor types, with `state.battery` and `state.lastupdated` and without `config.battery`, see #1827.
For now, a `ZHABattery` sensor resource will only be created for IKEA FYRTUR and KADRILJ smart blinds.