forked from smarthome53/homeassistant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautomations_hall_light.yaml
43 lines (39 loc) · 1.32 KB
/
automations_hall_light.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Включение света по открытию входной двери
- alias: Turn on light when I came home
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.0x00158d0004184c6c_contact
to: 'on'
from: 'off'
condition:
- condition: state
entity_id: switch.0x00158d0003433cdf_switch_left
state: 'off'
- condition: numeric_state
entity_id: sensor.0x04cf8cdf3c78ca45_illuminance_lux
below: 50
- condition: state
entity_id: binary_sensor.0x00158d0003f1ccc1_occupancy
state: 'off'
action:
- service: homeassistant.turn_on
entity_id: switch.0x00158d0003433cdf_switch_left
- service: homeassistant.turn_on
entity_id: automation.turn_off_hall_lights_by_occupancy
# Выключение света по датчику движения
- alias: "Turn off hall lights by occupancy"
initial_state: false
trigger:
- platform: state
entity_id: binary_sensor.0x00158d0003f1ccc1_occupancy
to: 'off'
condition:
- condition: state
entity_id: switch.0x00158d0003433cdf_switch_left
state: 'on'
action:
- service: switch.turn_off
entity_id: switch.0x00158d0003433cdf_switch_left
- service: homeassistant.turn_off
entity_id: automation.turn_off_hall_lights_by_occupancy