@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
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