MQTT Sensor and value_template

Hi All,

I have my ITHO fan now also controlled Ising ESP board.
Hey creates some sensors, and fan configurations. But maybe they’re old because when I add them I get errors:

---
platform: mqtt
name: "ITHO Speed"
state_topic: "ITHO/Fan/State"
value_template: >-
  {% if value|float==0 %}Standby{% endif %}
  {% if value|float==1 %}Laag{% endif %}
  {% if value|float==2 %}Medium{% endif %}
  {% if value|float==3 %}Hoog{% endif %}
  {% if value|float==4 %}Full{% endif %}
  {% if value|float>=11 %}Hoog(T){% endif %}
Error loading /config/configuration.yaml: while scanning a simple key
  in "/config/package/compontents/sensors/mqtt/itho/itho_speed.yaml", line 6, column 1
could not find expected ':'
  in "/config/package/compontents/sensors/mqtt/itho/itho_speed.yaml", line 7, column 1

Can someone assist me with this?

Try this template instead:

value_template: >
  {% if value|float == 0 %}
    Standby
  {% elif value|float == 1 %}
    Laag
  {% elif value|float == 2 %}
    Medium
  {% elif value|float == 3 %}
    Hoog
  {% elif value|float == 4 %}
    Full
  {% else %}
    Hoog(T)
  {% endif %}

tried that way also but without the |float :slight_smile: thanks this was the solution!