MTry / homebridge-smart-irrigation

Turn any electrical irrigation valve into a smart-valve.. or run your pumps on a smart schedule based on your climate! This homebridge plugin exposes a multi-zone irrigation sprinkler dummy control system to Apple's HomeKit. Although a dummy, it brings smarts of an evapotranspiration based climate and plant adaptive irrigation controller with the use of OpenWeatherMap API. The plugin can optionally email you, and/or send you push notifications through Pushover or Pushcut, with the watering schedule it has calculated, or when a watering run is completed, along with the next 7-day weather forecast. Added option to expose system controls to Homekit allowing a user to enable/disable irrigation, rechecks, push and email notifications from within the Home App. Associated WaterLevel Characteristic shows the % of watering cycle remaining.
MIT License
78 stars 3 forks source link

[FEATURE REQUEST] - Delay Between Zones and Cycles #34

Closed TheRealSimon42 closed 2 years ago

TheRealSimon42 commented 2 years ago

At first, thank you for all the hard work you put into the plugin.

Is your feature request related to a problem? Please describe. I am running a setup, where I have only one valve and a mechanical auto-switch device behind this valve. This mechanical switch is automatically starting at the first zone of my watering setup. As soon as the water pressure lowers, it automatically switches to the second, third, fourth "zone". But like I said, the water pressure actually needs to lower (recommended by the manufacturer is for one minute), so it can switch to the next zone.

This is currently not possible because the Plugin starts the zones directly after another one has ended image

Describe the solution you'd like Adding a delay between the watering cycles (and / or zones) would solve the problem.

And as the minimum runtime for one cycle would also be 1 Minute (For the Pressure inside the thing to build up), it would also require a minimum runtime... But it would also make some scheduling situations impossible (i.e. not watering a zone for one day because the mechanic wouldn't skip a zone. It would just water the next, presumably wrong one (when the next zone starts)).

Maybe this is just kind out of focus for this Plugin?

MTry commented 2 years ago

Thank you for taking the time to suggest this feature request. I do have a few questions for you though..

Since you are using a device with mechanical auto-switching, how are you planning to control the subsequent zones with this plugin? From what I could understand on the linked device page and google-translate - the device itself offers the option to control the subsequent zone times and that is triggered by the starting and stopping for the first zone in the device. If the watering time of the mechanical auto-switch is determined at the switch itself, this plugin has limited role to play other than making the first trigger and not the watering time? If all you want is a trigger, perhaps the best solution could be a dummy switch which is set on a schedule through Home automation!? Am I missing something here?

Adding configurable delay(between zones as well as between cycles as per some other use cases) is less trivial than it initially sounds since it will involve recoding some calculations at multiple locations - since the plugin aims to conclude watering by a set time rather than simply start at a particular time and then run as long as needed. This is going to take some time unfortunately with my current schedule..

I could suggest a workaround specifically for your case though if my understanding of your situation is correct - intersperse your zones configuration in the plugin with dummy zones - and keep these dummy zones non-adaptive with a prefixed runtime of more than a minute - this could get your device to run properly. However I still don't understand how your mech auto-switching device's subsequent zone time will be controlled by this plugin.. will wait for you to shed some more light on that.

TheRealSimon42 commented 2 years ago

Hey Mtry, thank you for the response and your explanations πŸ₯‡

About the switch: It just automatically switches to the next zone, when the water pressure lowers. So, it can't really be controlled, you just need to cycle through all the zones in the exact order as they are attached to the outlets of the "switch". So, this is how it's working: Start Watering β†’ Zone 1 gets watered β†’ Stop watering (for approx. 1 minute) β†’ The pressure lowers, and it switches to the next zone β†’ Start watering β†’ zone 2 gets watered β†’ Stop watering (for approx. 1 minute) β†’ The pressure lowers, and it switches to the next zone β†’ ...) If this didn't enlighten you, I would be happy to capture a quick Video for you πŸ‘

But yea, I kind of figured out already, that I might be better off with one valve for each cycle, just because of "logical" operation and individual watering needs for the zones. Not so much because of the features from this plugin, just because of the physics of nature :D

Nevertheless, I figured out a way to add a "delay" via HomeKit Scenes (just switching off the valves when 85 seconds runtime is left). Because I have sprinklers which require quite a long runtime, the missing seconds shouldn't be a problem.

Enough for a workaround, I guess for a pro-solution you have to have 1 valve for each cycle.

In case anybody needs it: Turning on:

image

Turning off:

image

Disabling Irrigation if any zone is scheduled for 90 seconds or less:

image

Of course, you also need another automation, which turn the Irrigation back on in case it got disabled by the above ;)