I have the following helpers
Date\time helper (Monday_Starttime_1), containing a time value that I want something to activate on Monday Morning. It’s just a time, rather than a date\time.
Number helper (Monday_Starttime_2) which contains a number representing the number of minutes that I want a delayed action to happen on Monday morning.
For example, the first number will trigger automatic functions such as heating that are needed before people arrive, and the second number represents the time that actions will be performed as people start arriving, such as turning on lights.
I want to have the second number as a number minutes after the first event rather than a fixed time, for a whole bunch of reasons that don’t really matter here, it’s just the way that I want it.
I’m going to set a Wait for this (delay: “”)
I know that the number helper has a decimal place after it, so setting “10” minutes is actually “10.0” minutes .
I also know that the timer runs in seconds, so I need to multiple it by 60, which would give me “600.00” second.
How do I go about, adding the right number of second to delay:
According to this thread the answer should be something along the lines of
`
delay: “{{ (as_timestamp(states(‘input_datetime.Monday_Starttime_1’)+ states(‘input_number.Monday_Starttime_2’) )|timestamp_custom(‘%Y-%m-%d %H:%M:%S’) }}”
`
But I get the error message
Invalid action offset {{ (as_timestamp(states(‘input_datetime.Monday_Starttime_1’)+ states(‘input_number.Monday_Starttime_2’) )|timestamp_custom(‘%Y-%m-%d %H:%M:%S’) }} should be format ‘HH:MM’, ‘HH:MM:SS’ or ‘HH:MM:SS.F’ for dictionary value @ data[0][‘delay’]
I’ve read the documentation but don’t yet understand yaml enough to see where I went wrong, I’m not sure if it’s just syntax or if I HA can’t actually do this.
Yes, I know that I’ve not put the multiplier in to change minutes to seconds, I haven’t gotten quite that far yet.