I’m trying to use a a time trigger with a random delay to turn off the switch. I’ve seen a couple examples using delay: and after, so I tried modifying my fixed off time (see below), but get an error when checking the config:
Invalid config for [automation]: [after] is an invalid option for [automation]. Check: automation->trigger->0->after.
You don’t with a trigger.
A trigger happens at a set instant.
A condition could check for after, once something has triggered it.
What are you trying to achieve? There’s always a way
I have a question regarding this -
I want to turn on a light after 20:00 until 06:00 am in the morning
If I set time to 20:00, and we have for example a power outage between 19:30-20:30, than I still
want the light to turn back on automatically at these hours.
If I could set a trigger of a time range, I could have achieved that.
Is there a way to configure it?
No. You’d have to deal with that scenario in a Home Assistant startup automation, unless your HA is UPS protected and survives the power outage and the devices are not power protected, in which case you’d trigger an automation based on power being restored.
I have lights set to restore to last state when possible but that’s not always appropriate i.e. If power went out at night and returned during the day. So after a power interruption, I turn them off. If I then want them on before motion detection, I say “Alexa, turn on…”.
If your power is extremely unreliable, consider a genarator!