Advertisement
Shestak

Untitled

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