Hi,
I’m trying to use the template fan to control my home ventilation.
It works almost but changing speed doesn’t work. The scripts won’t be called. The on works, and the fan runs high ad of the fan runs low. But selecting med or low won’t work.
I have this
fan:
- platform: template
fans:
my_fan:
value_template: "{{ states('sensor.ventilatie') }}"
speed_template: "{{ states('sensor.ventilatie') }}"
turn_on:
service: script.fan_high
turn_off:
service: script.fan_low
set_speed:
service: fan.set_speed
data_template:
speed: >
{% if speed == 'high' %}
script.fan_high
{% elif speed == 'medium' %}
script.fan_medium
{% elif speed == 'low' %}
script.fan_low
{% endif %}
speeds:
- 'high'
- 'medium'
- 'low'
fan_low:
alias: fanlow
sequence:
- service: shell_command.fan_low
fan_medium:
alias: fanmedium
sequence:
- service: shell_command.fan_medium
fan_high:
alias: fanhigh
sequence:
- service: shell_command.fan_high
shell_command:
fan_high: "/usr/bin/curl -X GET http://192.168.180.72/control?cmd=event,stand3"
fan_medium: "/usr/bin/curl -X GET http://192.168.180.72/control?cmd=event,stand2"
fan_low: "/usr/bin/curl -X GET http://192.168.180.72/control?cmd=event,stand1"