Irrigation Unlimited Integration

Sorry, I did not pay attention that apparently the service syntax is not the one you used. Correct one (checked under Developer tools/Services is):

service: irrigation_unlimited.manual_run
data:
  entity_id: binary_sensor.irrigation_unlimited_c1_z1
  time: "00:10"

So in your case could you check this one:

service: irrigation_unlimited.manual_run
data:
  entity_id: binary_sensor.irrigation_unlimited_c1_z1
  time: "input_datetime.irrigation_unlimited_run_time"

hello, no it didnā€™t work. I started the installation from scratch, I had forgotten a few steps and it works. thanks for the help
Thank you

Hello,
working with Irrigation Unlimited a few weeks now, great project.
Can use service ā€œadjust_timeā€ and 'manual_run" via pyscript without problems.
But how can I adjust the starting_time of a zone schedule? ( updating config.yaml and restarting homeassistant is a bit brute force )
Can not work with predefined sequences, as the zones are triggered by evaporation buckets, and many zones can run in parallel, depending on flow rate of the zone and pump capacity. ( rectangular package solver handles the optimization problem )
Thanks for you hints
Xal

Can you give a little more background on what you are trying to achieve. Dynamic schedules could be done but I need a bit more information.

Having 12 zones, with a flow between 4-14 l/min.
Having a pump with 24 l/min.
Running time per zone is calculated from (evaporation-rain) and watering buckets, so I get a list of zones with durations for next day. Can contain 0-12 zones.
For this zones I run ā€œrectangle package solverā€ ( time x flowrate ), to minimze pump running time.
Outcome is a list ā€œTimeā€ and ā€œDurationā€, one line per zone.
Now I want to feed this list into ā€œIrrigation_unlimitedā€. Only way I found is to rewrite config.yaml and restart homeassistant. ( reload ā€œirrigation.unlimitedā€ does not change values )

Thanks for the overview, it does help to understand the problem. Here is my thinking for creating dynamic schedules.

  • Add a schedule_id field to the schedule object. A unique string similar to the controller_id and zone_id fields.
  • Implement a load_schedule service call using the schedule_id as the key. The service data would be identical to the schedule object with all fields optional. If a field is present then it will be updated if not then it will be left alone.

A few notes. This will only do an in-place update, it will not create or delete a schedule (you could disable it however). Initially it will be in memory only, that is until I can figure out storage in HA so you will have to resend the schedules after a restart.

Hi, how can i set adjust_time for Zone 2 in 75% of the daily_adjusted_run_time from HAsmartirrigation?

Hey All,

Iā€™m looking at integrating the smart irrigation solution into Irrigation Unlimited and running into a few problems.

Up until today I didnā€™t have a reset bucket automation which Iā€™ve now rectified and basically verbatim from the documentation. I noted that it did indeed reset the daily adjusted run time value.

alias: Smart Irrigation reset bucket
description: Resets the Smart Irrigation bucket after watering
trigger:
  - platform: state
    entity_id:
      - binary_sensor.irrigation_unlimited_c1_m
    from: "on"
    to: "off"
condition:
  - condition: numeric_state
    above: "0"
    entity_id: sensor.smart_irrigation_daily_adjusted_run_time
action:
  - service: smart_irrigation.smart_irrigation_reset_bucket
    data: {}
mode: single

My adjustment automation is as follows and does need a little work.

alias: Smart Irrigation Adjustment
description: ""
trigger:
  - platform: time
    at: "23:30:00"
condition:
  - condition: and
    conditions:
      - >-
        {{ states('sensor.smart_irrigation_daily_adjusted_run_time') | float(-1)
        >= 0}}
action:
  - service: irrigation_unlimited.adjust_time
    data:
      actual: >-
        {{
        timedelta(seconds=states('sensor.smart_irrigation_daily_adjusted_run_time')
        | int(0)) }}
      entity_id: binary_sensor.irrigation_unlimited_c1_z1
mode: single

I have 3 sequences, the first shown below and I know that in the above yaml, I only have the automation adjusting the first zone. Iā€™d like to be able to adjust all the zones accordingly.

      sequences:
        - name: 'Annual - Group 1'
          schedules:
            - name: 'Summer'
              month: [dec, jan, feb]
              time: '07:00'
            - name: 'Winter'
              month: [jun, jul, aug]
              weekday: [mon, thu, sun]
              time: '07:00'
            - name: 'Spring/autumn'
              month: [mar, apr, may, sep, oct, nov]
              # weekday: [mon, wed, fri, sun]
              time: '07:00'
          zones:
            - zone_id: 2
              duration: "00:05"
            - zone_id: 4
              duration: "00:05"
            - zone_id: 5
              duration: "00:05"
            - zone_id: 8
              duration: "00:05"
            - zone_id: 9
              duration: "00:05"

The duration of zone 1 is sitting at over 11 hours currently, obviously I need to readjust that back to something reasonable :slight_smile:

image

What a great integration you have built @rgc99, " Os meus sinceros ParabƩns! :wink:"
If somebody need it and to to be possible to enable/disable the automatic adjustment Iā€™ve created a input bolean (input_boolean.enable_irrigation_unlimited_adjustment) and have include it in the if statment of the percentage calculation, when ā€œoffā€ returns 100.

# Automation to adjust the run times for Irrigation Unlimited.
# It uses the 5 day weighted rain total and the moving 5 day average temperature sensors
# created above to generate a variation.
# Adjust rain_total_threshold, rain_rate_threshold and temperature_threshold variables to suit you needs.
automation:
  - id: irrigation_unlimited_adjustment
    alias: irrigation_unlimited_adjustment
    description: 'Ajuste Automatico Tempo de Rega'
    trigger:
      platform: state
      entity_id:
        - sensor.irrigation_unlimited_rain_weighted_total
        - sensor.irrigation_unlimited_temperature_5_day_moving_average
        - sensor.pws_precip_rate
    action:
      service: irrigation_unlimited.adjust_time
      data:
        entity_id: binary_sensor.irrigation_unlimited_c1_z1
        percentage: >
          {# Threshold variables #}
          {% set rain_total_threshold = 3.5 %}
          {% set rain_rate_threshold = 1.0 %}
          {% set temperature_threshold = 20.0 %}

          {# Sensor data #}
          {% set rain_total = states('sensor.irrigation_unlimited_rain_weighted_total') | float(-1) %}
          {% set rain_rate = states('sensor.pws_precip_rate') | float(-1) %}
          {% set temperature_average = states('sensor.irrigation_unlimited_temperature_5_day_moving_average') | float(-273) %}

          {# Check if sensor data is valid #}
          {% if rain_total != -1 and rain_rate != -1 and temperature_average and temperature_average != -273 and states('input_boolean.enable_irrigation_unlimited_adjustment') == 'on' %}
            {# Threshold variables #}
            {% set rain_multiplier = (1 - (rain_total / rain_total_threshold)) %}
            {% set temperature_multiplier = temperature_average / temperature_threshold %}

            {% set multiplier = 1.0 %}
            {% if rain_rate < rain_rate_threshold and rain_multiplier > 0 and rain_total < rain_total_threshold %}
              {% set multiplier = multiplier * temperature_multiplier %}
              {% set multiplier = multiplier * rain_multiplier %}
            {% else %}
              {% set multiplier = 0.0 %} {# It's raining or enough already #}
            {% endif %}

            {# Return multiplier as a percentage #}
            {{ (multiplier * 100) | round(0) }}
          {% else %}
            {{ 100 }}
          {% endif %}

Keep the great work! Thanks.

Perhaps this might work.

    action:
      - service: irrigation_unlimited.adjust_time
        data:
          entity_id: binary_sensor.irrigation_unlimited_c1_z2
          actual: "{{ timedelta(seconds=states('sensor.smart_irrigation_daily_adjusted_run_time') | int(0) * 0.75) }}"

Hi Paul,

Maybe adjust the entire sequence instead of individual zones. Just tweak the data in the action. Here the entity_id is the controller/master and use the sequence_id parameter which is one for the first sequence.

action:
  - service: irrigation_unlimited.adjust_time
    data:
      actual: >-
        {{
        timedelta(seconds=states('sensor.smart_irrigation_daily_adjusted_run_time')
        | int(0)) }}
      entity_id: binary_sensor.irrigation_unlimited_c1_m
      sequence_id: 1

The run time will be spread across all of the zones. As the zones (2,4,5,8,9) all have the same duration the spread will be equal. If they were different because one zone needs a longer or shorter run time then the times will be scaled to fit the total time specified.

Works fine for me. Thank you so much!

1 Like

Sorry for my english , but i want use the scheduler card for start irrigation because changing the time in the yaml is inconvenient.
i thinks use manual run service to start. is it possible?
thank you for help

I am just starting to use this and modified the 6.3 Sequence example to fit my 7 zones. So far so good and thanks. I do not see the % complete for each zone or sequence in my frontend. What do I need to do make those appear?

Please refer to the refresh_interval setting in section 5.

Thanks, I added a lineā€¦

irrigation_unlimited:
  controllers:
    zones:
      - name: "Front Right",
        entity_id: "switch.front_right"
      - name: "Right side"
        entity_id: "switch.right_side"
      - name: "Rotors"
        entity_id: "switch.rotors"
      - name: "Back Rotors"
        entity_id: "switch.back_rotors_2"
      - name: "Back Corners"
        entity_id: "switch.back_corners"
      - name: "Left Side"
        entity_id: "switch.left_side"
      - name: "Front Left"
        entity_id: "switch.front_left"
    sequences:
      - delay: "00:01"
        schedules:
          - name: "Before Sunrise"
            time:
              sun: "sunrise"
              before: "00:10"
            anchor: finish
        zones:
          - zone_id: 1
            duration: "00:04"
          - zone_id: 2
            duration: "00:06"
          - zone_id: 3
            duration: "00:07"
          - zone_id: 4
            duration: "00:07"
          - zone_id: 5
            duration: "00:06"
          - zone_id: 6
            duration: "00:04"
          - zone_id: 7
            duration: "00:04"
  refresh_interval: "60"

Did I get it correct? No change.

That looks fine. It doesnā€™t affect the operation only the display of the count down timers while the zone is on.

For some reason Iā€™m not seeing the next run time and I noticed that the automation isnā€™t running.

This is a shot of one area.
image

The yaml hasnā€™t changed in ages.

      sequences:
        - name: 'Annual - Group 1'
          schedules:
            - name: 'Summer'
              month: [dec, jan, feb]
              time: '07:00'
            - name: 'Winter'
              month: [jun, jul, aug]
              weekday: [mon, thu, sun]
              time: '07:00'
            - name: 'Spring/autumn'
              month: [mar, apr, may, sep, oct, nov]
              weekday: [mon, wed, fri, sun]
              time: '07:00'
          zones:
            - zone_id: 2
              duration: "00:05"
            - zone_id: 4
              duration: "00:05"
            - zone_id: 5
              duration: "00:05"
            - zone_id: 8
              duration: "00:05"
            - zone_id: 9
              duration: "00:05"

Any hints on where to look or perhaps Iā€™ve missed an update note.

Cheers,
Paul

@rgc99 I have a question that is not related with your custom component that works great in my setup (and thank you for that) but is related with the ā€œaverageā€ and getting the following on the log ā€œThis is deprecated since 2022.10 and will stop working in Home Assistant 2023.4, it should be updated to use unit_conversion.TemperatureConverter instead.ā€
I did not found any fix in the github repository for the average custom component so Iā€™m asking if there is a away to work around this? Thank you again.

Hi,

Hope you could help me out. So far the addon is running very good. But Iā€™m struggling to setup the history graph of the rain in the last 5 days.

basically I wanted to show the daily rain (via netatmo) for last 5 days/144h but Iā€™m always getting wrong values in the graph.

It shows correctly 8,6mm for today but the data point shows 4,1mm only.

Any idea what is wrong?

Thx
SL

type: custom:mini-graph-card
name: Rainfall 5 Days
entities:
  - entity: sensor.home_rain_today
    name: Rain in mm | liter per sqm
    aggregate_func: max
hours_to_show: 144
group_by: date
lower_bound: 0
decimals: 1
show:
  labels: true
  labels_secondary: true
hour24: true