You can also use my guide, but I suggest to proceed very carefully and check all steps.
I have the main dashboard as Lovelace and it works.
And a question to klogg, is there any way to reduce the minimum water time from 1 minute to let’s say 10 seconds?
Like I mentioned I have only a pump to water some plant pots, 1 minute means 1 liter, which is quite a lot, still perfect for a big pot for 1 week watering, but would be too much for small pots. Of course I could divide the quantity to multiple pots.
Well…
In the short term you can use testing mode which changes ALL times from minutes to seconds.
But that is not an answer for the long term
In theory it would be really easy to make this possible by cycle or by zone (after all, I already do it for testing mode). My problem as with lots of feature requests is that the UI is quite busy already and I don’t want to make it too overcrowded.
It is an idea with merit though. I will think about it…
As an aside, there were two reasons for keeping it to whole minutes. Firstly can you imagine a slider that allowed increments of a second for 60 minutes? That would be 3600 steps. Also I am not convinced that the timing in HA is accurate enough to confidently have a switch on for, say 10 seconds but that in itself isn’t a reason not to allow it. So long as the user is aware that there may accuracy issues.
I am having problem with morning evening and manual buttons name missing they show unknown instead . Check the photo .
Any idea?
Also I have 12 solenoid valves in my garden if I understand correctly I can bind only one switch for every zone , so 8 is the max number of valves supported?
1)I saw there is a fork that could use more then 8 sprinklers.
I naively deleted the the lovelace and packages folder and changed with the ones coming from the fork but nothing is changed. Can someone help me changing version so I could use more than 8 sprinklers?
2)Also, more important,. I can start the sprinkler but I can’t stop it manually .The error I receive is failed call to service script/irrigation_cancel_irrigation . not a valid value for dictionary value @ data['entity_id']
and the status is always " watering"
I found a guys with the same problem I tried to reload as he did without solving my issue.
If I run a cycle the valve close regularly .
3)when I move the slider of irrigation time the number on the cursor is only partially visible
Hi @claustro, Here is my fork with an up to 16 zones branch https://github.com/athan71/HA-Irrigation-Version2/tree/16-zones
I can only confirm that it works with HA 112.x since i have downgrade my HA to 112.x last week to make it work, but I do have update my 16 zones branch with all the latest changes from Klogg and as i read, it should also work with HA 113.2. I just can’t confirm that.
group.irrigation_group_cycle2_sun
name: |
[[[
if (states[‘input_boolean.irrigation_master_control_switch’].state == ‘off’)
return ‘SYSTEM IS OFF’;
else
var today = new Date();
var weekday = new Array(7);
weekday[0] = “sun”;
weekday[1] = “mon”;
weekday[2] = “tue”;
weekday[3] = “wed”;
weekday[4] = “thu”;
weekday[5] = “fri”;
weekday[6] = “sat”;
var day_today = weekday[today.getDay()];
var day_tomorrow = weekday[(today.getDay() + 1) % 7];
if (states[‘group.irrigation_group_cycle1_every_day’].state == ‘on’ ||
states[‘group.irrigation_group_cycle1_’ + day_today].state == ‘on’)
var cycle1_runs_today = true;
else
var cycle1_runs_today = false;
if (states[‘group.irrigation_group_cycle2_every_day’].state == ‘on’ ||
states[‘group.irrigation_group_cycle2_’ + day_today].state == ‘on’)
var cycle2_runs_today = true;
else
var cycle2_runs_today = false;
if (states[‘group.irrigation_group_cycle1_every_day’].state == ‘on’ ||
states[‘group.irrigation_group_cycle1_’ + day_tomorrow].state == ‘on’)
var cycle1_runs_tomorrow = true;
else
var cycle1_runs_tomorrow = false;
if (states[‘group.irrigation_group_cycle2_every_day’].state == ‘on’ ||
states[‘group.irrigation_group_cycle2_’ + day_tomorrow].state == ‘on’)
var cycle2_runs_tomorrow = true;
else
var cycle2_runs_tomorrow = false;
var time_now = states[‘sensor.time’].state;
var cycle1_schedule_enabled = states[‘input_boolean.irrigation_cycle1_schedule_enabled’].state;
var cycle2_schedule_enabled = states[‘input_boolean.irrigation_cycle2_schedule_enabled’].state;
var cycle1_start_time = states[‘input_datetime.irrigation_cycle1_start_time’].state.substr(0, 5);
var cycle2_start_time = states[‘input_datetime.irrigation_cycle2_start_time’].state.substr(0, 5);
var cycle1_name = states[‘input_text.irrigation_cycle1_name’].state;
var cycle2_name = states[‘input_text.irrigation_cycle2_name’].state;
var cycle3_name = states[‘input_text.irrigation_cycle3_name’].state;
var cycle1_running = states[‘input_boolean.irrigation_cycle1_running’].state;
var cycle2_running = states[‘input_boolean.irrigation_cycle2_running’].state;
var cycle3_running = states[‘input_boolean.irrigation_cycle3_running’].state;
if (cycle1_running == ‘on’)
return cycle1_name;
else if (cycle2_running == ‘on’)
return cycle2_name;
else if (cycle3_running == ‘on’)
return cycle3_name;
else if (cycle1_schedule_enabled == ‘on’ && cycle1_runs_today && cycle1_start_time > time_now)
return cycle1_name + ’ at ’ + cycle1_start_time;
else if (cycle2_schedule_enabled == ‘on’ && cycle2_runs_today && cycle2_start_time > time_now)
return cycle2_name + ’ at ’ + cycle2_start_time;
else if (cycle1_schedule_enabled == ‘on’ && cycle1_runs_tomorrow)
return 'Tomorrow at ’ + cycle1_start_time;
else if (cycle2_schedule_enabled == ‘on’ && cycle2_runs_tomorrow)
return 'Tomorrow at ’ + cycle2_start_time;
else return ‘NOTHING SCHEDULED’;
]]]
label: |
[[[
var cycle1_running = states[‘input_boolean.irrigation_cycle1_running’].state;
var cycle2_running = states[‘input_boolean.irrigation_cycle2_running’].state;
var cycle3_running = states[‘input_boolean.irrigation_cycle3_running’].state;
Have you already configured your switches / valves correctly? I got the same error message when canceling manual watering when I hadn’t configured any switches.
After I configured the valves, canceling the manual irrigation works without an error message.
Hello klogg and thanks for the answers.
Related to the testing mode, I want to report a bug.
With testing mode enabled, I put for every day 10 minutes so 10 seconds.
It worked for 1 day but yesterday it started and then it didn’t stop, I was lucky I was in the room so I stopped it manually.
I had a look at the logbook and it is possible that the switches become unavailable immediately after they where turned on, could this be a cause? Do the scripts only change the state from off to on and then on to off?
Can you force is some way that in the case that the switches become unavailable after on, then the script will retry to turn them off also after the timer has expired?
This could be like a safety feature, to not allow the switches to remain on in case of some unavailable hiccups.
Probably when watering the ground if there is no turn off the problem is not so serious, but for my pots as they have a hold on the bottom there is so much water they can take so more than 1 liter (1 minute) means they will overflow and then I will have water all over my living room floor.
P.S.: The history also works sporadically, so I think it may also be caused by some intermittent unavailable states which are not accounted in the scripts.
I noticed by chance that my controller would sometimes become unavailable for a few seconds. I set up a notification for when it happened at it seems to be very rare, maybe once every two weeks. I did however begin to look at some kind failsafe for when that happens along the lines of what you suggest. i.e. before it starts or stops a switch, check the controller is available and if not wait, say, 10 seconds before timing out and turning off all switches.
I got distracted by other things though and never got it finished partly because I have a failsafe time built into my ESPHome code so that the switches cannot be on for a few seconds (currently hard coded to 10 but could be made user definable) longer than the timer.
I might revisit this idea but, and this was another reason I stopped, it will be very hard to test.
For your info the failsafe is done in garden_irrigation_run_a_cycle.yaml1
#=== Set FAILSAFE time to 10 seconds longer than the zone runtime
- service: input_number.set_value
data_template:
entity_id: input_number.irrigation_failsafe_time_in_seconds
value: >
{{ duration | int + 10 }}
In this case, where actual damage can happen in case of failure, I would build in more safety nets.
Like Klogg has done in his ESPHOME; a timer which resets the outputs after the max duration has elapsed. Closer to the actual hardware, eliminating HAS and network issues.
It doesn’t safeguard against a controller lockup though.
Next thing could be a watchdog.
Since the ESPs are so cheap, I would install a second ESP in series (through a relay). One relay can be used for all zones. This ESP also gets the max duration parameter from this integration, so it doesn’t even need modification.