Advertisement
314ma

Change vacuum mode

Apr 17th, 2020
571
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.01 KB | None | 0 0
  1. ##### WERSJA 1 #####
  2.  
  3. vacuum_change_mode:
  4.   sequence:
  5.     - service: vacuum.set_fan_speed
  6.       data_template:
  7.         entity_id: vacuum.xiaomi_vacuum_cleaner
  8.         fan_speed: |
  9.          {% if is_state_attr('vacuum.xiaomi_vacuum_cleaner', 'fan_speed', 105) %}
  10.             101
  11.           {% else %}
  12.             {{ state_attr('vacuum.xiaomi_vacuum_cleaner', 'fan_speed') | int +1 }}
  13.           {% endif %}
  14.  
  15.  
  16. ##### WERSJA 2 #####
  17.  
  18. vacuum_change_mode:
  19.   sequence:
  20.     - service: vacuum.set_fan_speed
  21.       data_template:
  22.         entity_id: vacuum.xiaomi_vacuum_cleaner
  23.         fan_speed: "{{ (state_attr('vacuum.xiaomi_vacuum_cleaner', 'fan_speed') | int - 100) % 5 + 101 }}"
  24.  
  25.  
  26. ##### WERSJA 3 #####
  27.  
  28. vacuum_change_mode:
  29.   sequence:
  30.     - service: vacuum.set_fan_speed
  31.       data_template:
  32.         entity_id: vacuum.xiaomi_vacuum_cleaner
  33.         fan_speed: "{{ state_attr('vacuum.xiaomi_vacuum_cleaner', 'fan_speed_list')[(state_attr('vacuum.xiaomi_vacuum_cleaner', 'fan_speed') | int - 100 ) % 5] }}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement