Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 99217

Xiaomi Battery Level adjustment template | Need help with rounding

$
0
0

@xbmcnut wrote:

Wondering if I could get some template help please as my batteries levels from all of my Xiaomi gateway sensors report the battery level about 15% higher than actual I first insert then too low once onine for a few days. To try and get the value about right, I’m multiplying the reading by x

I have the following template which works but no amount of tweaking can get the rounding right. Anyone got any advice on that?

      smoke_sensor_entry_foyer_battery:
        friendly_name: Smoke Entry Foyer Battery
        value_template: "{% if states.binary_sensor.smoke_sensor_entry_foyer %}
            {{ states.binary_sensor.smoke_sensor_entry_foyer.attributes.battery_level | int * 1.13}}
          {% else %}
            unknown
          {% endif %}"
        unit_of_measurement: '%'
        device_class: battery

image

N.B The one that reports correctly (?) is not connected to my Xiaomi gateway but to deCONZ via a Conbee II. Sadly, these report 100% all of the time until it’s tool late and then only update once the batteries have nearly died.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 99217

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>