Advertisement
xangin

sunset_door_open_turn_on_light

Nov 4th, 2021
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.81 KB | None | 0 0
  1. - id: sunset_door_open_turn_on_light
  2.   alias: 玄關-日落後大門打開餐嵌燈亮
  3.   description: 玄關-日落後大門打開餐嵌燈亮
  4.   trigger:
  5.   - entity_id: binary_sensor.door_window_sensor_158d0000f81711 #選門窗感應器
  6.     platform: state
  7.     from: 'off'
  8.     to: 'on'
  9.   condition:
  10.     condition: and #以下條件都符合才動作
  11.     conditions:
  12.       - after: sunset #日落
  13.         condition: sun
  14.       - condition: state #人體感應器沒有感應到人
  15.         entity_id: binary_sensor.motion_sensor_158d00010527be
  16.         state: 'off'
  17.       - condition: state #要打開的開關是關閉的
  18.         entity_id: switch.dinning_left_switch
  19.         state: 'off'      
  20.   action:
  21.     - data:
  22.         entity_id: switch.dinning_left_switch #打開開關
  23.       service: switch.turn_on
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement