My Garden Irrigation

Everything displayed smoothly ! You have done an excellent job @klogg !
Beside the single digit zone numbering, i only have 2 issues. History values (still haven’t manage to make them work) and also that Last Run & History aren’t variable as the cycles, based on the numbers of zones that the user have selected, but they depends on the includes at the yaml file. It’s fine for me, since i can quote out the unused zones. I’m just mention that in case that you are interesting to make it fully custom from the ui.
I’ll make a try for the 2 digits and i’ll let you know how it goes.

Thank you.

I’m not sure I follow you. Both Last Run and History show only the number of zones. Is that what you meant?

8 Zones

5 Zones

My bad. I saw the includes statements and i thought it was fixed. Never try to go with fewer zones. i need more as you can see. Sorryyyy!!!

1 Like

Hi @klogg

I’m trying to look at the history issue I have

I think that the code related is

  #===================================================
  #=== Synchronise the Zone Switch Sensors
  #=== These need to be updated as tehy are templated
  #=== on the switch name provided by through the UI
  #=== and are used in the history statistics sensors 
  #===================================================
  - alias: Irrigation Synchronise Sensor Zone Switches
    trigger:
      - platform: event
        event_type: state_changed

    condition:
      - condition: template
        value_template: >
          {{ 
            trigger.event.data.entity_id in [
              'input_text.irrigation_zone1_switch_entity_id',
              'input_text.irrigation_zone2_switch_entity_id',
              'input_text.irrigation_zone3_switch_entity_id',
              'input_text.irrigation_zone4_switch_entity_id',
              'input_text.irrigation_zone5_switch_entity_id',
              'input_text.irrigation_zone6_switch_entity_id',
              'input_text.irrigation_zone7_switch_entity_id',
              'input_text.irrigation_zone8_switch_entity_id',
              states('input_text.irrigation_zone1_switch_entity_id'),
              states('input_text.irrigation_zone2_switch_entity_id'),
              states('input_text.irrigation_zone3_switch_entity_id'),
              states('input_text.irrigation_zone4_switch_entity_id'),
              states('input_text.irrigation_zone5_switch_entity_id'),
              states('input_text.irrigation_zone6_switch_entity_id'),
              states('input_text.irrigation_zone7_switch_entity_id'),
              states('input_text.irrigation_zone8_switch_entity_id')
            ]
          }}

    action:
      - service: homeassistant.update_entity
        data_template:
          entity_id: >
            {% if 'zone1' in trigger.event.data.entity_id %}
              sensor.irrigation_sensor_zone1_switch
            {% elif 'zone2' in trigger.event.data.entity_id %}
              sensor.irrigation_sensor_zone2_switch
            {% elif 'zone3' in trigger.event.data.entity_id %}
              sensor.irrigation_sensor_zone3_switch
            {% elif 'zone4' in trigger.event.data.entity_id %}
              sensor.irrigation_sensor_zone4_switch
            {% elif 'zone5' in trigger.event.data.entity_id %}
              sensor.irrigation_sensor_zone5_switch
            {% elif 'zone6' in trigger.event.data.entity_id %}
              sensor.irrigation_sensor_zone6_switch
            {% elif 'zone7' in trigger.event.data.entity_id %}
              sensor.irrigation_sensor_zone7_switch
            {% elif 'zone8' in trigger.event.data.entity_id %}
              sensor.irrigation_sensor_zone8_switch
            {% else %}
              none
            {% endif %}

in garden_controller.yaml since the sensor.irrigation_sensor_zoneX_switch does not turn on when the real switch turns on.
I’ve checked that input_text.irrigation_zone1_switch_entity_id contains the name of the real switch and it’s ok.

But when a zone turns on, the relative sensor.irrigation_sensor_zoneX_switch does not turn on, like something is not woking in the automation Irrigation Synchronise Sensor Zone Switches

I don’t use HA automations, since I use NodeRed to do them, so I’m not very expert with the code.

Ok, I’d like to get to the bottom of this problem some are having with the History not displaying.

Can anyone confirm that it works for them and if they are using the latest files from GitHub?

The thing is that it works for me so somehow I need to narrow down what is different for those it isn’t working for.

Thank you.

1 Like

Thanks @klogg

BTW, I have just downloaded the new zip from the repo and replaced all the files, removing them first and installing the new just after…

@klogg Thankz - it seems to work when everyday is selected, but not when random days are used.

image

Also, any specific reason the Zone names are limited on the amount of characters?

I don’t see that happening here…

image

image

image

Thanks for your guide, my HowTo is based on reading it and executing the steps.
Unfortunately for me it seems that the browser_mod is not opening the pop ups when I click on the names, any idea what could cause this?
My main dashboard is not yaml, could this be the cause?
I added the fonts in Configuration/Dashboards/Resources but I don’t know where I can change the fonts for the Irrigation dashboard?

No reason at all except that there is no room in the UI for many chars.
I could increase the size of the input texts.

Just a quick one, do you have more than one browser tab open?
The pop-up always appears on the last one to be opened.
(There is no way around that)

@ekkesa
I just looked and something must have changed in Lovelace since I first wrote this as the slider is now narrower so it does appear there is more room for the names than there used to be!

I never noticed as my zone name are all short. My longest is ‘Fern Spray’ which used to only just fit.

Sorry if it is a bit obvious but I assume you know about this?

image

Thanks for the quick answer, moved the HA to a new window with only one tab, still not working.
It seems that all the fields that use browser_mod are either dead or not doing anything.
Same for the font selection, doesn’t seem to be working.
My setup is RPi4, hassio running in docker, Main dashboard is in UI mode.

@klogg - Very weird,

When running everyday, it calculates correctly:

Seems to be related to choosing specific days - Only change between the two screen grabs are from averyday to specific days.

While typing this I might have figured it out. It is stating it for the current day. I was thinking too advanced, in the sense of if the cycle has completed for the day it looks ahead to the next run cycle and show the results. :wink: Hope is makes sense…

I think so. I could consider making it more intelligent but it would be low priority :wink:

Thx - Agree it is a nice to have, but low priority. My sunrise wish would be more functional :grinning:

Again , Thank you! - This is seriously one awesome piece of coding. Love it!

1 Like

Something changed in Lovelace recently and you may have noticed that all the pop-ups now don’t have rounded top corners.

This is purely cosmetic and it was a one line change (in many files) to correct this.
I have updated GitHub but it has no effect on anything else so you needn’t update if you don’t want to.

1 Like

Hello all, good news finally! I tried this morning to run the Dashboard on my phone where I have HA Assistant and the browser_mod components work on the phone!
Then I tried also in the browser and it also works! Really strange thing!
Anyway small dumb question from my side, I noticed that the Time used by the Irrigation and the actual system time are offseted by 2 hours e.g. my time i 13:46 and Time is 11:46, where can I change that? I tried to change in the System the time from UTC to UTC + 2 but it doesn’t do anything. Btw I am in Germany.

@klogg I manage to fix the 16 zones issue with the single digit, in case that you are interesting.
The issue was at garden_irrigation_start.yaml like you said.Instead of altering the whole thing, i preferred to change your conversion from zone[-1] | int to (zone | trim(‘zone’) | int). This way the current zone1,zone2…zone8 are not affected. All the tests that i have made was successful. Do you think i miss something? I see all of your code and couldn’t see anything relative to a single digit, but i could be wrong.

      #==============================================
      #=== LOOP OR DO THE END PROCESSING IF ALL DONE
      #==============================================
      #=== When the loop counter reaches the number of zones
      #===    then go to Cycle End Processing
      #=== If less than the number of zones
      #===    then increment the loop counter and start again
      - service_template: >
          {% if (zone | trim('zone') | int) == states('input_number.irrigation_number_of_zones') | int %}
            script.irrigation_cycle_end
          {% else %}
            script.irrigation_irrigate_a_zone
          {% endif %}
        data_template:
          cycle: >
            {{ cycle }} 
          zone: >
            {% set next_zone = (zone | trim('zone') | int) + 1 %}
            zone{{ next_zone | string }}
          pause: >
            {{ states('input_number.irrigation_pause_between_zones_in_seconds') | int }}