Advertisement
JLindvig

Untitled

May 25th, 2020
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.39 KB | None | 0 0
  1. - alias: Vacuum Selected Rooms
  2.   trigger:
  3.     platform: state
  4.     entity_id: input_boolean.vacuum_startrooms
  5.     to: 'on'
  6.   action:
  7.  ## Min ændring START
  8.   - service: vacuum.send_command
  9.     data_template:
  10.       command: app_segment_clean
  11.       entity_id: vacuum.shiny
  12.       params: >-
  13.         {% set do_kitchen = is_state('input_boolean.vacuum_kitchen', 'on') %}
  14.         {% set do_bedroom = is_state('input_boolean.vacuum_bedroom', 'on') %}
  15.         {% set do_living = is_state('input_boolean.vacuum_livingroom', 'on') %}
  16.         {% set do_hallway = is_state('input_boolean.vacuum_hallway', 'on') %}        
  17.         {% set kitchen = "25," if do_kitchen else '' %}
  18.         {% set bedroom = "17," if do_bedroom else '' %}
  19.         {% set living = "21," if do_living else '' %}
  20.         {% set hallway = "19," if do_hallway else '' %}        
  21.         [{{kitchen}}{{bedroom}}{{living}}{{hallway}}]
  22.   ## Min ændring SLUT
  23.   - data: {}
  24.     entity_id: input_boolean.vacuum_startrooms
  25.     service: input_boolean.turn_off
  26.   - data: {}
  27.     entity_id: input_boolean.vacuum_kitchen
  28.     service: input_boolean.turn_off
  29.   - data: {}
  30.     entity_id: input_boolean.vacuum_bedroom
  31.     service: input_boolean.turn_off
  32.   - data: {}
  33.     entity_id: input_boolean.vacuum_livingroom
  34.     service: input_boolean.turn_off
  35.   - data: {}
  36.     entity_id: input_boolean.vacuum_hallway
  37.     service: input_boolean.turn_off
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement