My Garden Irrigation

How do I make binary_sensor.above horizon? I have sun2 installed

Hi viper80, I had some problems with sun2, so I made a simple sensor from sun.sun:

binary_sensor:
  - platform: template
    sensors:
      above_horizon:
        entity_id: sun.sun
        value_template: >
          {{ is_state('sun.sun', 'above_horizon') }}

Cheers Frank.

Hi Guys,
it is possible to have a complete guide to implement openweathermap in this beatiful integration , beacuse i don’t undestand how to create sensor.irrigation_weather_outlook or to setup rain today or rain yesterday.

Thanks a lot
Alessandro

How to send this data to the lcd display ?
watering_status

What entity is responsible for the bottom line ?

Hi Guys,
Have any of you had a similar problem. I can’t set the watering time for the zone. Regardless of the value entered, the total watering time is 0. When I start a cycle, the watering stops immediately.
obraz
I noticed that I get the following warning when changing the time value for the zone in the logs:

2022-05-12 09:44:05 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'str object' has no attribute 'zone1' when rendering '{% set zone_duration = state_attr('sensor.irrigation_cycle3_duration_in_seconds', 'zone_duration') %} {{ zone_duration.zone1 }}'
2022-05-12 09:44:05 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'str object' has no attribute 'zone2' when rendering '{% set zone_duration = state_attr('sensor.irrigation_cycle3_duration_in_seconds', 'zone_duration') %} {{ zone_duration.zone2 }}'
...

I think the code that generates the warning is in the irrigation_globals_cycleX.yaml files:

      #=== Actual Zone durations in seconds
      irrigation_cycle3_zone1_actual_duration_in_seconds:
        friendly_name: Cycle 3 Zone 1 Actual Duration In Seconds
        value_template: >
          {% set zone_duration = state_attr('sensor.irrigation_cycle3_duration_in_seconds', 'zone_duration') %}
          {{ zone_duration.zone1 }}

I checked the behavior of this code snippet in the developer tools. Here are the results I got:

{% set zone_duration = state_attr('sensor.irrigation_cycle1_duration_in_seconds', 'zone_duration') %}

{{ zone_duration.zone1 }}

UndefinedError: 'str object' has no attribute 'zone1'

There is no error when I want to display the full zone_duration variable. When referring to attributes zoneX, an error occurs.

{% set zone_duration = state_attr('sensor.irrigation_cycle1_duration_in_seconds', 'zone_duration') %}

{{ zone_duration }}

{"zone1": "300" ,"zone2": "1800" ,"zone3": "300" ,"zone4": "1800" ,"zone5": "1800" ,"zone6": "900" ,"zone7": "900" ,"zone8": "900" , "zone9":"0", "zone10":"0", "zone11":"0", "zone12":"0", "zone13":"0", "zone14":"0", "zone15":"0", "zone16":"0"}

Have any of you had a similar problem. I am using the latest version of HA Irrigation and Home Assistant.
Thanks a lot
Dawid

Hi @klogg , thank you for your package. I wanted to ask you if you can update it by giving the possibility to add cycles. 2 are few. Thanks a lot

I also had this problem. The timer is at 0, but keep watering. I had set the zone at 11 minutes. It happened to me once

I don’t have this problem. Could there be a configuration error in the timer?

I don’t think this is a timer configuration error. The entity responsible for storing the zone’s working time in minutes takes the value:

2022-05-13 09:33:57 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'str object' has no attribute 'zone1' when rendering '{% set zone_duration = state_attr('sensor.irrigation_cycle1_duration_in_seconds', 'zone_duration') %} {{ zone_duration.zone1 }}'

At this point, it seems to me that the entity:
sensor.irrigation_cycle1_zone1_actual_duration_in_seconds
should get the zone runtime in seconds. IThis does not happen, except for an error in the logs.

Currently it uses a workaround to enter zone run times in seconds directly into the entites:
sensor.irrigation_cycle1_zoneX_actual_duration_in_seconds

Hello Guys,
First of all very nice integration.
I have noticed an issue when stopping a started cycle (using the stop button close to the Next Run section): it will stop the actual zone, but next zone will start after some time.
Is there also a way to request an exeptional skip of cycle for today : For example, I have a party in my garden in the evening and don’t want the cycle to start during the party !!

Thanks a lot

I found a solution. I added a from_json directive for zone_duration variables to de-serialize a JSON string back into an object.

      #=== Actual Zone durations in seconds
      irrigation_cycle1_zone1_actual_duration_in_seconds:
        friendly_name: Cycle 1 Zone 1 Actual Duration In Seconds
        value_template: >
          {% set zone_duration = state_attr('sensor.irrigation_cycle1_duration_in_seconds', 'zone_duration') | from_json %}
          {{ zone_duration.zone1 }}

Now the entered working time of the zones is converted correctly. The following log error has disappeared:
Template variable warning: 'str object' has no attribute 'zone1' when rendering '{% set zone_duration = state_attr (' sensor.irrigation_cycle3_duration_in_seconds ',' zone_duration ')%} {{zone_duration.zone1}}'

Hi,

I would like to use the weather adjustments for only 2 of my 4 zones.
Is this possible and I would I go about this?
Thnx!

Having issues with history totals showing. This has worked for a year or so and has recently stopped.
Sensors are still setup in the recorder and have values when viewing attributed in developer tools. Any ideas on what else I can check?
Hist

Firstly apologies for my absence here and on Github. Real life is taking over recently. I plan to catch up and deal with all the questions and queries in due course but it won’t be for a few weeks I’m afraid.

Just to confirm that the package does still work (on HA 2022.05), I have started using it again this year :grinning:

@jgosnell - yes I noticed this too. It is as a result of 2022.05 removing the ‘pretty’ time attribute in the history stats. It is mentioned a s a breaking change in the release notes.

The workaround is in item_status_history_line.yaml change the custom_fields at the end of the file to the following.

Note that the result is not as ‘pretty’. The times are simply presented as a fraction of an hour. I intend to look into improving this at some point.

The whole history stats integration isn’t great (IMO). You may have noticed some strange rounding errors already. A big pull request was made (not by me) to improve it but it was rejected, possibly because ‘they’ plan to entirely overhaul it :man_shrugging:

custom_fields:
  total_yesterday: >
    [[[
      var zone = '{{ zone }}';
      return states['sensor.irrigation_' + zone + '_total_time_yesterday'].state;
    ]]]
  total_today: >
    [[[
      var zone = '{{ zone }}';
      return states['sensor.irrigation_' + zone + '_total_time_today'].state;
    ]]]

Thank you for your response. That did at least get the values back.

I have the same error… sometimes rebooting HA solves it, sometimes only the left one disappear and the right one stays there.
Have you found a solution?

Hi @klogg and all,
thanks to the many people experiences in the forum, I was able to install the project. Currently if I perform manual watering everything works (switch, history, etc), however if I program a irrigation cycle the watering does not start. It seems as if it carry on to the next schedule, without executing anything. Could you please give me some help?
Thank you all

1 Like

Has anyone noticed that by updating HA to versions later than 2022.5.5, the system does not manage the tasmota device?

Hi, I’m also still at 2022.5.5, with the new HA version there is a different management for template filter/function defaults. The file to be updated should be irrigation_cycle_update_start_time but I didn’t have time to fix it. Don’t know if anyone already looked at it. It should be the same problem that @asb.netatmo wrote few days ago.

ciao, ho questo problema dopo un aggiornamento bloccato in " watering "
cosa devo fare?
Grazie.