New to Home Assistant (migrating from SmartThings) and I’m just setting up my devices.
I’m having trouble setting up a motion sensor to disarm an alarm in the morning. At the moment, I have a condition to run the automation after motion is detected after 6am. But this will disarm the alarm each time motion is detected, I only want it to run once.
I’ve tried adding an action at the end of the automation “wait for time to pass = 21 hours” but doesn’t seem to have made a difference.
Any suggestions? In SmartThings there’s an option to run an automation once perday - looking to recreate that with Home Assistant.
Create an input_boolean (e.g., input_boolean.morning_alarm_deactivated)
Create a condition so the automation only runs when the input_boolean is off
Set the input_boolean to true as an action of the automation
Create another automation to run at midnight which will set the input_boolean back to off.
Or
Set the automation to trigger at 6am
Create a wait / wait_for_trigger action with a timeout of your choice (e.g., 6 hours), see docs, have the wait template configured to wait until your motion sensor turns on
Set continue_on_timeout: false
Or
Have the automation trigger when there’s motion
Have a condition that checks if it’s after 6AM
Create a template condition to check for the last_triggered attribute of your automation, if it hasn’t run today (yet), continue
That would always disarm the alarm once motion is detected.
For example, if motion is detected at 6 AM, the alarm will be disabled, then the alarm may get armed later, but when motion is detected later (e.g., at 2 PM), the alarm will again be disarmed.