This is what i’ve got so far:
- platform: mqtt
name: Ecofan
command_topic: "ITHO/fan/cmd"
state_topic: "ITHO/fan/State"
state_value_template: "{% if value|float==0 %}State 0{% endif %}{% if value|float >0 %}State 1{% endif %}"
payload_off: "State 0"
payload_on: "State 1"
preset_modes:
- 'low'
- 'medium'
- 'high'
- 'full'
preset_mode_command_topic: "ITHO/fan/cmd"
preset_mode_command_template: >
{% if value == 'low' %}
State 1
{% elif value == 'medium' %}
State 2
{% elif value == 'high' %}
State 3
{% elif value == 'full' %}
State 4
{% else %}
State 0
{% endif %}
preset_mode_state_topic: "ITHO/fan/State"
preset_mode_value_template: >
{% if value_json.fan == low %}
State 1
{% elif value_json.fan == medium %}
State 2
{% elif value_json.fan == high %}
State 3
{% elif value_json.fan == full %}
State 4
{% else %}
State 0
{% endif %}
Open for improvement/additions.
The speed attribute is not showing so something is still not quiet right…