Sprinkler Irrigation by Volume, Rain and Soil Moisture (Tuya GiEX Zigbee) Dashboard

Feature Overview: I will update the pictures for when there is a rainy week.

V1.0 Initial

  • Water only if below a measured Median Soil Moisture Level.
  • Set Garden Area for Water Volume Calculations.
  • Set Weekly mm of water per square meter of Garden Area.
  • Dynamically change charts based on settings.
  • Automatically Set irrigation valve Volume Required.
  • Calculate Total Rain Volume and mm over a 7 day period.
  • Calculate Water volume required minus Rain Fall Volume.
  • Water only on Set Days of the Week.
  • Divide Total Weekly Water Required over set days.
  • Calculate Water Consumed Monthly & Annual

V1.1 Update

  • New Picker for Garden Settings.
  • Volume Required is Divided over two watering session per day
  • Volume Required is further Divided into 7 sessions per week.
  • Times can now be set from the UI with a time picker.

V1.2 Update

  • New number picker for Area & Weekly Water.
  • Custom Expander Card used to hide stats and enable easier viewing of multiple beds.
  • Improvement for mobile and tablet viewing, uses Sections View (experimental).

V1.3 Update

  • Utilises Expander Card to make more room on a single dashboard.
  • New number picker for Number of Cycles and Set Cycle Interval.
  • Adjustment to Water Consumed Daily Statistics Sensor Reduced to 1 Day.
  • Rain Delay 24hrs if more than 10mm forecast next day, Will deliver residual volume after rain.
  • Updated Node Red Flow
  • Prevent Run-Off Water
    • Deliver Volume Required over multiple Cycles with Cycle Interval Delay in-between.
  • Sensor Set Valve Cycle Helper,
    • Work around for valve cycle behavior.
    • Valve: 0 = No Cycles, 1 = 2 Cycles, 2 = 2 Cycles, 3 = 3 Cycles.
    • Sensor Set Valve Cycle Helper: 1 = 0 No Cycles, 2 = 2 Cycles, 3 = 3 Cycles.
    • For the Volume Per Cycle Sensor to work, this cannot be divided by 0 giving a Div0 error.
  • Volume Per Cycle Sensor Added
    • This now sends the volume to the valve.
    • = ((((VOLUME REQUIRED) / DAYS PER WEEK)) / TIMES PER DAY)) / SET NUMBER CYCLES)
  • Water Volume Required Sensor
    • This is used to populate the Volume Per Cycle Sensor - No longer sends to valve.
    • = (WEEK TARGET VOLUME - RAIN VOLUME 7 DAYS)

V1.4 Update

  • Valve Volume Per Cycle changed for Big Number Card
  • Minor update to Daily Monthly Rain Graph (Fix X Axis)
  • Rain Delay 24hrs - Wait until Tomorrows Rain Chance Less Than 20%.
    • Will continue to account for any rain in the 24hr wait period, then deliver residual amount once below 20%
    • Use BOM Australia Sensor chance of rain, can be exchanged for a mm of rain forecast sensor.

Requirements -

Showing Default View

  • Multiple gardens on one page.
  • Statistics hidden.
  • Expander Card can be conditionally expanded or contracted by screen size. Settings in card.

Showing Expanded View

Showing Expanded View

Most of the sprinkler & irrigation integrations I could find, only provided time based watering rather than volume based watering, with no moisture meter. I also could find very little information on ideal soil moisture levels and volumes required. Most likely because the technology has not been there for that style of watering.

The resource this is based on.
Tesselaar Best Way To Water Your Garden was one of the few resources I found for Australia. I use a garden weeper hose for irrigation. Over watering during winter is a problem, with the high rainfall we get in Tasmania.

Also based on Accurite Soil Moisture Guide

WHY IS IT BEST TO WATER THE SOIL AROUND THE ROOTS?

The roots are where the plants access the water and utilise it for growth and function. Watering the foliage can encourage fungal disease, especially in spring and autumn as the foliage stays wet during the cool of the evening. In hot weather, if you water the foliage in the heat of the day, and the total dissolved salts is high, it can burn the foliage.

  1. Deep, regular watering every week to ten days provides consistent moisture to enable the plant roots to grow at a healthy rate and create a strong, disease resistant plant.

  2. Watering too much too often – the roots are not proliferating because there is not enough air in the soil to thrive.

  3. Shallow, frequent watering encourages the roots to grow at the top of the soil where they are easily damaged and unable to access the stores lower in the soil profile, so less likely to survive dry conditions.

You should aim to apply around 24L per square metre every seven to ten days to keep your plants happy and healthy. Plants absorb water from the root zone which is usually 15-20cm below the soil, so aim to wet this deeply when you water.

This 24L is roughly equal to 24mm of rain. So when you hear the meteorologist tell you there has been 1-2mm of rain for the week, you still need to water, especially if the weather has been warm. The soil might look wet, but if you dig down you will see the rain has just touched the surface. However as the rain has touched the surface, it is a good idea to water, as it will help push the water down into the soil profile.

If the weather has been hot and dry for many weeks, or the soil has dried out, you may need to increase the amount and frequency you are watering in order to re-wet the soil. Re-wetting the soil ultimately uses more water than maintaining a constant watering program.

Zigbee Soil Moisture Meter
I bought 3 of these for each garden bed, to ascertain a median soil moisture. Connected with Zigbee2MQTT. Good signal from outside, I only have 1 coordinator and two zigbee repeaters in my network.

  • Zigbee Model TS0601.
  • Manufacturer TuYa.
  • Model TS0601_soil
  • Supplier AliExpress AUD $23.50

    image

Zigbee Irrigation Valve
I bought 1 of these per garden bed. Yes they are compatible with Australian garden taps. The adapter is handy, if you need to use it at the top, the thread will be correct at the bottom. If you use it at the bottom the thread will be correct at the top.

V1.3 Sensors in configuration.yaml - You will need to set these up manually.

# Back Garden Water Valve - 0 or 1 for Mini Graph Card
      back_garden_valve_on_off:
        unique_id: 686b9ef3-26fa-4057-9734-f4cd39f41749
        friendly_name: "Back Garden Water Valve ON OFF"
        value_template: >-
          {%- if is_state('switch.0xa4c13839477a051c_state', 'on') %}
          0
          {%- elif is_state('switch.0xa4c13839477a051c_state', 'off') %}
          1
          {% else %}
          1
          {%- endif -%}

# Template for RAIN VOLUME LAST 7 DAYS - Back Garden - (= Rain 7 Days * Set Garden Area)
      rain_volume_7_days:
        unique_id: 88518e81-3826-4efa-9501-388afc1dfeaa
        friendly_name: Rain Volume Last 7 Days
        unit_of_measurement: L
        value_template: "{{(states('sensor.rain_last_7_days') | float(0)) * (states('input_number.back_garden_set_area') | float(0)) | round(1)}}"

# Template for WEEK TARGET VOLUME - Back Garden - (= Set Rain mm/m2 * Set Garden Area)
      week_target_volume_back_garden:
        unique_id: bff13231-85e3-4e7b-8714-42ba761fedd3
        friendly_name: Back Garden - Week Target Volume
        unit_of_measurement: L
        value_template: "{{(states('input_number.back_garden_set_mm_m2') | float(0)) * (states('input_number.back_garden_set_area') | float(0)) | round(1)}}"

# Template for DAYS PER WEEK - Back Garden - (= Count Number of Days) UI Buttons
      back_garden_days_per_week:
        unique_id: 57fbc2fd-1970-4470-9477-71c4a7d44dc7
        friendly_name: "Back Garden Days Per Week"
        unit_of_measurement: 'days'
        value_template: >
          {{[ states.input_boolean.back_garden_1_sun,
              states.input_boolean.back_garden_2_mon,
              states.input_boolean.back_garden_3_tue,
              states.input_boolean.back_garden_4_wed,
              states.input_boolean.back_garden_5_thu,
              states.input_boolean.back_garden_6_fri,
              states.input_boolean.back_garden_7_sat ]
            | selectattr('state', 'eq', 'on') | list | count}}

# Template for TIMES PER DAY - Back Garden - (= Count Number of Times Per Day) UI Input Buttons
      back_garden_times_per_day:
        unique_id: a72a4376-adba-4d9c-8307-6ece98cff2b0
        friendly_name: "Back Garden Times Per Day"
        value_template: >
          {{[ states.switch.back_garden_set_time_switch_1,
              states.switch.back_garden_set_time_switch_2 ]
            | selectattr('state', 'eq', 'on') | list | count}}

# Template for SETTING CYCLES IN VALVE - Back Garden - (1.0 = 0) Otherwise return value (work around for valve behaviour 1=2) UI Input Buttons
      back_garden_set_valve_cycles_helper:
        unique_id: 0d24edfc-f35f-4d37-80d9-da64c50e6bd9
        friendly_name: "Back Garden Set Valve Cycles Helper"
        value_template: >-
          {%- if is_state('input_number.back_garden_water_valve_set_number_cycles', '1.0') %}
          0
          {% else %}
          {{(states('input_number.back_garden_water_valve_set_number_cycles')) | round(0)}}
          {%- endif %}

# Template for WATER VOLUME REQUIRED - Back Garden - (= (WEEK TARGET VOLUME - RAIN VOLUME 7 DAYS)
      water_volume_required_back_garden:
        unique_id: 6e67a45d-40b7-4150-adfd-3c3404b7795c
        friendly_name: Back Garden - Water Volume Required
        unit_of_measurement: L
        value_template: "{{(states('sensor.week_target_volume_back_garden') | float(0)) | round(0) - (states('sensor.rain_volume_7_days') | float(0)) | round(0)}}"

# Template for VOLUME PER CYCLE - Back Garden - (= ((((VOLUME REQUIRED) / DAYS PER WEEK)) / TIMES PER DAY)) / SET NUMBER CYCLES)
      back_garden_water_volume_per_cycle:
        unique_id: 06073478-c0b1-4512-acea-53a518dc0178
        friendly_name: Back Garden - Water Volume Per Cycle
        unit_of_measurement: L
        value_template: "{{(((((states('sensor.week_target_volume_back_garden') | float(0)) - (states('sensor.rain_volume_7_days') | float(0))) / (states('sensor.back_garden_days_per_week') | float(0))) / (states('sensor.back_garden_times_per_day') | float(0))) / (states('input_number.back_garden_water_valve_set_number_cycles') | float(0))) | round(0)}}"

