Advertisement
p33j4y

HA: fan.xiaomi_miio_device example

Feb 1st, 2020
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.68 KB | None | 0 0
  1. input_select:
  2.   predkosc:
  3.     name: "Tryb pracy"
  4.     options:
  5.      - "Cichy"
  6.       - "Średni"
  7.       - "Max"
  8.       - "Auto"
  9.  
  10. automation:
  11.   - id: zmien_predkosc
  12.     alias: "Zmiana prędkości"
  13.     initial_state: "on"
  14.     trigger:
  15.     - platform: state
  16.       entity_id: input_select.predkosc
  17.     action:
  18.     - service: fan.set_speed
  19.       data_template:
  20.         entity_id: fan.xiaomi_miio_device
  21.         speed: >
  22.          {% set temp_speed = {'Cichy':'Silent', 'Średni':'Medium', 'Max':'High', 'Auto':'Auto'} %}
  23.           {% set temp_tryb = states('input_select.predkosc') %}
  24.           {% if temp_tryb in temp_speed %}{{ temp_speed[temp_tryb] }}{% else %}Silent{% endif %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement