I’ve an automation triggered by an input_datetime, like so:
alias: Time to shower
description: ''
trigger:
- platform: time
at: input_datetime.shower
But, this time is for the weekdays when there is school/work the next day. Otherwise, Id like to add one hour to the trigger.
So, in pseudocode, something like so
trigger:
- platform: time
at: > -
if weekday in (fri, sat)
input_datetime.shower + 1 hour
else
input_datetime.shower
fi
Is this something that can be done in any way?
My next challenge will be to mix that with calendar event about holidays ans stuffs like that but that’s another story.
EDIT: First idea : duplicate automation, one for week, one for weekend, duplicate input_datetime. Create an automation on change of first input_datetime, set value of second one. But, man, this is over complicated.
Time trigger allows a sensor of device_class: timestamp to be used as the at: input.
So set up a template sensor using the logic above, something like this (untested, assumes two input_datetime helpers are set up, and probably needs fiddling to get it recognised as a timestamp sensor):
Both solutions are working, but I want to wait for a week-end.
I know, I could change the automation but, I’m leazy and prefer to wait for the real triggering
Thanks to @Didgeridrew and @Troon for the help.
I selected Drew’s solution at the end to save me an additional input_datetime and add the automation to set the second based on the first.