-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
Add support for devices that don't report battery levels in percentages #2202
Comments
I was just trying to accomplish something like that. I added an entity (door sensor of my Nuki smart lock) with a "battery low template", but it doesn't show up in states (Developer tools). I have configured the battery state card with filter:
include:
- name: entity_id
value: '*_battery_plus' To get the new battery shown I can add - name: entity_id
value: '*_battery_critical' But it gets shown with state I thought I might be lacking some knownledge, but then I found this issue. So, it looks like I'm not the only one struggling with this. |
You can't add a battery state like this as a battery plus, but you can add a template for the boolean battery low to reflect a low battery and trigger events. I'm not sure if I'll ever add this into battery plus as there are a lot of permutations for these unusual devices. |
I had the template a bit wrong but fixing it didn't change anything. Also using So there is no way to get the battery type shown as secondary info for such batteries? |
Unfortunately not, the template only affects the binary sensor, not the battery plus one, so it's no use in dashboards the way you are wanting to use it. |
I understand. |
The algorithm could be as follows:
|
Thanks for your suggestion but there are also batteries with voltages, ones with Normal or Low and also ones that just display a binary low natively, that we'd also want to have as a sudo percentage. |
So I've been experimenting with ideas around this and it turns out without any code changes you can create a Template Helper and have Battery Notes pick it up and create a Battery+ sensor. I've documented how to do this here, feedback appreciated if you have issues. https://andrew-codechimp.github.io/HA-Battery-Notes/entities/#adding-a-battery-percentage |
@andrew-codechimp success! thank you! |
Checklist
Is your feature request related to a problem? Please describe.
Currently, you can't add devices that don't provide a percentage-based battery level, like a smoke detector. It only reports battery status as: low, medium, or high.
Describe the solution you'd like
I want support for devices without percentage-based battery levels to be added. It could be possible to emulate the battery level with dummy percentages: low = 10%, medium = 50%, high = 100%.
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: