Does anyone know if it is possible to use multiple esp devices with the built in sprinkler control? My use case is that my bore pump control is a significant distance from my irrigation control gear and I would rather use a $10 wireless device than dig trenches and run cable
For some reason I thought it would be simple to call a switch on/off on another esp home device with the sprinkler controller to start the pump… but maybe not?
ESPHome doesn’t have any mechanism to communicate directly between devices. You’d probably have to come up with some sort of fake switch which can be triggered by the sprinkler component, then react to that state change in Home Assistant and trigger the switch in the other ESPHome device.
Now that i realized ESPHome has a new (new for me) Sprinkler component, i can change my previous ESPHome made up sprinkler solution. I got a question though:
I have 3 valves and no pump in my sprinkler config. I used interlocking in GPIO switches since the pressure is enough for only 1 zone at a time. Also, i used to send the zone times at the start instance, so that if the WiFi connection of the ESPHome is lost, it can still turn off the valves in time and not make a flood:
So, i was just using “esphome.espsprinkler_set_time_1” service to set up the duration and switch on GPIO1. So, even if the WiFi connection is lost, ESPHome will still be able to switch off valve1.
My questions are:
Do i still need this way of check for WiFi connection loss, or the ESPHome sprinkler controller is handling to switch off the valves after duration is completed, standalone on connection loss?
Will leaving the interlocking mechanism on GPIO settings create a problem or is it OK?
No, you don’t need to do that. The sprinkler component handles run durations on all its own, and does not need a network connection to run its programs (only to start them).
If you only have one sprinkler component in your configuration (the equivalent of a ‘program’ in a dedicated irrigation controller), you can use the valve_open_delay setting to ensure that only one valve is open at a time.
Also, there’s a major upgrade of the component in the ESPHome dev branch, which provides easy-to-use support for persisting the valve durations (and the multiplier) across reboots and upgrades. If you’re interesting, @rcblackwell and I have created a really nice configuration which makes use of this and can share it with you.
Please can you post your complete sprinkler system setup?
Too bad it is not possible to enter the days of activation for each single valve.
For example, I have areas that I would like to water only Monday-Wednesday-Thursday.
Here you go… this is 'esphome config` output so it includes a lot of stuff that isn’t actually required in the config files, but I don’t have time to trim it down
Thanks!
How did you set up the automations in Home Assistant and how do you manage them?
I currently have a zigbee relay that manages a single pump, a very simple system, and it’s done like this with also a notification in case the program is not executed due to a problem
I haven’t setup automations in HA yet, since we’re still about a week away from warm enough weather to actually activate our irrigation system… but I plan to use the new ‘Calendar’ features to trigger automations that use the services I defined in ESPHome.
Am i supposed to set the schedules with automations on HA? If that is so, then i need to add sprinkler.set_valve_run_duration to services, right? Then the automation on HA in order should be:
Enable required valves
Set valve durations
Start service sprinkler.start_full_cycle
I am supposed to be changing the schedules (set valve durations) as required per week or season or whatever. Is this way OK or is there any other way?
First, with the ESPHome release a few days ago, there’s no need to set the multiplier in an on_boot action, or to multiply the numbers by 60 to get minutes. You’re already using a number component for the multiplier, and you have restore_value: true so its value will be remembered by ESPHome. If you look at the examples in the current ESPHome documentation you can see how to set those numbers so that they will be interpreted as minutes instead of seconds.
If you want all of your valves to run in sequence, then in HA you only need to trigger the start_full_cycle service, and the ESPHome sprinkler controller will take care of the rest.
You can change the valve run durations directly in Home Assistant, since the number components will appear there. If you change them manually that’s fine, you can also setup HA automations to change them however you like. Regardless of the method you choose, the new durations (and multiplier) values will be stored in ESPHome. For seasonal changes, it’s easier to use the multiplier to adjust the watering time instead of adjusting the run durations directly. Set your run duration to the time you want for ‘mild’ weather (spring/autumn) and then use the multiplier to increase (summer) or decrease (winter) the calculated run times.
My understanding of the multiplier was foggy at best until now. Thanks for the clear explanation. It’s helped immensely. I now see where such would be beneficial in my use-case. Back to coding I go!
I think i finalized my configuration at last. I have no pump, 1 controller, 3 valves+1 valve spare. This config also saves multiplier and run durations to esp8266 flash so on reboots and power cuts, it can restore these values. I do not use “repeat”.
Please feel free to correct my mistakes and excess configuration since i am at best a beginner on ESPHome, and i collected all these config from you guys’ configs. Btw Thanks a lot to you guys for all help especially @kpfleming and @rcblackwell .
Looks nice! I don’t think you actually need the services for setting the multiplier and run-durations though; those number entities should appear directly in HA and be settable via the normal HA automation system. If you use an HA automation to change the value of the multiplier number, that will be communicated to ESPHome, take effect, and also be stored in flash.
I thought, if i need a double or triple schedule like 10:00 in the morning for 10 mins and 22:00 for 5 mins, then in the automation i could set multiplier to 2 in the morning, start full cycle, then set multiplier to 1 in the evening and start full cycle again; assuming i left the duration as 5 mins. Or, in the automation i let alone multiplier to 1 and change specific valve durations with the automation to handle this double or triple different schedules through the day. Because morning and evening durations of each valve changes in my situation, it is not always a multiplier. Like:
10:00
V1: 10mins
V2: 5 mins
V3: 15 mins
22:00
V1: 5 mins
V2: 0mins
V3: 12mins
Some of the lawn are under sun, some are in shadows etc . That’s why the duration changes…
That was the reason why i put these services for multiplier and run-durations. I don’t know if there is any other way…
The number entities are directly modifiable in Home Assistant; there is no ‘custom’ service needed. When building an automation using the UI, use the “number.set_value” service (part of HA itself), then choose the appropriate number entity from your ESPHome device’s entities.
I’m really surprised, I never see people use the divide function. If you live in a hot climate, hate seeing water from your system running into the road or if you want to water in a smarter way, I’d suggest people look into it.