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

[Feature request]: Use battery_charging device class for charging sensors #24564

Open
deosrc opened this issue Oct 31, 2024 · 0 comments
Open
Labels
feature request Feature request

Comments

@deosrc
Copy link

deosrc commented Oct 31, 2024

Is your feature request related to a problem? Please describe

I'm creating an automation to alert to any device left charging when leaving the house (fire risk). Ideally I want to have it automatically include any new devices by using a Jinja template similar to the below:

{{ states.binary_sensor | selectattr('attributes.device_class', '==', 'battery_charging') | list }}

Unfortunately it seems the charging sensors from Z2M do not use the device class, or at least not for the devices I have (https://www.zigbee2mqtt.io/devices/ZNJLBL01LM.html#aqara-znjlbl01lm).

Describe the solution you'd like

Battery charging sensors be configured with the battery_charging device class.

Describe alternatives you've considered

Manually setting the device class in Home Assistant, but this would need to be done for every new device added.

Additional context

This would also change the display in HA to read "Charging" and "Not charging" rather than "On" and "Off".

@deosrc deosrc added the feature request Feature request label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Feature request
Projects
None yet
Development

No branches or pull requests

1 participant