With the change of the fan entity model in 2021.04 and the depreciation of speed_command_topic and speed_state_topic, I’m trying to redefine my entities with templates. Below is my attempt but it is not working. Can anyone share a similar config?
- platform: mqtt
name: "office fanlinc fan"
command_topic: 'insteon/aa.bb.cc/fan/set'
state_topic: 'insteon/aa.bb.cc/fan/state'
percentage_command_topic: 'insteon/aa.bb.cc/fan/speed/set'
percentage_command_template: >
{% if value < 10 %}
off
{% elif value < 40 %}
low
{% elif value < 80 %}
medium
{% else %}
high
{% endif %}
percentage_state_topic: 'insteon/aa.bb.cc/fan/speed/state'
percentage_value_template: >
{% if value == low %}
33
{% elif value == medium %}
66
{% elif value == high %}
100
{% else %}
0
{% endif %}
If you want to keep the old speed lists then I’ve requested that the old speed list options should be kept and I’ve had a suggestion from a dev that if a FR gets enough votes they would implement it.