#Calendar event offset from input_datetime

1 messages · Page 1 of 1 (latest)

hexed flume
#

I have set up HA for use in a small community hall so that the heating system is controlled by their booking calendar. All works well. However, I need to hard code an offset to bring the heating on before the calendar event so that the hall is up to temperature before the users arrive. I would really like the offset configurable on the front end via an input_datetime but I am lead to believe that the offset field in a calendar trigger does not support templating. Is this correct, and if so, how can I get around this problem?

Current configuration:

entity_id: calendar.booking_calendar
event: start
offset: "-2:0:0"```

What I'd like:
```trigger: calendar
entity_id: calendar.booking_calendar
event: start
offset: "{{ states('input_datetime.heating_on_offset') }}"```
terse mica
#

If you want configurable offset, template trigger can help you - compare the datetime - now() < deltatime.

#

I think you want to compare the start_time attribute of the calendar with the time now and consider another input datetime or number to manage offset

hexed flume
#

thanks that sounds like a good idea, i'll give it a go

hexed flume
#

This is what I came up with and it appears to work:
{{ state_attr('calendar.booking_calendar', 'start_time') | as_datetime | as_local - now() <= states('input_datetime.heating_on_offset') | as_timedelta }}