Advertisement
Shestak

Untitled

Aug 18th, 2022
647
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.97 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.   - condition: or
  10.     conditions:
  11.       - condition: state
  12.         entity_id: light.gruppa_lamp_v_koridore
  13.         state: "on"
  14.       - condition: state
  15.         entity_id: light.0x158d000543314c_light
  16.         state: "on"
  17.       - condition: state
  18.         entity_id: light.0x158d00052cd777_light
  19.         state: "on"
  20.       - condition: state
  21.         entity_id: light.50ec50c9c470_light
  22.         state: "on"
  23.       - condition: state
  24.         entity_id: light.50ec50ca4ba1_light
  25.         state: "on"
  26.       - condition: state
  27.         entity_id: light.50ec50ca47c9_light
  28.         state: "on"
  29.       - condition: state
  30.         entity_id: light.yeelink_strip6_c28f_light
  31.         state: "on"
  32.       - condition: state
  33.         entity_id: switch.0x158d00045e3180_switch
  34.         state: "on"
  35.       - condition: state
  36.         entity_id: switch.0x158d00045e7640_switch
  37.         state: "on"
  38.       - condition: state
  39.         entity_id: switch.0x158d000483092e_channel_2
  40.         state: "on"
  41.       - condition: state
  42.         entity_id: switch.0x4cf8cdf3c7f4062_channel_1
  43.         state: "on"
  44.       - condition: state
  45.         entity_id: switch.0x54ef4410000757ff_switch
  46.         state: "on"
  47.       - condition: state
  48.         entity_id: switch.0x54ef441000075b3f_switch
  49.         state: "on"
  50.       - condition: state
  51.         entity_id: switch.0x4cf8cdf3c75a976_switch
  52.         state: "on"
  53.       - condition: state
  54.         entity_id: switch.chuangmi_hmi206_585d_switch
  55.         state: "on"
  56. action:
  57.   - service: telegram_bot.send_message
  58.     data:
  59.       title: "*Отключение освещения:*"
  60.       message: >
  61.        {% set list =
  62.         ['switch.0x4cf8cdf3c7f4062_channel_3','switch.0x4cf8cdf3c7f4062_channel_2','switch.zhimi_ca4_85c2_dry','sensor.0x4cf8cdf3c7f4062_action','switch.0x04cf8cdf3c7f4062_power_on_state']%}
  63.  
  64.         {% for state in states.switch | selectattr('state', '==', 'on') |
  65.         rejectattr('entity_id','in',list) %}
  66.  
  67.         {{ state.name }}{% endfor %}{% for state in states.light |
  68.         selectattr('state', '==', 'on') %}{{ state.name}}
  69.  
  70.         {% endfor %}
  71.   - service: script.light_turn_off
  72.     data: {}
  73.   - service: input_boolean.turn_off
  74.     target:
  75.       entity_id:
  76.        - input_boolean.kitchen_manual_mode
  77.         - input_boolean.balcony_manual_mode
  78.         - input_boolean.toilet_manual_mode
  79.         - input_boolean.bedroom_manual_mode
  80.         - input_boolean.hallway_manual_mode
  81.         - input_boolean.playroom_manual_mode
  82.         - input_boolean.livingroom_manual_mode
  83.         - input_boolean.bathroom_manual_mode
  84.     data: {}
  85.   - service: media_player.turn_off
  86.     target:
  87.       entity_id:
  88.        - media_player.yandex_station_lb00000000000000304600006f6ab3ee
  89.         - media_player.samsung_m27
  90.     data: {}
  91. mode: single
  92.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement