Home Assistant Community

My Garden Irrigation

#42

Thank you. I’ll take a look at the service. I hope it is good for Italy weather

#43

What do you think about implementing Programs like real system irrigation controller?
For example most of it have Program A, B, C.
Each Program has it’s own start time and duration.
It is usefull for system where a valve watering a garden, and another valve is for microirrigation/drop irrigation: valve for garden probably need minor time and can run every 2 days… Microirrigation can be longer and must run every day, and more times in a day (morning, afternoon and evening)

#44

My new (yet to be fully tested and released) irrigation controller has 3 programs to give the functionality you are talking about there. I hope to have it ready very soon and post it here

1 Like
#45

I’m very curious to see it :slight_smile:

#46

@sparkydave I’m keen to see this too. My NodeMCU turned up this week. I’m yet to do anything with it, but very curious to see your project.

#47

I’m just trying to resolve a couple of syntax errors in the ESP automation which have gotten the better of me and then I think it will be ready… at least I hope so because I want to put it into service in a week

1 Like
#48

This is where I’m currently at… one little hurdle and then the project should work. I just need help comparing some time values.

#49

I’ve finally decided to think about this and actually it should be very easy.

PULSETIMEx can be permanently ON and set to whatever the current zone run time is (plus a little bit). There is no need to ever set it back to OFF. There is already an automation that does stuff whenever the zone runtime changes so it can be put in there.

I’ll look into adding this in in the next few days and I’ll copy it to GitHub.
(As well as the changes I have made to the weather calculations which appear to work quite well).

#50

Very nice! I’m going to finish to wire my sonoff and valves tomorrow and try to irrigate with HA instead the old commercial irrigation controller! At the end do you use new smartweather service for calculation?

#51

Yes I do and it seems to work well.

#52

Ok i’ll try it. My location in Italy is a little far from first available station so i need to try in this way if it is sufficently good for me

#53

Yes, I got lucky. There are only three that you could even consider to be in my area but one of those is less than 5 miles away.

#54

Hi, congratulations for your work, I was very impressed with the structure of your irrigation system.
I’m trying to implement it in my Home assistant configuration, but it doesn’t seem to work, the automations get stuck in the moment that script.irrigation_run_a_cycle must be launched.
Are you sure you don’t miss something in the packages that is present in your configuration?

#55

@daxda There might be one or two very small errors that have crept into the config as I hadn’t touched it for several versions of HA before I put it on GitHub and there have been breaking changes.

I have a working copy on my local machine which I have been testing as summer is coming here and all is working properly so far.

I will upload a complete copy of the package to GitHub again but I’m afraid it probably will not be today. Hopefully tomorrow…

1 Like
#56

I’m rehearsing, and I think there are two problems, the first is relative at “save end restore the current state of cycle_enabled boolean” , , and something that does not work in this part, in fact if I comment I can start the manual cycle

Update next runtime

  - service: input_datetime.set_datetime
    data_template:
      entity_id: input_datetime.cycle{{ cycle }}_next_run_time
      date: >
        {% if states('input_select.cycle' + cycle + '_watering_days') == 'Daily' %}
          {{ (as_timestamp(now() ) + 24 * 3600 ) | timestamp_custom("%Y-%m-%d ") }}
        {% elif states('input_select.cycle' + cycle + '_watering_days') == 'Alternate' %}
          {{ (as_timestamp(now() ) + 48 * 3600 ) | timestamp_custom("%Y-%m-%d ") }}
        {% else %}
        {% endif %}
      time: >
          {{ states('input_select.cycle' + cycle + '_schedule_time') }}
#57

Yeah, ok I feel bad now…
I knew about that error and it is fixed but I thought it had been fixed before I uploaded to GitHub.
Give me ten minutes and I’ll copy the entire package back up…

EDIT: Ok there were three files that needed to be updated. I don’t use GitHub ‘properly’ so all I did was copied the entire files over the top of the existing ones. I guess you’ll be able to see the changes or you can just copy the whole files if you haven’t done any customisations.

As I said I have been using the system a few times this week just to test it and the valves etc. It’s all working well and just to reassure you, I used it all through last summer including two unattended weeks while I was on holiday!

EDIT 2: I also uploaded a new Lovelace file which takes advantage of some new native features removing the need for some custom elements.

#58

Thank you very much you are very kind … I have updated, but I think there is still one thing that does not come back, especially in the service that updates the next irrigation, you are sure you still have this service written like this ??:

 - service: input_datetime.set_datetime
    data_template:
      entity_id: input_datetime.cycle{{ cycle }}_next_run_time
      date: >
        {% if states('input_select.cycle' + cycle + '_watering_days') == 'Daily' %}
          {{ (as_timestamp(now() ) + 24 * 3600 ) | timestamp_custom("%Y-%m-%d ") }}
        {% elif states('input_select.cycle' + cycle + '_watering_days') == 'Alternate' %}
          {{ (as_timestamp(now() ) + 48 * 3600 ) | timestamp_custom("%Y-%m-%d ") }}
        {% else %}
        {% endif %}
      time: >
          {{ states('input_select.cycle' + cycle + '_schedule_time') }}
#59

Friend I found what was wrong, there is too much space in timestamp_custom ("% Y-% m-% d ")}}
Between the d "

#60

I’m not sure if that is what is causing you a problem, I had that space too but my last manual test on Friday worked ok. I have removed the space and will be doing more extensive testing over the next few weeks to catch anything else that might have been caused by breaking changes* or any typos when I went through and did a small amount of tidying up. I will not use the system again for real for several weeks as we will still be having plenty of rain here in the UK!! :slight_smile:

image

*I tried to keep on top of breaking changes as they happened but it was hard for this part of my system as it has been dormant and unused for several months.

#61

UPDATE:
I have added a script to garden_irrigation.yaml that sets pulsetime[1, 2, 3, 4] on the Sonoff to act as a failsafe in the event that HA loses any communication with the switch.

Thanks to @itajackass for finding the Sonoff command.

I should point out that this is NOT yet fully tested.

1 Like