Smart Irrigation - save water by precisely watering your lawn/garden

@jeroenterheerdt - I just wanted to say thanks for this integration and your helpful videos.

I have a watering system where I use a simple (but semi-smart) approach to watering based on a few key parameters e.g. has it rained, will it rain today, todays temperature.

Now I have found your work and I will slowly switch over and use your integration but I have a couple of questions.

  1. I use the Australian Government Weather data (BOM) in HA and I don’t use open weather maps. Would it be possible to expose the weather attributes that the integration needs so they can be configured manually?

  2. I would like to be able to update buckets and calculated duration rather than just reset them to 0. Is this possible?

Thanks again and Happy New Year

I think I have this all working how I wanted but have a question in relation to how precipitation (rain) from my weather station is being used in the bucket calculation.

Yesterday night there was 25mm of rain then another 60mm already today. So I manually updated and calculated and expected the bucket to be >0 and no need to water but the system thinks my garden still needs water (not much water but still unexpected).

I’d like to understand how the rain/precipitation data is being used and if I have something wrong in my configuration.

please open an issue on GitHub and provide the diag file as instructed. Without it I cannot help.

  1. Of course, you can just use those sensors as if they were your weather station.
  2. Of course, we have the set_bucket service for it.

to get to the bottom of this, please open an issue and create a diag file.

Everything all working. Thanks. Worked out how to set bucket and all is working but I think I have found a bug (or maybe this is by design). Let me know if you agree its an issue or not. Here is what I found.

Two zones can not share the same module and sensor group as the weather data is applied to the first zone and then deleted so it is not applied to the second zone.

I fixed this issue by creating a second (duplicate) sensor group and applied one sensor group to one zone.

Bug or by design?

Two zones can not share the same module and sensor group as the weather data is applied to the first zone and then deleted so it is not applied to the second zone.

that is a bug. Weather data should not get deleted if there are other zones depending on it. please open an issue on GH.

OK. Will do.

Great work on this integration by the way. All working very well for my setup now that I worked out what was going wrong with weather data and my second zone.

First I must thank jeroenterheerdt for his work on this. I am new to smart irrigation however I feel this might just be what my clubs RC field needs. Right now we are using a simple timer and wasting a ton of water. I was hoping to find someone with a working setup of say 4 zones to go off of but have been unsuccessful. I have been trying to work through it on my own. I do however have some questions…

  1. If I turn off “Automatic duration calculation” and " Automatic weather data pruning" does this mean that the bucket will continue to fill over multiple days? I would like to water every other day. I would then need to send a call to calculate the zone and then empty the bucket and the time of watering correct?

  2. I assume there is no way to display the bucket value until calculated? Doing so loses all the weather data so the duration becomes reset each time as well? Would love to be able to display real time bucket values on the front end dashboard but see no way to do so.

  3. Is there a way to adjust the multiplier of each zone from an automation?

I am sure I will have many more questions as I try to navigate my way. Thank you for your help in advance.

hey, thanks for checking in and giving this a try! I really appreciate it. I’ll try to answer your questions below.

  1. well, yes and no. If you don’t do automatic calculation / pruning your bucket is not updated and weather data is not deleted. so it will be there for your to manually calculate whenever you’re ready. It will then calculate the bucket and the zone’s duration taken into account all weahterdata collected up to that point. However, you can also just keep automatic calculation / pruning on and then the bucket will be updated daily. Keep in mind that you are responsible for resetting the bucket so if you don’t irrigate / reset the bucket daily, the automatic calculation will just happily keep “expanding” your bucket until the maximum bucket size configured.

  2. if your bucket is zero you need to calculate to get a bucket value. If you don’t reset / calculate it that bucket value will stay the same. The bucket is an attribute of your zone, so you can use {{state_attr('sensor.smart_irrigation_your_zone_sensor_name', 'bucket')}}
    to add this as a template sensor or just find it manually as an attribute on your zone.

  3. no, there is no such thing right now. It’s interesting though, how often would you want to do that?

  4. For an example of an automation with multiple zones, please see here.

