I have an automation set to lock all doors and arm my alarm at 10pm. I created another automation to disarm if my side door is open to let the dog out. I would like to add another automation that rearms the alarm once that door is locked within the 10pm to 6am timeframe. I assume this can be done, but I have yet to figure out how to use time frames as a condition.
trigger:
- platform: state
entity_id: lock.your_lock_here
from: unlocked
to: locked
condition:
- condition: time
before: '06:00:00'
after: '22:00:00'
action:
- service: alarm_arm_home # or away or night or whatever
target:
entity_id: alarm.your_alarm_panel_here
code: !secret alarm_code