My Garden Irrigation

Dear Klogg, I’m quite new on hass and meanwhile I had a need to Smart plug
my garden; i found your project very interesting.

I’ve installed the code on my Qnap Docker 0.65 and on Raspberry 0.108, I
found an error related to the automation
“following components and platforms could not be set up: automation”

Do you have the possibility to share the main config yaml
file (configuration. yaml / customize / groups)

to have a look either how you realize the beautiful user interface and to understand if I make some error on those main files ?
Thanks

I would also like to know how to implement it.
I guess it should be done by custom lovelace in configuration.yaml

lovelace:
mode: yaml

but what else should be there and where to place your folders in /config.

Thanks

@CHRIS_CC, @thoky,

If I understand your problems correctly you need to understand that this is a ‘package’. Packages are documented here. In a nutshell this allows you to keep everything to do with one function (in this case, Irrigation) in a seperate folder all of its own.

So in this case, once you have defined packages in your config (following the docs) it should be clear how everything in the folder packages/garden_v2 should be copied to your config. These files are the ones that do the ‘work’.

As for Lovelace, yes, I use mode: yaml.

It might not be clear but the views folder is for v1. (I will change the Github at some point to make that clearer.)

I hope that helps.

My case is not package. I am using v1 since last year and btw perfect code :+1:t3:
I have made all the cards manually and want to use your lovelace design now with v2. I am struggling how to do it. Where should I copy lovelace folder and what should I add under mode: yaml in configuration.yaml in order to work.

Thanks

To be honest it is hard for me to advise you regarding yaml mode in Lovelace. I have never used the UI to configure it so I am not sure how to convert.

It is documented here: https://www.home-assistant.io/lovelace/yaml-mode/ but I think you need to be careful if you currently use the UI and want to change to yaml mode so as not to spoil what you already have. As far as I know there is no reason why my Lovelace config can’t be added to a config created using the UI (but I could be wrong!).

I’d rather not offer guidance in case I tell you something wrong, but follow the docs and you should be ok.

Of course once you have it configured I will help if you have any specific questions.

I am sorry for going back to v1, but I have a question.
I have noticed, the script in entity_id: timer.cycle{{ cycle }}_zone_duration (garden_irrigation.yaml), lines 459 and 464 have cycle1 hardcoded.
like:

              {% set adj_duration = states('input_number.adjusted_cycle1_zone1_duration') | float %}

and

              {% set duration = states('input_number.cycle1_zone1_duration') | float %}

Shouldn’t it be converted to + cycle + to match selected cycle like in:

              {% set adj_duration = states('input_number.adjusted_cycle' + cycle + '_zone1_duration') | float %}

I am asking, but having an issue today, where I have run only cycle2 and Zone 1 set to 20 min, 2 to 10 min, 3 to 10 min and 4 to 10 min and I got the 1st one running for 10 min, 2nd for 10 min and then the valve was closed and timer was still going (from 20 min to 0), 3rd running for 30 min and 4th for 20 min.

I have no idea, what else could have caused that (I did not amend the code other than as I am asking above).

Yes, I you are right, this was first seen in December in this post here - My Garden Irrigation.

I’m not sure how that bug crept in to the code on Github. I never experienced it and even the person who found it wasn’t sure if it had always been there.

Sorry about that.

I will try to get around to changing it on gitHub tomorrow but what you are suggesting does seem to be correct.

Thank you for the immediate response and big thank you for preparing such a nic script.
I have decided to start with v1 to understand your logic, need to see tomorrow, why the counters run from 20 minutes, if they should do it only from 10. Any ideas are more than welcome.

I used a second dashboard for irrigation with yaml mode, but my default dashboard with storange Lovelace mode.

This is interesting. Can you please explain how? Or what should I write in configuration.yaml? Thanks

I’m also struggling to get it configured. I tried to configure it as suggested as a package:
my configuration.yaml includes:

homeassistant:
  packages:
    garden_v2

But I’m getting an error:
2020-04-20 22:39:11 ERROR (MainThread) [homeassistant.components.hassio] expected dictionary for dictionary value @ data['packages']

@klogg know you mentioned a more detailed install guide earlier. That would be very much appreciated for similiar newbies.

hi @klogg, thanks for all your work on this.

I’d just started building a system based around a sonoff 4ch flashed with ESPhome before seeing your work.

I’ve been looking at how to include a failsafe (I dont understand this whole PULSETIMER thing!) and have been looking at https://github.com/bruxy70/Irrigation-with-display

This implementation has a global time variable per switch and then exposes this variable to home assistant so it can be changed per switch.

e.g. this is the call from hass

service: esphome.irrigation_set_time_1
    data:
      time: 900

I was attracted to this as being able to set a timer and know that it will end even if Hass fails to send the end command is obviously important. This also looks much more elegant that what I understand about Pulsetimer.

Hope this is useful.

1 Like

I have plenty to still learn about ESPHome and this is really interesting. I need to spend some more time with it but if I understand it correctly this is a much more elegant method than what I am doing now.

Thanks for pointing this out!

Hi Klogg, any suggestion for sensor.smartweather_average_rain_today I cannot figure out how to declare? and also input_text.smartweather_location_code1 Here I have lots of unkwnow unkwnow unkwnow :smiley:
image

Thank you

You need to configure Smartweather for you area.
Look here and see if there are any stations near you.

If there are you need to note the station number and then create a REST sensor for each station like this,

  - platform: rest
    resource: !secret smartweather_resource_1
    name: smartweather_1
    value_template: >
      {{ value_json.station_id }}
    json_attributes:
      - status
      - station_units
      - obs    
    scan_interval:
      minutes: NUMBER OF SECONDS

You’ll need to register for an api_key.
Don’t make the scan_interval too low else it will hammer their servers and you might get blocked.

My secret looks like this:

smartweather_resource_1: http://swd.weatherflow.com/swd/rest/observations/station/STATION_NO?api_key=MY_KEY

Of course there is no requirement to use Smartweather but if you use something else you will need to change the Lovelace to fit and also the code that collects rainfall measurements.

1 Like

In order to include packages folder you need to add “packages: !include_dir_named packages” under the homeassistant section in configuration.yaml like this:

homeassistant:
  packages: !include_dir_named packages

Then the packages folder place in main config dir config/

Hope it helps

Hi I have got this far with the packages which show up in my entities, but where do you put / activate the lovelace folder into home assistant for it to show up, is this automatically done or do you have to put them into cards yourself ? any help would be greatly recieved.

@klogg amazing job - currently moving my irrigation-system (based on esp8266 and relays) to homeassistant and found your project.

I am wondering if I should use version1 (I only need 2 valves) or should I go with the version 2, which will be more advanced and constantly improved :slight_smile:

please let me know your thoughts… thanks!

Ha! That’s a good question!

If you only need two valves I would consider using version 1. It works well, I’m actually still using it as I haven’t changed my hardware yet or finished installing the actual water part of the irrigation for my new zones (lockdown isn’t helping :wink: )

The main benefits of Version 2 are that it adapts easier for more than four zones so unless you have big future plans that isn’t much use to you. Version 2 is also more flexible in that you have control over things like cycle and zone names from inside the UI and also the run times are much more flexible.

I’m also quite proud of what I have managed to do with the UI given I knew no Javascript or CSS before I started.

But I don’t think any of that is necessarily enough reason to use Version 2 over Version 1.

I don’t plan to make any changes to Version 1 but so long as you watch out for breaking changes in HA it should carry on working.

I’m not saying I won’t try and help if there are problems but I just won’t be enhancing it or making any material changes.

Thanks for showing the faith!! I hope you’re right…

There are also some other people doing this who have systems that you might want to look at.
@tom_l for one, and I know @sparkydave has given me some guidance with hardware but I can’t remember if he has his code posted anywhere. There are others too but my memory is not what it was :slight_smile:

Oh this looks amazing, and exactly what I was looking at HASS doing next… silly question, how does one install this?