Do I need to calculate only when I start the irrigation cycle or can I have it run the calculate all service every hour to update the durations and the buckets to upade the UI only? Then run my irrigation cycles and run the reset zone service after it completes? I assume it just keeps adding to the bucket each calculation until I reset it correct or will that mess with the proper calculations?

On the multiplier. I was planning to add a slider that would allow slight adjustment for more / less water on the interface itself making it easy to slightly modify duration. I can do it outside of the integration using a calculation there and using the new calculation as the duration.

Yes, you can calculate every hour and it with update the bucket and duration, but it the original design is to do the calculation just once per day. It will only ever reset the bucket if you tell it to.

Regarding that multiplier, that’s an interesting idea. I will add a feature request on Github to add a service to update the multiplier for all zones and a specific zone.

1 Like

This dashboard is awesome. Can you show your automation and dashboard config please?

Welcome @MikeDel - are you still looking for help with your smart irrigation dashboard? I’m happy to share but there are quite a few bits to bring it all together.

Do you have an existing watering system (e.g. linktap) setup and working in HA?

Happy to share all the config and explain how if all comes together - so just let me know.

Dashboard looks like this now as I have continued to tweak it.

image

1 Like

Letting you know :slight_smile:

OK. Let me write it up and post the yaml, config and setup instructions.

Some of what I have in my setup is not needed for smart irrigation. Previously I had my own ‘dumber’ smart irrigation system that was based on temp/rain and schedules and I didn’t want to lose that work so I added ‘real’ smart integration as an option/switch.

I will post full working yaml but you can remove the ‘dumber stuff’ if you like.

3 Likes

absolutely! would be great if you can show what i have to do.
Yes, i have an existing system. Smart irrigation is running.

1 Like

Instructions for my smart irrigation setup. Sorry but there is a lot to make it all work!

Post 1 - hardware and components/integrations

This post is all the bits you need to install.

I will do another post on dashboard yaml and then one with all of the automations/scripts you need to make it all work

Hardware:

  • Watering valves for HA: I use Linktap and they are really good
  • Weather station: I have a Weatherflow Tempest. Also great but not needed if you use open weather

Core HA:

  • Weatherflow: core component for the tempest weather station

HACS must haves:

  • HAsmartirrigation: this great project!
  • Mushroom: great set of customisable cards for entitities, templates, weather etc
  • apex-charts card: powerful graphing card
  • template-entity-row: Enables you to do advanced stuff to the stock entities card rows
  • card-mod: to add formatting/placement of elements within cards
  • stack in card: allows you to display cards within a card (for these)
    image

HACS other - specific for my setup

  • Weatherflow Forecast: additional functionality for tempest weather station
  • HTTP API for Linktap: integration for the linktap valves/system
  • BOM weather: Australian weather forecast API
  • Scheduler card and Integration: Only needed for my ‘dumber’ smart integration stuff

Next post is dashboard yaml

2 Likes

Post 2 - dashboard yaml and workflow

I have not commented or changed anything - so this is the precise yaml for my dashoad/view. Happy to help with questions while you get it working. Then I will post on automations etc.

