10-08-2023 07:34 PM
Hi everyone,
I need some help to make an automation in the new script editor:
When everyone is away and time is sunset or later, turn light on. Turn light off at midnight.
I need both the home presence and/or the time to be a starter. So that if I am already away and then the sun sets OR the sun has already set and then I go away, in both cases the light will trigger. Both conditions need to be true and both can be a starter. This is what I cannot figure out how to do.
Any ideas? much appreciated
Answered! Go to the Recommended Answer.
10-09-2023 11:50 AM
You can have something like this. Triggers on any condition and then verify that both conditions are true
starters:
- type: home.state.HomePresence
state: homePresenceMode
is: AWAY
- type: time.schedule
at: sunset+60min
condition:
type: and
conditions:
- type: home.state.HomePresence
state: homePresenceMode
is: AWAY
- type: time.between
before: sunrise
after: sunset
10-09-2023 11:50 AM
You can have something like this. Triggers on any condition and then verify that both conditions are true
starters:
- type: home.state.HomePresence
state: homePresenceMode
is: AWAY
- type: time.schedule
at: sunset+60min
condition:
type: and
conditions:
- type: home.state.HomePresence
state: homePresenceMode
is: AWAY
- type: time.between
before: sunrise
after: sunset