When using something like
entity_id: 'switch.garage_south'
state: 'on'
for:
minutes: 30
Does minutes: 30 mean exactly 30 minutes, or does it mean 30 minutes or more?
I’m trying to create an automation that closes the garage door if it’s been open for at least 30 minutes and it’s 25 minutes after sunset or before sunrise.
What I’m trying to figure out is if this will work if the door was open for more than 30 minutes prior to the sun conditions being met.
Here’s the full rule:
- id: auto_close_garage_south_when_dark
alias: Auto Close Garage South
hide_entity: true
# Trigger this every 3 minutes
trigger:
platform: time_pattern
minutes: "/3"
# Garage door must be open for 30 minutes
# AND
# The sun must be set for 25 minutes OR before sunsrise
condition:
condition: and
conditions:
- condition: state
entity_id: 'switch.garage_south'
state: 'on'
for:
minutes: 30
- condition: or
conditions:
- condition: sun
after: sunset
after_offset: "+00:25:00"
- condition: sun
before: sunrise
# Close the south door
action:
service: homeassistant.turn_off
entity_id: switch.garage_south