💡 On-Off schedule with state persistence

Hi @ajtudela, I’m sorry for my late response.

I think I understood what you want to achieve here, and I agree adding the ability to specify on_time and off_time via input_datetime helpers is a nice addition, especially for advanced users. By the way, I’d prefer to leave also the old time inputs for a more basic usage.

Any tips?

Looks good, I’d suggest to use the states() function instead of accessing the states object directly in templates, as suggested in the Home Assistant Templating documentation.
By the way, is the blueprint you posted here working as expected?

I’ll work on this new feature in the upcoming days and let you know as soon as it’s ready.
Thank you for the nice suggestion! :slight_smile:

I’ll work on this new feature in the upcoming days and let you know as soon as it’s ready.

Thanks Matt!

By the way, is the blueprint you posted here working as expected?

Sadly, no, the opposite. It turrns on at off_time and turns off at off_time.

Hi @ajtudela,

Sadly, no, the opposite. It turrns on at off_time and turns off at off_time .

Oh ok, maybe some additional debugging might be needed. By the way, I’ll try to implement the feature on my version, so you can then update and use this blueprint as desired. :+1:

hi, can you help make the template on / off by day/week?

Hi @mbah-dukun, thank you for reporting here.

unfortunately this blueprint doesn’t support specifying day/week for the on/off schedule: it only allows to input the time which the target will be turned on/off at every day.

By the way, this is something we might definitely consider for a future update. :+1:

Can you make it, for example it is turned on at 8:00 for 5 minutes, after that it is automatically turned off, this is very useful for watering the garden.

Hello, great blueprint! Have a feature request. Perfect use for this blueprint is automating lights. For example, driveway lights. In my case, the light automation is based on an offset from sunset and the automation is often missed if I’m working on the HA server.

It would be great if, instead of specifying a specific time, and offset from sunset or sunrise could be specified.

Thanks!

Love this blueprint as well. One feature that I feel like would be useful would be a trigger condition. For example, I have a “Vacation” toggle, and I only want the lights to turn on and off if I’m home, not if I’m away from the house.

Just a thought!

1 Like

I second the need for an additional condition.
In addition to vacation schedule, things like Christmas lights could be set to only trigger during a specific date range.

Great blueprint!

Question: Regarding this function “Trigger at Home Assistant startup” does that simply trigger every time HA starts up regardless of the On Time and Off Time? Thanks!

1 Like

Hi, great job, I don’t know if it is already possible to do this but it would be useful to integrate the sending of a notification to avoid doing another automation

Anyway I can just say to trigger to come on at sunset rather than a time?

3 Likes

I have the same question as Agengr1293…Is there away to start it at sunset?

1 Like

@epmatt will you add a day selection (Mon, Tue, Wed, Thu, Fri, Sat, Sun)?
I want to use this blueprint but the device I need to switch only needs to be turned on and off once a week.

The default time condition can be used for this: Conditions - Home Assistant