Created
December 23, 2018 06:40
-
-
Save hfuller/e6d87fb9d2c2b495fdd0185abe4acfc7 to your computer and use it in GitHub Desktop.
Make fan appear as light (Home Assistant)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
light: | |
- platform: template | |
lights: | |
living_room_fans: | |
friendly_name: "Living room fans" | |
value_template: "{{ states('fan.living_room_fans') }}" | |
level_template: > | |
{% if (state_attr('fan.living_room_fans', 'speed') == "low" %} | |
85 | |
{% elif (state_attr('fan.living_room_fans', 'speed') == "high" %} | |
255 | |
{% else %} | |
170 | |
{% endif %} | |
turn_on: | |
service: script.lr_fans_on | |
turn_off: | |
service: script.lr_fans_off | |
set_level: | |
service: script.lr_fans_speed | |
data_template: | |
speed: > | |
{% if level < 90 %} | |
low | |
{% elif level > 175 %} | |
high | |
{% else %} | |
medium | |
{% endif %} | |
script: | |
lr_fans_off: | |
sequence: | |
- service: fan.turn_off | |
data: | |
entity_id: fan.living_room_fans | |
lr_fans_on: | |
sequence: | |
- service: fan.turn_on | |
data: | |
entity_id: fan.living_room_fans | |
speed: low | |
lr_fans_speed: | |
sequence: | |
- service: fan.turn_on | |
data_template: | |
entity_id: fan.living_room_fans | |
speed: "{{ speed }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment