Hello,
I am new to home assistant and I can’t find any way to make my offset for an automation trigger variable.
The trigger is based on a calendar event and now I would like to have the ability to use a variable offset here. So i created a helper that is a number and now I would like the trigger offset to be as many minutes as this variable. How can I achieve this ? I was searching very long time and found nothing about this. Hope you can help me.
Sorry, the calendar offset value can not be templated, it must be a fixed timedelta object.
Do you want a variable offset before or after the event occurs?
For after the event, you could use a variable delay in your automation actions.
- delay: "{{ states('input_number.delay_in_minutes') | multiply(60) | int(0) }}"
For before the event (or both before and after) you could use a fixed offset for the largest offset you want, then use a variable delay in the automation to bring it closer to the event. It’s messy and hacky but the only way I can think to do it.
The problem is, that i need to start heating the room before an event in the calendar. I wanted to make this variable, because i need to experiment with this and having to change all automatisations just to try another setting is a bit of a pain.
So you dont see any possibility for this ? Perhaps if i try to do it in nodered ?
Yes I do like I said:
OK, sometimes i need a bit longer. Now i understand. So for example i do 180 mins on offset and then a delay 180-(until the desired amount stays). Thank you, thats very good.
Yeah go back as far as you will ever want to with the (fixed) offset, then come forward with the variable delay.
Am i right, that if i create an event 1 hour in the future, but i use 3hrs offset and a delay, then it will not trigger, because of the big offset ?
Yes that is correct.