Hello,
I’m trying to create a fan. I used the following template:
- platform: template
fans:
badkamer_beneden_fan:
friendly_name: "Badkamer ventilator"
value_template: "{{ 'on' }}"
speed_template: >
{% if is_state('switch.fibaro_system_fgs222_double_relay_switch_2x1_5kw_switch', 'off') %}
{% if is_state('switch.fibaro_system_fgs222_double_relay_switch_2x1_5kw_switch_2', 'off') %}
'1'
{% else %}
'2'
{% endif %}
{% else %}
'3'
{% endif %}
turn_on:
service: script.badkamer_beneden_aan
data_template:
speed: "{{speed}}"
turn_off:
service: script.badkamer_beneden_1
set_speed:
service: script.badkamer_beneden_aan
data_template:
speed: "{{speed}}"
speeds:
- '1'
- '2'
- '3'
Now somehow, my speeds and my speed_template are not matching, since I get the following error line in my log files:
2020-06-14 12:59:15 ERROR (MainThread) [homeassistant.components.template.fan] Received invalid speed: '2'. Expected: ['1', '2', '3'].
Somebody any clue?
Thanks,
Bart.