question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for binary battery sensors

See original GitHub issue

I have some Osram motion sensors which only report a battry_low attribute which either be on or off. So it would be nice to have support for binary sensors.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
maxwroccommented, Apr 28, 2020

I think I have covered all your cases guys. You can check updated documentation here

It will be released in v1.1.0

1reaction
mdegat01commented, Apr 27, 2020

Second this. I have similar problem Nest Protect devices. You can see in the doc they report their state in the form of a battery_health sensor which either has state Ok or Replace.

I worked around it by combining this card auto-entities like this:

- card:
    show_header_toggle: false
    title: Battery levels
    type: 'custom:battery-state-card'
    color_gradient:
      - '#ff0000'
      - '#ffff00'
      - '#00ff00'
  filter:
    exclude:
      - state: Ok
    include:
      - entity_id: sensor.*_battery_level
      - entity_id: sensor.*_battery_health
  show_empty: false
  sort:
    method: state
    numeric: true
  type: 'custom:auto-entities'

What happens is that the protects don’t show up unless their status is Replace. And then since that’s not numeric the battery-state-card treats it as 0 for color calculation.

Which works but would be nice if there was a way to support this natively. Like for entities that report battery in a non-numeric state if I could provide a map between the non-numeric state and a numeric value to use for display (for Nest probably something like 100 for Ok and 25 for Replace)

Great card though! Really like it

Read more comments on GitHub >

github_iconTop Results From Across the Web

Binary Sensor - Home Assistant
Instructions on how-to setup binary sensors with Home Assistant. ... The full list of supported binary sensor device classes is below (note: these...
Read more >
Add battery device class for binary sensor by schmittx · Pull Request ...
Description: Adds a new battery device class for binary sensors to show normal vs. low battery states. Related issue (if applicable): N/A Pull...
Read more >
Binary Sensor Service – Bluetooth® Technology Website
The Binary Sensor Service (BSS) enables devices with one or more binary (for example, open/closed, on/off) sensors to report the state of the...
Read more >
Battery sensors: ROLAND ELECTRONIC
Battery sensor WF14 · ▽ Applications · ▽ Features · ▽ Technical Data · How can we help you? · +49 7236 9392-0....
Read more >
UBS on battery - Universal Binary Sensor
Run the 12v power to the relay coil. Connect the normally open contact to +12v power, and the normally closed contact to +9v...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found