If/else value template not working for me

I’m trying to get a value template in my config.yaml file to work, but I don’t know what I’m doing wrong. I want it to set the state to Yes or No (but in Swedish) instead of On/Off. Anyone seeing what I missed? :slight_smile:

binary_sensor:
  - platform: workday
    country: SE
  - platform: template
    sensors:
      dronarvader:
        friendly_name: "Drönarväder"
        value_template: >-
          {% if is_state('sensor.vader_precipitation', '0.0') and states('sensor.trafikverket_sundsvall_wind_speed') | float < 7 %}
            Ja
          {% else %}
            Nej
          {% endif %}

AFAIK, binary_sensor can only have values like:

These sensors only have two states: 0/off/low/closed/false and 1/on/high/open/true .

If you want Yes/No, you may want to try sensor instead.

1 Like

Thank’s, trying to add and remove spacing back and forward last hour but couldn’t get it to work, and the solution was that easy :slight_smile: Will try it right away!