Hi,
I’m trying to set a binary_sensor for one of my MiFlora regarding the battery level.
The template value seems “correct” on the “Templates” tester.
I tried 2 things, but it always failed at the “Check Config”.
- platform: template
sensors:
battery_miflora01_HS:
# friendly_name: 'Battery MiFlora01 HS'
# device_class: 'power'
value_template: "{{ states('sensor.citronnier_battery') | int > 25 }}"
or
- platform: template
sensors:
battery_miflora01_HS_bis:
value_template: >-
{%- if (states.sensor.citronnier_battery.state) | int < 25 -%}
true
{%- else -%}
false
{%- endif -%}
I need some help