type: vertical-stack
cards:
  - type: custom:mushroom-chips-card
    chips:
      - type: weather
        entity: weather.bom
        show_temperature: false
        show_conditions: true
      - type: template
        entity: sensor.bom_temp_max_0
        icon: mdi:thermometer
        content: >-
          {{ states (entity) | round(0, default=0) }} {{ state_attr (entity,
          'unit_of_measurement') }}
        tap_action:
          action: more-info
      - type: template
        entity: sensor.undercliffe_sensors_precipitation_today
        icon: mdi:weather-rainy
        content: >-
          t: {{ states (entity) | round(0, default=0) }} {{ state_attr (entity,
          'unit_of_measurement') }}
           | y: {{ states ('sensor.undercliffe_sensors_precipitation_yesterday') | round(0, default=0) }} {{ state_attr (entity, 'unit_of_measurement') }}
        tap_action:
          action: more-info
    alignment: center
  - type: custom:mushroom-entity-card
    entity: input_boolean.watering_smart
    name: Smart Watering
    icon: mdi:toggle-switch
    layout: horizontal
    tap_action:
      action: toggle
  - type: custom:mushroom-template-card
    primary: Watering Setup
    secondary: >
      Profile: {{ states ('input_select.watering_schedule') }}

      Ran: {{ as_timestamp (state_attr ('script.set_watering_schedule',
      'last_triggered'), default=0) | timestamp_custom ('%a %d/%m, %I:%M %p',
      default=0)}} ({{ (( as_timestamp ( now() ) - as_timestamp (
      state_attr('script.set_watering_schedule', 'last_triggered'), default=0) )
      / 3600 ) | round()}} hrs)
    icon: mdi:sprinkler-variant
    tap_action:
      action: call-service
      service: script.set_watering_schedule
      target: {}
    hold_action:
      action: none
    multiline_secondary: true
    fill_container: false
    double_tap_action:
      action: none
    entity: script.set_watering_schedule
    icon_color: >-
      {% if state_attr ('script.set_watering_schedule', 'last_triggered') +
      timedelta (hours = 24) < now() %} red {% else %} green {% endif %}
  - type: horizontal-stack
    cards:
      - type: custom:stack-in-card
        cards:
          - type: custom:mushroom-entity-card
            entity: switch.linktap_tap_front
            name: Front
            fill_container: true
          - type: custom:mushroom-chips-card
            chips:
              - type: template
                entity: sensor.linktap_tap_front_battery
                icon: mdi:battery-charging
                icon_color: >-
                  {% if states ('sensor.linktap_tap_front_battery') | int(0) <
                  30 %} red 

                  {% elif states ('sensor.linktap_tap_front_battery') | int(0) <
                  50 %} orange 

                  {% else %} green 

                  {% endif %}
                content: '{{ states (''sensor.linktap_tap_front_battery'') }}%'
                tap_action:
                  action: more-info
                card_mod:
                  style: |
                    ha-card {
                      border: none;
                      box-shadow: none;
                    }        
              - type: template
                entity: sensor.linktap_tap_front_signal
                icon: mdi:wifi
                icon_color: >-
                  {% if states ('sensor.linktap_tap_front_signal') | int < 30 %}
                  red 

                  {% elif states ('sensor.linktap_tap_front_signal') | int < 50
                  %} orange 

                  {% else %} green 

                  {% endif %}
                content: '{{ states (''sensor.linktap_tap_front_signal'') }}%'
                tap_action:
                  action: more-info
                card_mod:
                  style: |
                    ha-card {
                      border: none;
                      box-shadow: none;
                    }
            alignment: justify
            card_mod:
              style: |
                ha-card {
                  position: absolute;
                  top: 5px;
                  right: 15px;
                  width: 60px;
                  --chip-spacing: -12px;
                  --chip-background: none;
                }
      - type: custom:stack-in-card
        cards:
          - type: custom:mushroom-entity-card
            entity: switch.linktap_tap_back
            name: Back
            fill_container: true
          - type: custom:mushroom-chips-card
            chips:
              - type: template
                entity: sensor.linktap_tap_back_battery
                icon: mdi:battery-charging
                icon_color: >-
                  {% if states ('sensor.linktap_tap_back_battery') | int(0) < 30
                  %} red 

                  {% elif states ('sensor.linktap_tap_back_battery') | int(0) <
                  50 %} orange 

                  {% else %} green 

                  {% endif %}
                content: '{{ states (''sensor.linktap_tap_back_battery'') }}%'
                tap_action:
                  action: more-info
                card_mod:
                  style: |
                    ha-card {
                      border: none;
                      box-shadow: none;
                    }        
              - type: template
                entity: sensor.linktap_tap_back_signal
                icon: mdi:wifi
                icon_color: >-
                  {% if states ('sensor.linktap_tap_back_signal') | int < 30 %}
                  red 

                  {% elif states ('sensor.linktap_tap_back_signal') | int < 50
                  %} orange 

                  {% else %} green 

                  {% endif %}
                content: '{{ states (''sensor.linktap_tap_back_signal'') }}%'
                tap_action:
                  action: more-info
                card_mod:
                  style: |
                    ha-card {
                      border: none;
                      box-shadow: none;
                    }
            alignment: justify
            card_mod:
              style: |
                ha-card {
                  position: absolute;
                  top: 5px;
                  right: 15px;
                  width: 60px;
                  --chip-spacing: -12px;
                  --chip-background: none;
                }
  - type: horizontal-stack
    cards:
      - type: entities
        entities:
          - entity: switch.linktap_tap_front
            name: Front
          - entity: number.linktap_tap_front_watering_duration
            name: Mins
          - entity: sensor.linktap_tap_front_remain_duration
            name: To Stop
            icon: mdi:timer
          - type: divider
          - entity: sensor.tap_front_daily_watering
            name: Given
          - type: custom:template-entity-row
            icon: mdi:bucket-outline
            name: Bucket
            state: >-
              {{ state_attr('sensor.smart_irrigation_front', 'bucket') |
              round(0, default=0) }} mm    
          - type: custom:template-entity-row
            icon: mdi:clock
            name: On for
            state: >-
              {{ (states('sensor.tap_front_daily_time') | float(0) * 3600) |
              round(0, default=0) | timestamp_custom('%M:%S', default=0) }}
          - type: custom:template-entity-row
            icon: mdi:watering-can
            name: Needed
            state: >-
              {{ (states('sensor.smart_irrigation_front') | float(0) ) |
              round(0, default=0) | timestamp_custom('%M:%S', default=0) }}
          - type: conditional
            conditions:
              - entity: binary_sensor.linktap_tap_front_is_linked
                state_not: 'on'
            row:
              entity: binary_sensor.linktap_tap_front_is_linked
              name: Linked
          - type: conditional
            conditions:
              - entity: binary_sensor.linktap_tap_front_is_broken
                state_not: 'off'
            row:
              entity: binary_sensor.linktap_tap_front_is_broken
              name: Broken
          - type: conditional
            conditions:
              - entity: binary_sensor.linktap_tap_front_is_clogged
                state_not: 'off'
            row:
              entity: binary_sensor.linktap_tap_front_is_clogged
              name: Clogged
          - type: conditional
            conditions:
              - entity: binary_sensor.linktap_tap_front_is_cutoff
                state_not: 'off'
            row:
              entity: binary_sensor.linktap_tap_front_is_cutoff
              name: Cutoff
          - type: conditional
            conditions:
              - entity: binary_sensor.linktap_tap_front_is_fall
                state_not: 'off'
            row:
              entity: binary_sensor.linktap_tap_front_is_fall
              name: Fallen
          - type: conditional
            conditions:
              - entity: binary_sensor.linktap_tap_front_is_leaking
                state_not: 'off'
            row:
              entity: binary_sensor.linktap_tap_front_is_leaking
              name: Leaking
        show_header_toggle: false
        state_color: true
      - type: entities
        entities:
          - entity: switch.linktap_tap_back
            name: Back
          - entity: number.linktap_tap_back_watering_duration
            name: Mins
          - entity: sensor.linktap_tap_back_remain_duration
            name: To Stop
            icon: mdi:timer
          - type: divider
          - entity: sensor.tap_back_daily_watering
            name: Given
          - type: custom:template-entity-row
            icon: mdi:bucket-outline
            name: Bucket
            state: >-
              {{ state_attr('sensor.smart_irrigation_back', 'bucket') | round(0,
              default=0) }} mm     
          - type: custom:template-entity-row
            icon: mdi:clock
            name: On for
            state: >-
              {{ (states('sensor.tap_back_daily_time') | float(0) * 3600) |
              round(0, default=0) | timestamp_custom('%M:%S', default=0) }}    
          - type: custom:template-entity-row
            icon: mdi:watering-can
            name: Needed
            state: >-
              {{ (states('sensor.smart_irrigation_back') | float(0) ) | round(0,
              default=0) | timestamp_custom('%M:%S', default=0) }}
          - type: conditional
            conditions:
              - entity: binary_sensor.linktap_tap_back_is_linked
                state_not: 'on'
            row:
              entity: binary_sensor.linktap_tap_back_is_linked
              name: Linked
          - type: conditional
            conditions:
              - entity: binary_sensor.linktap_tap_back_is_broken
                state_not: 'off'
            row:
              entity: binary_sensor.linktap_tap_back_is_broken
              name: Broken
          - type: conditional
            conditions:
              - entity: binary_sensor.linktap_tap_back_is_clogged
                state_not: 'off'
            row:
              entity: binary_sensor.linktap_tap_back_is_clogged
              name: Clogged
          - type: conditional
            conditions:
              - entity: binary_sensor.linktap_tap_back_is_cutoff
                state_not: 'off'
            row:
              entity: binary_sensor.linktap_tap_back_is_cutoff
              name: Cutoff
          - type: conditional
            conditions:
              - entity: binary_sensor.linktap_tap_back_is_fall
                state_not: 'off'
            row:
              entity: binary_sensor.linktap_tap_back_is_fall
              name: Fallen
          - type: conditional
            conditions:
              - entity: binary_sensor.linktap_tap_back_is_leaking
                state_not: 'off'
            row:
              entity: binary_sensor.linktap_tap_back_is_leaking
              name: Leaking
        show_header_toggle: false
        state_color: true
  - type: custom:apexcharts-card
    apex_config:
      xaxis:
        labels:
          format: ddd dd/MM
          trim: false
          offsetY: -5
          style:
            fontWeight: 400
            fontSize: 10
      legend:
        show: true
        labels:
          style:
            fontWeight: 400
            fontSize: 10
    all_series_config:
      stroke_width: 1
      opacity: 0.1
      show:
        offset_in_name: false
        legend_value: false
        extremas: false
        name_in_header: false
        datalabels: false
    graph_span: 40d
    span:
      end: day
    header:
      show: true
      title: Watering History
      show_states: false
      colorize_states: true
    yaxis:
      - id: volume
        min: 0
        max: ~300
        decimals: 0
        apex_config:
          tickAmount: 6
          title:
            rotate: -90
            text: Water (l)
            style:
              fontWeight: 400
              fontSize: 9
        show: true
        opposite: false
      - id: rain
        min: 0
        max: ~120
        decimals: 0
        apex_config:
          tickAmount: 6
          title:
            rotate: 90
            text: Rain (mm)
            style:
              fontWeight: 400
              fontSize: 9
        show: true
        opposite: true
      - id: temp
        min: 10
        max: 40
        decimals: 0
        apex_config:
          tickAmount: 6
          title:
            rotate: 90
            text: Temp (C)
            style:
              fontWeight: 400
              fontSize: 9
        show: false
        opposite: false
    series:
      - entity: sensor.tap_front_daily_volume
        name: Front
        color: blue
        yaxis_id: volume
        type: area
        curve: smooth
        statistics:
          type: state
          period: day
          align: start
      - entity: sensor.tap_back_daily_volume
        name: Back
        color: green
        yaxis_id: volume
        type: area
        curve: smooth
        statistics:
          type: state
          period: day
          align: start
      - entity: sensor.undercliffe_sensors_precipitation_today
        name: Rain
        color: grey
        opacity: 0.4
        yaxis_id: rain
        type: column
        statistics:
          type: max
          period: day
          align: start
  - type: custom:scheduler-card
    include:
      - switch.linktap_tap_back
      - switch.linktap_tap_front
    exclude: []
    title: Scheduler
    time_step: 5

Here is a summary of all the dashboard cards

And an overview of my workflow and the automations/scripts etc.

2 Likes

Awesome! Thanks a lot for your work!!