irrigation_unlimited icon indicating copy to clipboard operation
irrigation_unlimited copied to clipboard

Why is `time` required in `manual_run`?

Open zanna-37 opened this issue 2 years ago • 5 comments

Is your feature request related to a problem? Please describe. I don't understand why the time parameter is mandatory in the manual_run service. Wouldn't it be possibile to use the default durations? The ones specified in the configuration as there was a schedule set to now.

Describe the solution you'd like I would like to manually start irrigation using the default durations.

Describe alternatives you've considered Manually put the total time as time parameter, but it does not follow the DRY principle.

zanna-37 avatar May 17 '22 22:05 zanna-37

Actually not a bad idea but raises a few questions. Manual runs are usually performed as an exception otherwise why not schedule them. The durations themselves can be continually adjusted by weather based automations, soil moisture probes, algorithms like HAsmartirrigation and so on. Should the length be the prevailing time or the base duration.

Most often the use of a manual run is a captains call because of an unexpected weather event. Therefore it would stand to reason the duration would be a gut feeling. I am interested in the conditions where it is required and could it be addressed with better scheduling or adjustments.

It is my goal to never use the manual run facility. A totally autonomous system that adjusts itself to the weather conditions, past, present and future - has it been raining, is it raining and is it likely to rain. I know, a dream. So we have the manual run question.

rgc99 avatar May 18 '22 22:05 rgc99

In my use case, I don't have a fixed scheduled. I prefer to have a flexible scheduling with automations (e.g., start when I'm away, or when the energy consumption is not high, etc.). In my opinion, the default length should be the one used as it was scheduled at this moment. Therefore, I would use the prevailing time unless stated otherwise.

zanna-37 avatar May 19 '22 08:05 zanna-37

Can you make a Manual Run possible even if controller is disabled (Enabled = 0)? Quite often it's essential to have a peculiar zone irrigated when central controller is off for 2-3 days (after rain). So Manual Run could be turned on without prior turning on of the whole Controller and afterward without the necessity to switch it off again...

SuperMaximus1984 avatar May 21 '22 20:05 SuperMaximus1984

The adjust_time service call is ideal for this. Set the percentage to either 0 or 100 to act as a switch. Better yet, set up a sensor or use a weather feed to automatically handle the adjustment. There are a few automation examples in the documentation to get you started. You can target controllers, zones, sequences to fine tune which parts to turn on or off. The manual_run service will still operate as normal.

rgc99 avatar May 22 '22 02:05 rgc99

@SuperMaximus1984 thanks for your suggestion, however I think that it would be more visible if you create another issue where it can be discussed properly.

Back to this issue adjust_time would not work great in my use case as the idea is, for example, to run it as soon as I go away, or in general, reacting to some external event. adjust_time is good to react to some state while keeping the same schedule. My use case is more leaned to have a dynamic starting point that depends on external (immediate) events.

zanna-37 avatar May 23 '22 11:05 zanna-37

Hi,

I just got into this problem. I have created two sequences, the "main" one which runs twice a day (different durations for each zone) and a "short" one, that irrigates each zone for 3mins, which I use manually only and without any auto adjustment.

Why he second one? Because:

  • Every time I mow the lawn I manually run it. Not sure why, but I got that recommendation from some gardeners.
  • I also run it some time before having some event in the garden if the day it's too hot.

Also, as a developer, it feels logical than if you dont provide the duration paremeter, the default in the sequence definition is taken.

Thanks for this great integration!

luixal avatar Apr 23 '23 20:04 luixal

+1 for this.

For similar reasons as @luixal, I'd like to manually start a program with default values, without having to remember (and to type, typically on a mobile!) a duration. In fact, I'd actually prefer a percentage adjustment to the default time (just as with adjust_time service) as an optional parameter.

So let me propose this:

  • Make the time parameter optional
  • If set -> keep behaviour as is, use time setting for duration
  • If not set -> activate the zone/sequence/controller in the same way, the schedule would, but do it immediately. Consider adjust_time adjustments.

soeffi avatar May 28 '23 20:05 soeffi

For the brave, these changes are in the repository if someone cares to do a manual install and give feedback. It currently works on a sequence only and does take into account adjustments. Just leave off the time parameter (now optional) or in the case of the card leave it at '0:00:00'.

Manual run on a zone is a little bit more difficult as there is no default time. The duration comes from a schedule for which there can be none or many. Probably solve by adding a parameter default_duration in the zone config. This could form the base and apply adjustment for the run time.

rgc99 avatar Jun 02 '23 06:06 rgc99

Wow, that's great!

I'll need to figure out how to get this installed manually.

If I may suggest, you could add a "duration" parameter to the zone config as well. This can serve as default for manual operation and can also be used as a "per-zone"-default for schedules, assuming a sane order of precedence with other "duration" parameters. I'd guess it would make sense to use:

  1. duration as configured in zone object (default) -> new
  2. duration as configured in sequence object for the current sequence, overwrites the zone default
  3. duration as configured in sequence zone object, overwrites zone default and sequence default

Thanks for a great integration!

soeffi avatar Jun 02 '23 21:06 soeffi

For the brave, these changes are in the repository if someone cares to do a manual install and give feedback. It currently works on a sequence only and does take into account adjustments. Just leave off the time parameter (now optional) or in the case of the card leave it at '0:00:00'.

This doesn't work for me on a recent checkout (5c63d4b6e5). When I start a manual run on a sequence via the card without filling the duration field (leaving the orange default of 0:00:00), I get:

Failed to call service irrigation_unlimited/manual_run. offset should be format 'HH:MM', 'HH:MM:SS' or 'HH:MM:SS.F' for dictionary value @ data['time']

image

If I change the duration to "0", it will start with the default duration. So it just seems to refuse the default "0:00:00".

gaaf avatar Jun 05 '23 14:06 gaaf

The card will need a small update.

rgc99 avatar Jun 08 '23 03:06 rgc99

Card has been updated to version 2023.6.1

rgc99 avatar Jun 08 '23 06:06 rgc99

Now available in current release

rgc99 avatar Jul 23 '23 05:07 rgc99