I am wanting to create an automation (B) which has a time based trigger to occur 10 minutes before another automation (A). Automation (A) starts based on an input_datetime using the below template:
I have played around with the template dev tool but can’t get the correct syntax to basically have automation (B) use a template value of the above input_datetime.retic_program1_start_time minus 10 minutes.
I tried this below which doesn’t error, but gives no return value at all:
My understanding is that the input datetime timestamp attribute is in seconds so you need to subtract the 600 seconds (10 min) before you convert to a custom timestamp then compare to now.
If it doesn’t work then I can probably throw together a test input datetime and play around with it.
I have built most of the rest of the automation that the above template was needed for but now I am not quite sure how to ‘convert’ the two conditions into a templated action.
I need to turn the input_boolean ON if the conditions are met and OFF otherwise (because it may already be ON from the previous day)
I think I need to remove the conditions and include them in an IF/ELSE type action template…just not sure how to write it.
Hi @finity I am finally back home and tried to test this out. Unfortunately it gives the below error whenever I trigger the automation. The trigger I have seems ok given that it proceeds to the action, however I get the error on the action…
cool!
just be ware: when I typed it in my dev-template it showed fine, even selected the ‘on’… which made we wonder why, since I don’t have these entities, and I think it should have been ‘off’ .
Hence my remark about the template itself. If its running alright, and you can see actual change in behavior when changing the input_numbers to a template=flase state and see the service change to input_boolean.turn_off, all is well.
If not, please come back and well have to analyze the template further.