Do you have actual switches connected and operating?
The history totals are based on the time the actual switch is on.
Like this one?
Where do I find the code where there is the update of the history values?
Thankyou! All is ok now
Hi, Klogg,
I tried to change the pause time, it doesn’t help.
I tried many times and sometimes stops working the relay off feature. If i turn off the manual cycle at the first zone, it works well, if i let the system switching zones automatically at the 2nd or 3rd zone the problem occurs and remains. In that case i have to wait and starts working again or not, or i have to restart HA, restarting HA helps always.
So i changed the code back to ‘my solution’ in this case works well, so i’m statisfied…
Another thing, i’ll try to add a “feature” somehow, but you can do it definitely better and i think not i’m the only one who needs this, a sample script which starts the manual irrigation all zones, starts the irrigation on a specified zone, stops the irrigation. (maybe a feature to skip the irrigation for 1-2 days.)
If these scripts are exists, its very easy to add to google home, and makes possible to start irrigate by voice.
Then so am I
As for those extra scripts, yes, I do something similar now for my Amazon Dash button (but it could of course be any button).
I can easily amend those scripts to do what you want.
I’ll post my current scripts on GitHub and then you can use them as templates or tell me exactly what you want to do.
If you do find your own solutions and you want to, I am happy to add them to the package. They will be standalone so can’t interfere with anything and as you say could be useful for others.
Yes, and are they actually operating or are you still testing?
The History Sensors are in garden_globals_zones.yaml at the bottom of the file.
I try to understand
In that file I find
sensors:
irrigation_sensor_zone1_switch:
value_template: >
{{ states(states('input_text.irrigation_zone1_switch_entity_id')) }}
The value of input_text.irrigation_zone1_switch_entity_id
is the name of the “real” switch defined in the the switch name, in my case switch.sonoff_ch4pro_relay1
When I do a cycle with Zone 1, the switch.sonoff_ch4pro_relay1
turn on, I can see in Settings->States
But if I look at sensor.irrigation_sensor_zone1_switch
it’s off.
This is the code where it should register the time for today, correct?
#=================================
#=== Zone History Sensors - TODAY
#=================================
- platform: history_stats
name: irrigation_zone1_total_time_today
entity_id: sensor.irrigation_sensor_zone1_switch
state: 'on'
type: time
start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
end: '{{ now() }}'
Yes, your interpretation is correct.
I don’t know why your sensor is not changing to ‘on’ I will investigate…
If any one else is following this, does history work for you?
Hi @klogg,
I started using your script, but I can’t understand why in my installation, zones remain ON after irrigation with any cycle.
I found this error in log:
Maybe I skipped something in configuration?
Thanks for your work and you help.
You need to tell the package what your switch names are.
Click on each zone…
Yes, I know switches are already configured in text input, although I use only 3 zones and so I configured the script.
The script turn the switch ON, cycle each zone, but when a zone timer finish it doesn’t switch OFF.
As you can see in my previous post, for every configured zone it search for switch.garden_irrigation_relay_zone_1, instead for unconfigured zones it search switch.zone4…8
I can try to modify your script, but before I prefer to be sure that I have done all in the right way.
What i do is to leave everything as it is and in the ui under general, just select the number of zones you want to use, there is no need the edit the scripts.
Have the same,
When i run manual cycle… its begin
then when the time is done, it switch off but the relay is still ON
muss manualy stich ON then OFF (the manual cycle)
Hi. First of all i wanna say a big WOW to @klogg for this excellent work!!!
I have a problem displaying the lovelace dashboard. I have lovelace in storage mode and i do implement a new dashboard in YAML mode. I have make an include for the view_garden_version2.yaml file that it is located under the lovelace folder through the irrigation.yaml file that i have as YAML lovelace dashboard. In theory it should be working. Instead i get an empty screen. Since my experience in lovelace is not the best one (i mainly use the storage mode so far) i did read every post that i could find (including the really nice guide that @itajackass have make) but still no result.
I do have follow the excellent instructions that Klogg has provide, up to the point (as far as i can tell). I have install HACS (never use it before) and install all prerequisites as stated by the guides and all seems to be ok. I did check that the resources of the modules exists at lovelace.
This is my configuration.yaml file
frontend:
themes: !include_dir_merge_named themes
browser_mod:
homeassistant:
# Load packages
packages: !include_dir_named ./packages
lovelace_gen:
lovelace:
mode: storage
# Add yaml dashboards
dashboards:
lovelace-watering:
mode: yaml
title: Irrigation
icon: mdi:sprinkler-variant
show_in_sidebar: true
filename: irrigation.yaml
and this is the irrigation.yaml file that point to view_garden_version2.yaml
title: Irrigation
views:
-! includes lovelace/view_garden_version2.yaml
Obviously i did something wrong but cant figure it out !!!
This looks wrong…
It should be
title: Irrigation
views:
- !include lovelace/view_garden_version2.yaml
!!!
@klogg You are a life saver !!!
That was it !!!
Need to inform also @itajackass for this. I copy that from his post.
Thank you so much Klogg !!!
I’m a bit confused. Where the section_settings_general.yaml should be located ?
Under root or inside package folder? Cause if it is under root, i didn’t find an include statement anywhere.
It is used in
view_garden_version2.yaml
Line 78