-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suspend does not suspend irrigation time/duration: add pause/continue or freeze/unfreeze to zones, sequences, controllers #142
Comments
I been playing around the suspend function and what I hope it would be able to achieve: all playlists pause, and resume. Unfortunately, my proposed workaround above is not working, since during suspension time the "clock keeps on ticking". So I tried the following:
This works but only on controller level, and not on "system" level ie pause any controller that might run in the next 20 minutes. One would have to do some more complex scripting on the lines of:
All in all, it seems rather complex to do this in YAML or templating. Would it not be possible to create a "proper" playlist pause & resume function in python that becomes part of irrigation unlimited on system, controller and zone level, effectively pushing out everything that is due to happen by the time of the pause? Thanks |
The missing time is an unintended side effect of the enable/disable function. Suspend is really a timed disable. It was envisaged that disable was to take the zone out of commission perhaps for maintenance, end of season, long period of rain etc. The disable would be issued when the system was not operating or if it was then to take effect after the cycle had completed. This is more or less "stop after the current has finished". Would a pause just affect a running cycle? What happens if the system is paused and a schedule is due to start? If left long enough schedules could start to pile up. |
Hi Robert, thanks for responding - all valid questions. So we have the following - can you pls advice if my interpretation is correct? Enable/Disable - Works on Controller, Zone, Sequence. Same as Suspend but with unlimited time (until manual interaction). Suspend - Works on Controller, Zone, Sequence. Same as Cancel but with timer to start again. Cancel - Works on Controller, Zone but not on sequence. Adjust - Works on Controller, Zone, Sequence. Can be negative. In all cases, the clock keeps on running, ie even if something is stopped, cancelled, disabled, the clock continues which means that zone/these zones during pause will not get watered. I somehow still feel that a pause & resume would make sense, for instance due to irregular times relating to maintenance, garden service, pressure drops, electrical mains issues, other functions like tank filling. From a programming point of view, if one wanted to either build this functionality, I think the following needs to be taken into consideration:
Food for thought. Coming back to my very specific requirement to fill our water tanks, I can only come up with the tank filling being a static zone and then slotting it at certain times e.g. morning, lunch, afternoon into existing irrigation scheduled sequences. I do know the time it take to refill, and have statistical data of consumption. Worst case the tank still requires filling, and then that one zone that might be affected will have to close. Do you agree or are there any other/better solutions? The other scenario that I would like to build into functionality is a pressure sensor for the main borehole supply line. Upon drop of pressure (ie someone manually using water through taps), pause & resume irrigation_unlimited. I think this functionality would definitely be a good use case for a farm or small holding (we live on one). Any fluctuating pressure will also reduce the volume output (which I now measure via the more parameter. Again, any more ideas or thoughts on this use case? Lastly, let me know if you ever need help with translation. Happy to do the German one. Thanks |
For the record enable/disable/suspend/adjust also work on sequence zones. In the beginning there was a running clock and this was the basis for the What needs to be done is keep track of the down time during a pause and extend out the end time. Probably not so difficult for running zones but gets a little complicated for schedules that come into play during a pause. If left in the pause state they would start but never finish. There could be a lot of runs waiting in the wings. A resume would probably cause the whole system to come on as the logger jam is cleared. As you suggest some sort of end of life might be a solution. You might be interested in another FR. Here the goal is to track water usage and adjust the run time to meet a volume requirement. We are currently tracking volume usage which looks promising. More to consider... Have fun |
Thanks Robert, the water volume driven duration is obviously the correct way to go for any watering system, so I fully agree with this approach. I will order a Sensus meter with either KNX or probably better ESPHome or modbus connectivity so that I have very accurate data, and will add that to the borehole and then figure out what the expected throughput is per zone. On another note, is there anyway that your system (within python) is calculating a future timeline of controller/zone/start time or sequenced schedule, and if so, output this as JSON onto the Irrigation Unlimited Controller helper entity? If not, I obviously have access to my own configuration's raw data and should be able to compute myself. Just don't want to redo if you have done it elegantly already. |
In the zone entity you can turn on the timeline feature. In each zone entity you will get a |
Hi Robert - just to let you know that I haven't looked into this, but will do so in due course. Been busy learning a bit of Python and did one custom integration (with a bit of help) in order to get better at HA related coding. |
Referencing Robert's comment in this issue which deals with the pause/resume or freeze/unfreeze of sequences, zones etc:
Hi Robert, Thanks for implementing this. I have updated from master repository (via HACS) and can see the new service call as well as the new sequence entities. Feedback:
Maybe consider for manual runs of zones something like sequence 0 or sequence M ?
here are the logs: Tthe sequence icon in the UI changed to the pause icon and the sequence and zone/entity timer increases while being paused (see blue). However, the icon on the actual zone part of the sequence did not change, whilst the timer of the zone increased. however, the irrigation did not stop so the actual switch command was not received by the solenoid. So in a nutshell whatever the pause is doing on sequence seems to work in principle with the icon on sequence. The time increase is 'weird' as it should rather freeze since the UI shows the time remaining, not the end time (which indeed would be an increase). What is missing is that the sequence.pause service call must be passed down to the zones that part of this sequence. Hope this makes sense? I have not yet tested the above on sequences automatically run by the yaml configuration. My current yaml is pasted below, although I doubt you need it. Thanks
|
Hi Martin, Thanks for the help in testing. The full options for the Pause needs more work and perhaps a re-think. Putting on the back burner for a bit to get the release out the door. |
Thanks Robert, and thanks for the new release. I will wait until you had a re-think on sequences with the pause/continue or freeze/unfreeze option. Thanks |
The pause service call has been reworked. It now shuts down running zones and controller while honouring pre and post amble periods. It all gets a bit tricky depending on when in the sequence the pause is issued. Please install from the repository and give it a go. |
Hi Robert, I manually copied When calling the service call pause, nothing happens. See log files I tried to pause on either the controller or the actual entity:
Also, shouldn't there either be a Thanks |
The Cheers |
Morning Robert, Thanks, I tested it and it works. My bad, I assumed it worked on controller or zone level. I wonder if there is merit in changing service name to Lastly, is there a way to list/pull all the current sequences that are actively running ie have at least one zone one? In my particular case I only ever run one zone due to pressure. My use case is that if I am filling the tanks for fresh water of the house (we supply both house and garden with borehole which is best quality drinking water) but the pressure is not enough for the irrigation whilst freshwater tank is (otherwise slowly) filling. Alternatively, maybe the Again, thanks for your work to implement this, one if not the best integration I use. Thanks |
Hi Martin, Glad it's working for you. I think it would be best to have Interesting idea to allow a global pause/resume on the controller. Pause any running sequence or resume any paused sequences. I will have a look into it. Should be interesting. Regards |
Thanks Robert. Agree with the two service calls, makes sense. And it would be easy to create a With regards to the global pause/resume - I think that is relatively straight forward as it simply requires a loop through all service calls for all sequences on each controller (for the controller one), and a further loop through all controllers on system level. I think you built one if not the most advanced/complex/flexible irrigation controllers I have ever come across. The big guys (Hunter, Rainbird, ...) are no where close to what you achieved ;-) Thanks |
Hi Martin, The Regards |
Thanks Robert, currently traveling will test over weekend when back. Thanks a lot. |
Hi Robert, Thanks - that is working perfectly. A few things to consider (or not) before final release:
as opposed to:
Ona another note, the companion card could subsequently do with an update permitting pause/resume once the controller is updated and this enhancement is pushed out with the next new release. I have one further request/suggestion to companion card that could be helpful so will open a new ticket for that. Thanks again - this is a really cool feature to have. |
Hi Robert, one other thing that I would recommend: When a controller is paused via It would be great to do the same on controller level. Thanks |
Hi Robert, here is some code that creates a play/resume button for all controllers. I am using a First, create a group for all controller main entities:
Then a script that toggles between pause/resume based on the fact if there are any sequences that are paused and not all controllers are off. Note that the group of all controllers is the target, not individual controllers. Sequence_id is 0 in order to include all sequences that might be paused.
Then define a button template which can be used with Lovelace to pause and resume controllers' sequences accordingly:
As a result one gets a button that shows one or more zone paused or a button that permits to pause any controllers currently running. This is the functionality that I was looking for and that is now working, thanks to your implementation of the additional service calls. Maybe a consideration for further implementation into the companion card. Thanks a lot, |
Sorry Robert to bother again - it seems there was a case just now where the main controller's attribute Is there maybe something in your code where it works sometimes but not all the times? I couldn't figure it out when it happened, just noticed it. I think it would be prudent to have both status attributes and icons/color on both controller and sequence in sync. Thanks M |
Best is to change the above yaml code for paused sensors from:
to:
then it does not matter if the main controller entity's status is set to paused or off (which was a bit random). |
The sequence has seven different icons/status; Blocked, Disabled, Suspended, Off, Pause, Delay, On. The The controller has five different icons/status; Disabled, Suspended, Off, Pause, On. The pause state is when any of the sequences is in the delay state (which used to be known as pause). The icon/status for the controller in the delay state should be changed to match the sequence. This however may cause automations to break if users have been monitoring this state. Not sure about the introduction of a state where a sequence is in the pause/resume situation. You probably saw the controller status in Confused, I think we have to bite the bullet and change the controller status from pause to delay. The controller and sequences/zones work independently of each other. Because of pre and post amble periods which could be positive or negative, the controller could be on or off before or after the zone. This was one of the main challenges of the pause/resume functionality to correctly manage shutdown and restart times. |
Morning Robert, from my side (after changing above Jinja code to use regex) I am fine as I am now only checking on possible pause status on sequences. So if it helps don't touch the controller. Also not too worried about the icon as the icon and color of the sequence behaves correctly during pause. What would be nice is if I could programmatically trigger that the sequence that is paused shows on the companion card, ie, by default I have all zones and sequences disabled in the view ( Any idea how to trigger that in the front end? Almost need a hook for that button to show zone? |
This would be best left to an option within the card Please feel free to update the documentation. I could use the help. Regards |
Will do feature request on card and also update the documentation least I can do to support your great work. Give me a day or two. Thanks Martin |
Hi Robert, documentation done via PR163. Just a reminder that the help text on the service calls needs amendments as per above:
For reference copying a screenshot here: Also the new service calls are not yet published into a release yet. Thanks a lot. |
Feature Request FR12 added to the companian card. Thanks. |
The text on the service calls has been updated. Please let me know if anything else is needed or better yet this is all in the services.yaml file. Feel free to amend and submit a PR. |
Thanks for the update. Tiny typo fix proposed in #164 On another note, if only sequences or controller entities can be paused/resumed - the drop down list of entities should then only show those? See screenshot below which also lists entity ids of zones. Thanks |
What you see on the Developers->Services screen is all done via the services.yaml file. It is read by HA to display the various fields for each service call. Each field can have a The |
Thanks Robert for the links and explanation, now I understand it better. It is possible to "manually" include and exclude entities, but Jinja does not seem to work within the entity selector. This seems to work by excluding zones manually:
However, this would be cool to only include controllers and sequences using regex within Jinja:
I googled a bit around and found a blue print with a selector that does in fact use Jinja:
Not sure if that helps. I couldn't get the Jinja working. On another note, Feel free to close this issue. From my side it's working perfectly and I am very grateful for the pause/resume services that really help me in our irrigation setup. Thanks again! |
Thanks, the version 2024.5.0 now includes this feature request, much appreciated. |
I've read through here and I'm not quite clear what the behavior is, for example, when a sequence is scheduled to start when paused, or if the pause is so long that a paused sequence's start time comes around again. Hard to know what the desired behavior is, to be honest. Pausing makes sense if for a short time (filling a tank) but less so if the time off is unknown. I have two related cases where I might want to pause or disable. One is I can detect when the pump power is out. This could be many hours long (maybe days). The other is temporary low water pressure likely due to neighbors using the water. In these cases is it better to just disable when power (or pressure) is out and enable after restored for some amount of time? |
Pause only works on a running sequence. It will not prevent future schedules from starting. Its main purpose is temporarily stop for short periods such as filling a tank or access like walking through the sprinkler. Enable/disable will stop everything from running. Suspend is much the same but has a restart time. |
Describe the bug
When using the suspend function in the companion card (or via the service call), although the controller stops (and closes the valves) the actual timer keeps on running. When resume, it does not resume at the run time when suspended.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
What I am looking for is effectively a pause/resume function like in a song/playlist. the resume should continue at the time where stopped.
My (admittedly very personal) use case is that all irrigation zones are powered by a borehole pump, which also fills domestic water tank which requires re-filling at completely random times (pending consumption). pressure is not enough to run fill and irrigation at the same time, so I would have to stop the irrigation schedule/sequence whilst the tank is filling and then resume, however, without losing the time that is dedicated to the specific zone that is currently irrigated at the time I want it the controller to be temporarily suspended .
Additional context
On that note, the enable/disable function shows similar behaviour: When the controller is manually disabled and later enabled again, it continues at a progressed time.
I think it would be great to have a "proper" playlist pause & resume function if that is technically possible.
My alternative resolution is to calculate the "max time required to fill the tank" and to suspend with that max time.
However, there are plenty of other use case scenarios to temporarily suspend and to resume with flexible time, without losing out on irrigation time.
Thanks for one of the most amazing integrations I have ever been exposed on Home Assistant.
Rgds
Martin
The text was updated successfully, but these errors were encountered: