Only run timer on unoccupied if lights are on
Also don't restart timer if it was already running.
This commit is contained in:
@ -662,6 +662,16 @@ automation:
|
|||||||
- condition: trigger
|
- condition: trigger
|
||||||
id: basement-unoccupied
|
id: basement-unoccupied
|
||||||
sequence:
|
sequence:
|
||||||
|
- if:
|
||||||
|
- condition: state
|
||||||
|
entity_id: light.basement_studio_lights
|
||||||
|
state: 'on'
|
||||||
|
then:
|
||||||
|
- if:
|
||||||
|
- condition: state
|
||||||
|
entity_id: timer.basement_studio_door_timer
|
||||||
|
state: idle
|
||||||
|
then:
|
||||||
- service: timer.start
|
- service: timer.start
|
||||||
target:
|
target:
|
||||||
entity_id: timer.basement_studio_door_timer
|
entity_id: timer.basement_studio_door_timer
|
||||||
|
Reference in New Issue
Block a user