# Rain Last 7 Days (mm) (Outputs Rain Accumulation Last 7 Days)
  - platform: statistics
    name: "Rain last 7 days"
    unique_id: afe4b9f2-d0a6-4c42-86eb-786737f2ea14
    entity_id: sensor.netatmo_devonport_tas_indoor_rain_rain_today
    state_characteristic: sum_differences_nonnegative
    max_age:
      minutes: 10080
    precision: 1
    keep_last_sample: true

# Back Garden Valve 1 Day (mm) (Outputs Water Consumed Last 1 Day - Used for Apex Charts Card)
  - platform: statistics
    name: "Back Garden Water Consumed Daily"
    unique_id: 42572c8b-e257-430a-98eb-791a525b8212
    entity_id: sensor.0xa4c13839477a051c_water_consumed
    state_characteristic: sum_differences_nonnegative
    max_age:
      minutes: 1440
    precision: 1
    keep_last_sample: true

# Template Time Since Last ON Back Garden (Outputs timestamp of last ON)
template:
  - trigger:
      - platform: state
        entity_id: switch.0xa4c13839477a051c_state
        to: 'on'
    sensor:
      - name: back_garden_valve_last_on
        unique_id: b54c02fb-d1d8-48a5-b263-d797b60fc875
        state: "{{ as_timestamp(states('sensor.date_time_iso')) | timestamp_custom('%H:%M %a %b %d') }}"

V1.3 Helpers Required

1 Like

V1.4 NODE RED FLOW

NODE RED FLOW WRITTEN UP IN THIS LINK:
Use the above link to import the flow, one flow will do one Garden Bed.

APEX RAIN FALL GRAPHS, YEAR, MONTH, DAY, HOUR

THE ENTIRE DASH BOARD YAML

The whole dashboard has got too big to fit here 422 Error.

SECTION 1 of 3

Done in the new Sections View, good for phone and tablet.

type: grid
cards:
  - type: horizontal-stack
    cards:
      - type: custom:mushroom-number-card
        entity: input_number.back_garden_set_moisture
        display_mode: slider
        name: Set Target Moisture Level
        icon_type: none
        layout: horizontal
        card_mod:
          style:
            mushroom-number-value-control$: |
              mushroom-slider {
                {% set nbr= states('input_number.back_garden_set_moisture') | float %}
                {% if nbr<21 %}
                --main-color: #F75050 !important;
                --gradient: -webkit-linear-gradient(360deg, rgba(112,7,0,1) 20%, rgba(115,117,0,1) 21%, rgba(115,117,0,1) 40%, rgba(0,97,34,1) 41%, rgba(0,97,34,1) 60%, rgba(0,104,117,1) 61%) !important;
                {% elif nbr<41 %}
                --main-color: #55E84A !important;
                --gradient: -webkit-linear-gradient(360deg, rgba(112,7,0,1) 20%, rgba(115,117,0,1) 21%, rgba(115,117,0,1) 40%, rgba(0,97,34,1) 41%, rgba(0,97,34,1) 60%, rgba(0,104,117,1) 61%) !important;
                {% elif nbr<61 %}
                --main-color: seagreen !important;
                --gradient: -webkit-linear-gradient(360deg, rgba(112,7,0,1) 20%, rgba(115,117,0,1) 21%, rgba(115,117,0,1) 40%, rgba(0,97,34,1) 41%, rgba(0,97,34,1) 60%, rgba(0,104,117,1) 61%) !important;
                {% elif nbr<100 %}
                --main-color: #39BEEA !important;
                --gradient: -webkit-linear-gradient(360deg, rgba(112,7,0,1) 20%, rgba(115,117,0,1) 21%, rgba(115,117,0,1) 40%, rgba(0,97,34,1) 41%, rgba(0,97,34,1) 60%, rgba(0,104,117,1) 61%) !important;
                {% endif %}
              }
  - type: gauge
    entity: sensor.back_garden_median_moisture
    needle: true
    min: 0
    max: 100
    segments:
      - from: 0
        color: "#F75050"
      - from: 21
        color: "#55E84A"
      - from: 41
        color: seagreen
      - from: 61
        color: "#39BEEA"
    name: Back Garden Median Moisture
  - type: custom:expander-card
    title: Back Garden Soil Moisture Stats
    clear: true
    expanded: false
    cards:
      - type: custom:mini-graph-card
        icon: mdi:water-percent
        name: Back Garden Median Moisture
        entities:
          - sensor.back_garden_median_moisture
        color_thresholds:
          - value: 0
            color: "#F75050"
          - value: 21
            color: "#EEE049"
          - value: 41
            color: "#55E84A"
          - value: 61
            color: "#39BEEA"
        hours_to_show: 168
        show:
          name: false
          icon: false
          state: false
          average: true
          extrema: true
        points_per_hour: 0.25
      - type: horizontal-stack
        cards:
          - type: custom:mini-graph-card
            icon: mdi:water-percent
            name: Sensor 1
            entities:
              - sensor.0xa4c1387409af9c37_soil_moisture
            color_thresholds:
              - value: 0
                color: "#F75050"
              - value: 21
                color: "#EEE049"
              - value: 41
                color: "#55E84A"
              - value: 61
                color: "#39BEEA"
            hours_to_show: 168
            show:
              name: false
              icon: false
              state: true
            points_per_hour: 0.25
          - type: custom:mini-graph-card
            icon: mdi:water-percent
            name: Sensor 2
            entities:
              - sensor.0xa4c138d47993fb2f_soil_moisture
            color_thresholds:
              - value: 0
                color: "#F75050"
              - value: 21
                color: "#EEE049"
              - value: 41
                color: "#55E84A"
              - value: 61
                color: "#39BEEA"
            hours_to_show: 168
            show:
              name: false
              icon: false
              state: true
            points_per_hour: 0.25
          - type: custom:mini-graph-card
            icon: mdi:water-percent
            name: Sensor 3
            entities:
              - sensor.0xa4c138add8f4df84_soil_moisture
            color_thresholds:
              - value: 0
                color: "#F75050"
              - value: 21
                color: "#EEE049"
              - value: 41
                color: "#55E84A"
              - value: 61
                color: "#39BEEA"
            hours_to_show: 168
            show:
              name: false
              icon: false
              state: true
            points_per_hour: 0.25
      - type: horizontal-stack
        cards:
          - type: custom:mini-graph-card
            icon: mdi:water-percent
            name: Sensor 1
            entities:
              - sensor.0xa4c1387409af9c37_temperature
            color_thresholds:
              - value: 0
                color: "#F75050"
              - value: 21
                color: "#EEE049"
              - value: 41
                color: "#55E84A"
              - value: 61
                color: "#39BEEA"
            hours_to_show: 168
            show:
              name: false
              icon: false
              state: true
            points_per_hour: 0.25
          - type: custom:mini-graph-card
            icon: mdi:water-percent
            name: Sensor 2
            entities:
              - sensor.0xa4c138d47993fb2f_temperature
            color_thresholds:
              - value: 0
                color: "#F75050"
              - value: 21
                color: "#EEE049"
              - value: 41
                color: "#55E84A"
              - value: 61
                color: "#39BEEA"
            hours_to_show: 168
            show:
              name: false
              icon: false
              state: true
            points_per_hour: 0.25
          - type: custom:mini-graph-card
            icon: mdi:water-percent
            name: Sensor 3
            entities:
              - sensor.0xa4c138add8f4df84_temperature
            color_thresholds:
              - value: 0
                color: "#F75050"
              - value: 21
                color: "#EEE049"
              - value: 41
                color: "#55E84A"
              - value: 61
                color: "#39BEEA"
            hours_to_show: 168
            show:
              name: false
              icon: false
              state: true
            points_per_hour: 0.25
      - show_name: true
        show_icon: true
        show_state: true
        type: glance
        entities:
          - entity: sensor.0xa4c1387409af9c37_battery
          - entity: sensor.0xa4c138d47993fb2f_battery
          - entity: sensor.0xa4c138add8f4df84_battery
          - entity: sensor.0xa4c13839477a051c_battery
        state_color: true
    gap: 0px
    expanded-gap: 0px
    padding: 0px
    child-padding: 0px
    child-margin-top: 8px

SECTION 2 of 3

type: grid
cards:
  - type: custom:bignumber-card
    title: Back Garden Water Valve Volume Per Cycle
    entity: number.0xa4c13839477a051c_irrigation_target
    min: 0
    max: 422
    from: left
    bnStyle: dodgerblue
    scale: 21px
    hideunit: false
  - type: custom:apexcharts-card
    chart_type: donut
    header:
      show: true
      show_states: true
      floating: true
      colorize_states: true
    experimental:
      color_threshold: true
    apex_config:
      grid:
        padding:
          left: 0
          right: 0
          bottom: -90
          top: 4
      chart:
        height: 265px
      plotOptions:
        pie:
          startAngle: -90
          endAngle: 90
          donut:
            size: 65%
            labels:
              show: true
              total:
                show: true
                label: Target Volume
                formatter: |
                  EVAL:function(w) {
                    return w.globals.seriesTotals.reduce((a, b) => {return (a + b)} , 0).toFixed(0) + " L"
                    }
      legend:
        show: false
        floating: true
        fontSize: 15px
        position: bottom
        offsetX: 0
        offsetY: 0
      dataLabels:
        enabled: false
    series:
      - entity: sensor.rain_volume_7_days
        name: Rain Volume
        color: turquoise
        show:
          legend_value: false
      - entity: sensor.water_volume_required_back_garden
        name: Volume Required
        color: dodgerblue
        show:
          legend_value: false
  - type: custom:expander-card
    gap: 0.0em
    expanded-gap: 0.0em
    padding: 0.0em
    clear: true
    title: Back Garden Rain & Water Stats
    overlay-margin: 0.0em
    child-padding: 0.0em
    child-margin-top: 8px
    button-background: transparent
    expander-card-background: var(--ha-card-background,var(--card-background-color,#fff))
    header-color: var(--primary-text-color,#fff)
    arrow-color: var(--arrow-color,var(--primary-text-color,#fff))
    expander-card-display: block
    title-card-clickable: false
    min-width-expanded: 0
    max-width-expanded: 0
    cards:
      - type: horizontal-stack
        cards:
          - type: custom:rain-gauge-card
            entity: sensor.netatmo_devonport_tas_indoor_rain_rain_today
            hourly_rate_entity: sensor.netatmo_devonport_tas_indoor_rain_rain_last_hour
            show_warning: false
            show_error: false
            fill_drop_colour: turquoise
            name: Rain Today
            card_mod:
              style: |
                ha-card {
                  --ha-card-header-font-size: 18px;
                  --ha-card-header-color: silver;
                  height: 200px !important; 
                }
          - type: custom:mini-graph-card
            entities:
              - entity: sensor.rain_last_7_days
                color: turquoise
            name: Rain Last 7 Days
            group_by: date
            show:
              graph: bar
              extrema: false
            hours_to_show: 168
            points_per_hour: 1
            cache: true
            animate: true
            aggregate_func: last
      - type: custom:apexcharts-card
        graph_span: 30d
        span:
          end: day
        header:
          show: true
          show_states: true
        apex_config:
          fill:
            type: gradient
            gradient:
              type: vertical
              shadeIntensity: 0
              opacityFrom: 1
              opacityTo: 0.5
              stops: 10
          chart:
            height: 150px
          grid:
            show: false
            borderColor: darkslateblue
            strokeDashArray: 2
          dataLabels:
            background:
              borderWidth: 0
              opacity: 0
              foreColor: white
            offsetY: -10
            style:
              fontSize: 9px
          plotOptions:
            bar:
              borderRadius: 0
              dataLabels:
                position: top
        series:
          - entity: sensor.netatmo_devonport_tas_indoor_rain_rain_today
            name: Rain Today
            color: turquoise
            type: column
            group_by:
              func: max
              duration: 1d
              fill: zero
            statistics:
              type: state
              period: day
              align: end
            show:
              name_in_header: true
              datalabels: true
              in_chart: true
              legend_value: false
              extremas: false
          - entity: sensor.netatmo_devonport_tas_indoor_rain_rain_today
            name: Rain Last 30 Days
            color: deepskyblue
            type: column
            group_by:
              func: sum
              duration: 30d
              fill: zero
            statistics:
              type: state
              period: day
              align: end
            show:
              name_in_header: true
              datalabels: false
              in_chart: false
              legend_value: false
      - type: custom:mini-graph-card
        entities:
          - entity: sensor.back_garden_valve_on_off
            color: deepskyblue
        show:
          name: true
          icon: true
          state: false
        name: Irrigation Last 30 Days
        hours_to_show: 1
        points_per_hour: 60
        animate: true
        line_width: 2
        smoothing: false
        state_map:
          - value: "1"
          - value: "0"
gap: 0px
expanded-gap: 0px
padding: 0px
child-padding: 0px
child-margin-top: 8px

SECTION 3 of 3

type: grid
cards:
  - square: false
    type: grid
    cards:
      - type: custom:button-card
        entity: switch.back_garden_set_time_switch_1
        name: Set Time
        color_type: card
        color: auto
        size: 35px
      - type: custom:button-card
        entity: input_boolean.rain_delay_toggle
        name: 24hr Rain Delay
        color_type: card
        color: cornflowerblue
        size: 35px
      - type: custom:button-card
        entity: switch.back_garden_set_time_switch_2
        name: Set Time
        color_type: card
        color: auto
        size: 35px
    columns: 3
  - type: horizontal-stack
    cards:
      - type: custom:time-picker-card
        entity: input_datetime.back_garden_set_time_1
        hour_mode: 12
        hour_step: 1
        minute_step: 1
        layout:
          hour_mode: double
          align_controls: left
          name: inside
          embedded: true
          thin: true
        hide:
          seconds: true
          name: true
          icon: true
        link_values: false
        name: Set Time 1
      - type: custom:time-picker-card
        entity: input_datetime.back_garden_set_time_2
        hour_mode: 12
        hour_step: 1
        minute_step: 5
        layout:
          hour_mode: double
          align_controls: left
          name: inside
          embedded: true
          thin: true
        hide:
          seconds: true
          name: true
          icon: true
        link_values: false
        name: Set Time 1
  - square: false
    type: grid
    cards:
      - type: custom:button-card
        entity: input_boolean.back_garden_1_sun
        name: Sun
        color_type: card
        color: auto
        size: 35px
      - type: custom:button-card
        entity: input_boolean.back_garden_2_mon
        name: Mon
        color_type: card
        color: auto
        size: 35px
      - type: custom:button-card
        entity: input_boolean.back_garden_3_tue
        name: Tue
        color_type: card
        color: auto
        size: 35px
      - type: custom:button-card
        entity: input_boolean.back_garden_4_wed
        name: Wed
        color_type: card
        color: auto
        size: 35px
      - type: custom:button-card
        entity: input_boolean.back_garden_5_thu
        name: Thu
        color_type: card
        color: auto
        size: 35px
      - type: custom:button-card
        entity: input_boolean.back_garden_6_fri
        name: Fri
        color_type: card
        color: auto
        size: 35px
      - type: custom:button-card
        entity: input_boolean.back_garden_7_sat
        name: Sat
        color_type: card
        color: auto
        size: 35px
    columns: 7
  - type: custom:expander-card
    gap: 0.0em
    expanded-gap: 0.0em
    padding: 0.0em
    clear: true
    title: Back Garden Settings, Cycles & Valve Stats
    overlay-margin: 0.0em
    child-padding: 0.0em
    child-margin-top: 8px
    button-background: transparent
    expander-card-background: var(--ha-card-background,var(--card-background-color,#fff))
    header-color: var(--primary-text-color,#fff)
    arrow-color: var(--arrow-color,var(--primary-text-color,#fff))
    expander-card-display: block
    title-card-clickable: false
    min-width-expanded: 0
    max-width-expanded: 0
    cards:
      - type: horizontal-stack
        cards:
          - type: custom:numberbox-card
            border: true
            entity: input_number.back_garden_set_area
            name: false
            icon: false
            min: 1
            card_mod:
              style: >
                .body{display:block!important}
                .body::after{text-align:center;font-size:10px;content:"Set
                Garden Area";display:block!important}
          - type: custom:numberbox-card
            border: true
            entity: input_number.back_garden_set_mm_m2
            name: false
            icon: false
            min: 1
            card_mod:
              style: >
                .body{display:block!important}
                .body::after{text-align:center;font-size:10px;content:"Set
                Weekly Water";display:block!important}
                    - type: horizontal-stack
      - type: horizontal-stack
        cards:
          - type: custom:numberbox-card
            border: true
            entity: input_number.back_garden_water_valve_set_number_cycles
            name: false
            icon: false
            min: 1
            card_mod:
              style: >
                .body{display:block!important}
                .body::after{text-align:center;font-size:10px;content:"Set
                Number of Cycles";display:block!important}
          - type: custom:numberbox-card
            border: true
            entity: number.0xa4c13839477a051c_cycle_irrigation_interval
            name: false
            icon: false
            min: 1
            step: 60
            card_mod:
              style: >
                .body{display:block!important}
                .body::after{text-align:center;font-size:10px;content:"Set Cycle
                Interval Delay";display:block!important}
      - type: horizontal-stack
        cards:
          - type: custom:mushroom-entity-card
            entity: switch.0xa4c13839477a051c_state
            icon: mdi:pipe-valve
            icon_color: blue
      - type: entities
        entities:
          - entity: sensor.back_garden_valve_last_on
            name: Water Last Delivered
            icon: mdi:water-pump
          - entity: sensor.0xa4c13839477a051c_water_consumed
            name: Water Volume Delivered
          - entity: sensor.0xa4c13839477a051c_last_irrigation_duration
            name: Last Duration
      - type: custom:apexcharts-card
        graph_span: 12month
        span:
          end: month
          offset: "-0d"
        header:
          show: true
          show_states: true
        apex_config:
          fill:
            type: gradient
            gradient:
              type: vertical
              shadeIntensity: 0
              opacityFrom: 1
              opacityTo: 0.5
              stops: 10
          chart:
            height: 150px
          grid:
            show: false
            borderColor: darkslateblue
            strokeDashArray: 2
          dataLabels:
            background:
              borderWidth: 0
              opacity: 0
              foreColor: white
            offsetY: -10
          plotOptions:
            bar:
              borderRadius: 0
              dataLabels:
                position: top
        series:
          - entity: sensor.back_garden_water_consumed_30_days
            name: Irrigation This Month
            color: deepskyblue
            type: column
            group_by:
              func: max
              duration: 30day
              fill: zero
            show:
              name_in_header: true
              datalabels: true
              in_chart: true
              legend_value: false
              extremas: false
          - entity: sensor.0xa4c13839477a051c_water_consumed
            name: Irrigation Last 12 Months
            color: deepskyblue
            type: column
            group_by:
              func: sum
              duration: 12month
              fill: zero
            statistics:
              type: state
              period: month
              align: start
            show:
              name_in_header: true
              datalabels: false
              in_chart: false
              legend_value: false
    title-card-button-overlay: false

Thanks for weiting this up and sharing it with the community :slight_smile: i really like the way you presented your dashboard and the festures included - awesome!!

Greetings

2 Likes

Thanks @Flipso I appreciate it. I have read so many posts to set things up in my house, it is now time for me to give back to the community.

V1.1 Update - New Picker for Garden Settings.

  • Target Volume is Divided over two watering session per day
  • Target Volume is further Divided into 7 sessions per week.
  • Times can now be set from the UI with a time picker.

Take note of the Target Volume in the below.
I will update the above code in good time.

1 Time per day Active and 1 Day per week Active.

2 Times per day Active and 1 Day per week Active.

2 Times per day Active and 2 Days per week Active.

2 Times per day Active and 7 Days per week Active.

V1.1 Updated Node Red Flow

Any chance that you could provide the yaml code behind your active screen. Thanks.

1 Like

I have updated everything in the above posts as V1.1 I will continue to update this as it progresses, adding in multiple garden beds and most likely an irrigation home screen which will lead out to the separate garden bed pages.

I have also created a Node Red Flow Write Up that is linked on the Node Red website. Flow can be downloaded from there.

V1.2

V1.2 Update

Hi looks interesting. Did you consider using Smart Irrigation for including Transpiration of water in your automations?

1 Like

I did look at the HA Smart Irrigation Custom Component to bring in the Evapotranspiration (ET) estimation in or;
Figure out a way to bring the ET estimation in straight from BOM Australia.

I also looked at creating the Penman-Monteith Equation myself in a sensor. It is very complex and at the end of the day is is just an estimation which has been shown to be the most accurate in many areas of the world. An estimation used in the absence of soil moisture meters.

I am measuring soil moisture direct. The automation to deliver water does not fire unless the soil is below the set moisture target, in my case 40% Soil Moisture.

We are in the middle of winter in Tasmania at the moment my soil is at a measured Soil Moisture Median of 72%, with winter and spring rainfall ahead.
I live in a climate where mother nature provides sufficient irrigation most of the year round.

I am not expecting my irrigation to activate automatically (soil moisture drop below 40%) until October or November. January and February is where I could expect to use Evaprotranspiration, where we see sustained high temperatures and lack of rain fall. ET would act only to increase the calculated Volume Required slightly.

The main thing I am trying to achieve is not over-watering and maintaining a set soil moisture content. Also when watering (Every 7 Days) delivering a deep penetrating amount of water, equivalent to 24mm of rain per m2 of garden area per week. This also to reduce the water bill.

From sources I have read this should be adjusted to 25mm per week for lawns and only new lawns needing a daily water. I also have yet to experiment with vegetable garden irrigation, I am currently unsure of the volume of water or soil moisture recommended for veggies.



Adding Evapotranspiration

Looking at the documentation for the HA Smart Irrigation Custom Component, Example behavior in a week

I would need to figure out a way to use the either of the below readings as a multiplier against the calculated Target Volume. Then adding this to the Volume Required.

  • Np = Netto Precipitation (=P-Et)
  • B = Bucket during the day

Example behavior in a week

Jeroen ter Heerdt edited this page on Jun 5, 2020 · 1 revision

This page provides insight into how this component should behave in certain weather conditions. With this you should be able to do a sanity check against your configuration and make sure everything is working correctly.

The scenario is as follows - we will look at several days, the precipitation and evapotranspiration for those days, the effects on the various calculations that this component makes and whether or not irrigation should be triggered. Note the values for precipitation and evapotranspiration are made up and are not representative of any real-life situation.

Initialization

Initially, the bucket=0, so the daily adjusted run time (ART)=0 as well.

Variables

  • P: Precipitation
  • Et:Evapotranspiration
  • Np = Netto Precipitation (=P-Et)
  • B = Bucket during the day
  • D = Daily Adjusted Run Time
  • Bu = Bucket after update (=B+Np)
  • Du = Daily Adjusted Run Time after update (seconds)`

Example scenario

Day P Et Np B D Bu Du Irrigation required
1 0.5 0.1 0.4 0 0 0.4 0 No
2 0 0.6 -0.6 0.40 0 -0.2 180 Yes - bucket should be reset afterwards
3 1 0.2 0.8 0 (reset) 0 0.8 0 No
4 0.2 0.4 -0.2 0.8 0 0.6 0 No
5 0 1.5 -1.5 0.6 0 -0.9 600 Yes - bucket should be reset afterwards
6 0 0.4 -0.4 0 (reset) 0 -0.4 300 Yes - bucket should be reset afterwards
7 0.5 0.2 0.3 0 (reset) 0 0.3 0 No

There is also these few interesting posts but again these are based on time not volume.

Thank you for providing all those details! How do you calculate the target Volume? It’ takes the size of your lawn into account? And why do you use volume rather then time? Does the valves have a flow sensor to bring out a defined amount?

In the Smart Irrigation Integration you provide size of lawn and the flow rate of your watering system and it calculates the runtime for you. In the end it’s also volume based since you can calculate the volume by multiplying runtime with your flow rate.

  • I am expecting rain today, I will be able to show some screen shots of what the graphs do when rain is present.

  • When I looked at that integration it was only outputting a runtime. My valve only gives a volume Delivered and there is no flow rate given. If I was to use the runtime, I would be guessing at what the actual flow rate would be through the valve. Or do a calculation based on time vs volume delivered.

  • I have attached below what the valve exposes are in Zigbee2MQTT.

  • Yes the UI buttons set the (Target Volume) by inputting (Garden/Lawn Area) and Multiplying that by the (Target Rain Fall per Square Meter of Garden/Lawn Area)

image

  • Then (Actual Rain Fall Volume) for the set garden/lawn area is then subtracted from the Target Volume. To Give Volume Required.

  • Target Volume Sensor calculation is in the below.

V1.3 Sensors in configuration.yaml - You will need to set these up manually.

# Back Garden Water Valve - 0 or 1 for Mini Graph Card
      back_garden_valve_on_off:
        unique_id: 686b9ef3-26fa-4057-9734-f4cd39f41749
        friendly_name: "Back Garden Water Valve ON OFF"
        value_template: >-
          {%- if is_state('switch.0xa4c13839477a051c_state', 'on') %}
          0
          {%- elif is_state('switch.0xa4c13839477a051c_state', 'off') %}
          1
          {% else %}
          1
          {%- endif -%}

# Template for RAIN VOLUME LAST 7 DAYS - Back Garden - (= Rain 7 Days * Set Garden Area)
      rain_volume_7_days:
        unique_id: 88518e81-3826-4efa-9501-388afc1dfeaa
        friendly_name: Rain Volume Last 7 Days
        unit_of_measurement: L
        value_template: "{{(states('sensor.rain_last_7_days') | float(0)) * (states('input_number.back_garden_set_area') | float(0)) | round(1)}}"

# Template for WEEK TARGET VOLUME - Back Garden - (= Set Rain mm/m2 * Set Garden Area)
      week_target_volume_back_garden:
        unique_id: bff13231-85e3-4e7b-8714-42ba761fedd3
        friendly_name: Back Garden - Week Target Volume
        unit_of_measurement: L
        value_template: "{{(states('input_number.back_garden_set_mm_m2') | float(0)) * (states('input_number.back_garden_set_area') | float(0)) | round(1)}}"

# Template for DAYS PER WEEK - Back Garden - (= Count Number of Days) UI Buttons
      back_garden_days_per_week:
        unique_id: 57fbc2fd-1970-4470-9477-71c4a7d44dc7
        friendly_name: "Back Garden Days Per Week"
        unit_of_measurement: 'days'
        value_template: >
          {{[ states.input_boolean.back_garden_1_sun,
              states.input_boolean.back_garden_2_mon,
              states.input_boolean.back_garden_3_tue,
              states.input_boolean.back_garden_4_wed,
              states.input_boolean.back_garden_5_thu,
              states.input_boolean.back_garden_6_fri,
              states.input_boolean.back_garden_7_sat ]
            | selectattr('state', 'eq', 'on') | list | count}}

# Template for TIMES PER DAY - Back Garden - (= Count Number of Times Per Day) UI Input Buttons
      back_garden_times_per_day:
        unique_id: a72a4376-adba-4d9c-8307-6ece98cff2b0
        friendly_name: "Back Garden Times Per Day"
        value_template: >
          {{[ states.switch.back_garden_set_time_switch_1,
              states.switch.back_garden_set_time_switch_2 ]
            | selectattr('state', 'eq', 'on') | list | count}}

# Template for SETTING CYCLES IN VALVE - Back Garden - (1.0 = 0) Otherwise return value (work around for valve behaviour 1=2) UI Input Buttons
      back_garden_set_valve_cycles_helper:
        unique_id: 0d24edfc-f35f-4d37-80d9-da64c50e6bd9
        friendly_name: "Back Garden Set Valve Cycles Helper"
        value_template: >-
          {%- if is_state('input_number.back_garden_water_valve_set_number_cycles', '1.0') %}
          0
          {% else %}
          {{(states('input_number.back_garden_water_valve_set_number_cycles')) | round(0)}}
          {%- endif %}

# Template for WATER VOLUME REQUIRED - Back Garden - (= (WEEK TARGET VOLUME - RAIN VOLUME 7 DAYS)
      water_volume_required_back_garden:
        unique_id: 6e67a45d-40b7-4150-adfd-3c3404b7795c
        friendly_name: Back Garden - Water Volume Required
        unit_of_measurement: L
        value_template: "{{(states('sensor.week_target_volume_back_garden') | float(0)) | round(0) - (states('sensor.rain_volume_7_days') | float(0)) | round(0)}}"

# Template for VOLUME PER CYCLE - Back Garden - (= ((((VOLUME REQUIRED) / DAYS PER WEEK)) / TIMES PER DAY)) / SET NUMBER CYCLES)
      back_garden_water_volume_per_cycle:
        unique_id: 06073478-c0b1-4512-acea-53a518dc0178
        friendly_name: Back Garden - Water Volume Per Cycle
        unit_of_measurement: L
        value_template: "{{(((((states('sensor.week_target_volume_back_garden') | float(0)) - (states('sensor.rain_volume_7_days') | float(0))) / (states('sensor.back_garden_days_per_week') | float(0))) / (states('sensor.back_garden_times_per_day') | float(0))) / (states('input_number.back_garden_water_valve_set_number_cycles') | float(0))) | round(0)}}"

# Rain Last 7 Days (mm) (Outputs Rain Accumulation Last 7 Days)
  - platform: statistics
    name: "Rain last 7 days"
    unique_id: afe4b9f2-d0a6-4c42-86eb-786737f2ea14
    entity_id: sensor.netatmo_devonport_tas_indoor_rain_rain_today
    state_characteristic: sum_differences_nonnegative
    max_age:
      minutes: 10080
    precision: 1
    keep_last_sample: true

# Back Garden Valve 1 Day (mm) (Outputs Water Consumed Last 1 Day - Used for Apex Charts Card)
  - platform: statistics
    name: "Back Garden Water Consumed Daily"
    unique_id: 42572c8b-e257-430a-98eb-791a525b8212
    entity_id: sensor.0xa4c13839477a051c_water_consumed
    state_characteristic: sum_differences_nonnegative
    max_age:
      minutes: 1440
    precision: 1
    keep_last_sample: true

# Template Time Since Last ON Back Garden (Outputs timestamp of last ON)
template:
  - trigger:
      - platform: state
        entity_id: switch.0xa4c13839477a051c_state
        to: 'on'
    sensor:
      - name: back_garden_valve_last_on
        unique_id: b54c02fb-d1d8-48a5-b263-d797b60fc875
        state: "{{ as_timestamp(states('sensor.date_time_iso')) | timestamp_custom('%H:

image

V1.3 Update

V1.4 Update

7 Days per Week, Once a Day

3 Days per Week, Once a Day

1 Day per Week, Twice a Day