Binary sensor headache

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 :slight_smile:

HA does’t like the name battery_miflora01_HS

change it to battery_miflora01_hs

1 Like

Thank you treno ! It works ! :slight_smile: