Advertisement
Shestak

Untitled

Aug 18th, 2022
632
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.68 KB | None | 0 0
  1. alias: Освещение после ухода (выключение)
  2. description: ""
  3. trigger:
  4.   - platform: event
  5.     event_type: timer.finished
  6.     event_data:
  7.       entity_id: timer.exit_timer
  8. condition: []
  9. action:
  10.   - service: script.light_turn_off
  11.     data: {}
  12.   - service: input_boolean.turn_off
  13.     target:
  14.       entity_id:
  15.        - input_boolean.kitchen_manual_mode
  16.         - input_boolean.balcony_manual_mode
  17.         - input_boolean.toilet_manual_mode
  18.         - input_boolean.bedroom_manual_mode
  19.         - input_boolean.hallway_manual_mode
  20.         - input_boolean.playroom_manual_mode
  21.         - input_boolean.livingroom_manual_mode
  22.         - input_boolean.bathroom_manual_mode
  23.     data: {}
  24.   - service: media_player.turn_off
  25.     target:
  26.       entity_id:
  27.        - media_player.yandex_station_lb00000000000000304600006f6ab3ee
  28.         - media_player.samsung_m27
  29.     data: {}
  30.   - condition: state
  31.     entity_id: input_boolean.silent_mode
  32.     state: "off"
  33.   - service: telegram_bot.send_message
  34.     data:
  35.       title: "*Отключение освещения:*"
  36.       message: >
  37.        {% set list = ['switch.0x4cf8cdf3c7f4062_channel_3','switch.0x4cf8cdf3c7f4062_channel_2','switch.zhimi_ca4_85c2_dry','sensor.0x4cf8cdf3c7f4062_action'] %}
  38.         {% for state in states.switch
  39.           | selectattr('state', '==', 'on')
  40.           | rejectattr('entity_id','in', list) %}
  41.         {{ state.name }}
  42.         {% endfor %}
  43.         {% for state in states.switch | selectattr('state', '==', 'on') %}{{
  44.         state.name }}
  45.  
  46.         {% endfor %}{% for state in states.light | selectattr('state', '==',
  47.         'on') %}{{ state.name }}
  48.  
  49.         {% endfor %}
  50. mode: single
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement