I have struggled with this for a bit, hence I ended up here again
My application is rather typical I think, but I was not able to find a framework for a solution yet.
I want to be able to set a schedule for the covers to open and close based on a schedule, but also take into account the sun rise and sun set, as well as workdays and Saturday, Sunday and bank holiday.
On top of that, some rooms, e.g. children should be able to have a separate schedule, but also take into account the sun and weekends, bank holidaysā¦
So I came up with a framework like so:
have schedule
helpers for the covers, e.g. one for the main house, one for child 1 and one for child 2. To keep it simple for now
Then, at midnight every day, an automation would be triggered to calculate the open and close times for each section of covers, depending which is first, sunrise or schedule and which is last sunset or schedule. Also it would take into account if the day is a bank holiday with the integration workday
- Workday - Home Assistant. The result would be put into a times of day
helper sensor and those binary_sensor
with attributes after
and before
would be then used to trigger automations to call scripts to open and close the covers.
Now it turns out, that even with spooks installed, I cannot change the before
and after
times of an times of day
sensor, which I find surprising and of course disappointing, sigh there is no action available with
binary_sensor
I found examples where people use the input_datetime
helper instead, but I do not need it as an input field. Those however can be changed within a script with te action input_datetime.set_datetime
Is it common practice to use input
sensors as internal variables
? If so, then I will go ahead with input_datetime
helper.