Hi
I have 3 automated lights in my bedroom.
LEDs under the bed, a soft lamp and a brighter main lamp.
I’m stuck on trying to figure out how to set date offsets relative to a google calendar entry as a condition (not a trigger)
The calendar entry puts the home into “sleep” and the event’s times often change depending on work schedule, weekends etc. The sleep event also runs a sleep profile on mobile devices (on/off mute w. tasker) so we don’t get disturbed.
What I’m stuck with is setting a condition on 2 sets of distinct times offset against the calendar entry.
The following are all triggered on motion:
LED lights that come on low during “sleep” (this works atm)
The soft lamp from 2hrs pre event start and up to 2hrs after sleep end.
The bright lamp up to 2hrs before the sleep starts and from 2hrs after it ends.
This graphic may make it easier to explain what I’m trying to achieve
Can this be done in a condition (template?) with the single calendar entry?
With the old Calendar system I think I could have created an extra calendar entity for “Near Sleep” offsetting against the main sleep event, but my original setup using google_calendars.yaml broke a couple of releases ago.
I think that that may be working again (?) but I’ve lost trust in that after it broke - esp as it ran my heating schedule among other thing and I’ve since split events into multiple calendars
I think I may have worked out a way of making the calendar offset in a template.
The only thing is that I had to re-introduce my google_calendar.yaml to get each event type back into it’s own unique calendar entity.
Agh, I just realised that doesn’t work.
While it does detect the offset 2hrs in advance, as soon as the calendar entry ends it ignores that entry and applies the +2hr offset to the next event (tomorrow)
I created a boolean and did it this way with an automation.
There are already some other actions when the house goes into “sleep”, so I tagged these onto that automation.
Cut down version below