Advertisement
Shestak

Untitled

Aug 18th, 2022
666
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.51 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: telegram_bot.send_message
  11.     data:
  12.       title: "*Отключение освещения:*"
  13.       message: >
  14.        {% set list =
  15.         ['switch.0x4cf8cdf3c7f4062_channel_3','switch.0x4cf8cdf3c7f4062_channel_2','switch.zhimi_ca4_85c2_dry','sensor.0x4cf8cdf3c7f4062_action','switch.0x04cf8cdf3c7f4062_power_on_state']%}
  16.  
  17.         {% for state in states.switch | selectattr('state', '==', 'on') |
  18.         rejectattr('entity_id','in',list) %}
  19.  
  20.         {{ state.name }}{% endfor %}{% for state in states.light |
  21.         selectattr('state', '==', 'on') %}{{ state.name}}
  22.  
  23.         {% endfor %}
  24.   - service: script.light_turn_off
  25.     data: {}
  26.   - service: input_boolean.turn_off
  27.     target:
  28.       entity_id:
  29.        - input_boolean.kitchen_manual_mode
  30.         - input_boolean.balcony_manual_mode
  31.         - input_boolean.toilet_manual_mode
  32.         - input_boolean.bedroom_manual_mode
  33.         - input_boolean.hallway_manual_mode
  34.         - input_boolean.playroom_manual_mode
  35.         - input_boolean.livingroom_manual_mode
  36.         - input_boolean.bathroom_manual_mode
  37.     data: {}
  38.   - service: media_player.turn_off
  39.     target:
  40.       entity_id:
  41.        - media_player.yandex_station_lb00000000000000304600006f6ab3ee
  42.         - media_player.samsung_m27
  43.     data: {}
  44. mode: single
  45.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement