Hi there,
I can’t find what I’m looking for in the various exchanges.
I am a beginner and I am learning little by little, I turn to you for your help.
I apologize in advance for my English, I am French and I use a translator.
I have home assistant GUI:
Home Assistant 2022.7.3
Supervisor 2022.07.0
Operating System 8.2
UI: 20220707.0 - latest
I’m looking for a blueprint that would allow me to program the switching on and off of an entity at a specific time and during a period of time.
At 6:30 p.m., turn on “switch.irrigation_1” for 30 minutes, then turn off “switch.irrigation_1” at the end of the 30 minutes.
At 7:00 p.m., turn on “switch.irrigation_2” for 30 minutes, then turn off “switch.irrigation_2” at the end of 30 minutes.
etc…
I can’t manage to do this in a simple automation.
Currently, I need to create two automations:
one to turn on “switch.irrigation_1” at 6:00 p.m. and another to turn off “switch.irrigation_1” at 6:30 p.m. for example.
The problem is that I have 15 devices to program and it will be necessary to create 30 automations to do what I want.
I found this: [WIP] - Day / Time selector
It’s great, but I don’t see how to integrate my entity corresponding to my “switch.irrigation_1” for example
I asked for more info on this post without getting an answer, that’s why I’m creating a new one here.
Ideally, we should be able to use this blueprint for any entity (light, power plug, …)
Thinking out loud here… But if I were to write an automation for this, I believe i’d create a input_datetime helper for each irrigation which would have the start time of that irrigation. and then another timer helper for that irrigation which would be the duration for that irrigation to run (or you can use a end time helper too if its fixed).
Then i’d have one automation with a trigger like this:
- trigger:
- platform: time
at: input_datetime.irrigation_1_starttime
variables:
zonename: irrigation_1
- platform: time
at: input_datetime.irrigation_2_starttime
variables:
zonename: irrigation_2
Then within the automation action, you’d use the triggering entity to determine what to run at that time. Like this:
And use the zone name to turn off the right irrigation. You can do this more dynamically as well by using {{trigger.entity_id}} and replacing the names with what you need.
Maybe using the scheduler component would simplify things? Also I think there are specific irrigation integrations that could be of use, but I don’t know links to them off hand.
Good evening,
Thank you so much for sharing, this is exactly what I needed.
I will do some tests.
I will still consider other people’s suggestions.
Thanks for your help.