My Garden Irrigation

Managed to get it working had to manually update the state in developer tools as the popup was not working

@klogg
Is there a way to tell what “decisions” are being made or more specifically why the cycles are not running? I think it is the “ignore when raining” option keeping cycles from running even though the sensor is returning true/false correctly. Just curious if there is some backend logging or somewhere I can look to determine exactly what is going on. Any help would be appreciated.

@nicopag - I’m always open to ideas for improvement but my focus is on other things at the moment especially as it is winter here so I won’t be using the system again for several months.

@jgosnell - No there is no logging directly from this package but you should be bale to get some useful info from the Logbook.

An internal log might be a good idea though, I’ll add it to my list but read the above comment for an idea of timescales (hint: don’t hold your breath :wink: )

@everyone else. I have a lot of other things going on outside of HA at the moment so I will be a lot less responsive. Apologies for that, but I will check in here and try to answer questions when I can.

I think I am on the right track here but cannot figure out what could be wrong. I increased logging and watched logs during the iirigation.triggered authomation. I see that there is an error in the automation that is causing the “Ignore schedule when raining” section to be ignored. I can reproduce the error if I use the Template test function under Dev tools. Entering this template value results in a “UndefinedError: ‘trigger’ is undefined” error message.

{% if trigger.entity_id == 'input_boolean.irrigation_cycle3_running' %}
            True
          {% elif states('input_boolean.irrigation_ignore_schedule_if_raining') == 'off' %}
            True
          {% elif states('input_boolean.irrigation_ignore_schedule_if_raining') == 'on' and
                  states(states('input_text.irrigation_external_sensor_raining_now')) == 'off' %}
            True
          {% else %}
            False
          {% endif %}

I tried to remove the entire first line and only validate against the last two but the template always returns “false”. I can manually set the state of the raining-now sensor to “on” but the template still returns false. Do you or anyone have any ideas where I can look or what may be wrong?

Hope this all makes sense…:slight_smile:

yes. it works
thanks

Hi @ekkesa. How Can I fix this?
I am receiving telegram msg with 0 minutes of duration
Thanks in advance
N

I haven’t had a chance to look into this but have you defined the raining now sensor?

any help on this:?

I have and I have confirmed it returns on or off as it should. The template seems to error on the first line where it is evaluating Cycle 3 running or not. The error is “UndefinedError: ‘trigger’ is undefined”.

I had that same error and had to manually set the state of “input_text.irrigation_external_sensor_controller_wifi” to the sensor of my controller.

Wich is the senor of my controller? I dont get that. sorry

When you check the state of “sensor.irrigation_status”, do you see the WiFi signal strength (RSSI Value)?

Also, check your “item_settings_controller_wifi_signal.yaml” and compare to mine below. It appears I had to also manually specify my sensor entity near the top.

# lovelace_gen

#===========================
#=== Controller WiFi Signal
#===========================
type: custom:button-card
entity: sensor.sprinkler_status
name: >
  [[[
    var statestr = (entity === undefined || entity.state === undefined) ? 'undefined' : entity.state;
    var unit_om = (statestr != 'undefined' && entity.attributes.unit_of_measurement) ? entity.attributes.unit_of_measurement : '';
    return '{{ name }}' + ' (' + entity.state + ' ' + unit_om + ')'
  ]]]
icon: "[[[ return (entity === undefined || entity.state == 'unavailable') ? 'mdi:wifi-off' : 'mdi:wifi'; ]]]"
show_state: true
state_display: <elt><ha-icon icon=mdi:square-edit-outline></ha-icon></elt>
size: 30%
styles:
  grid:
    - grid-template-areas: '"i n s"'
    - grid-template-columns: 15% auto 5%
    - grid-template-rows: 1fr
  card:
    - font-family: "[[[ return states['input_text.irrigation_ui_font_family'].state ]]]"
    - font-size: 15px
    - padding: 0em 1.5em 0em 0em
    - background: none
    - box-shadow: none
  name: 
    - justify-self: start
state:
  - value: 'unavailable'
    styles:
      icon:
        - color: var(--accent-color)
        - animation: blink 2s ease infinite
      state:
        - color: var(--accent-color)
        - animation: blink 2s ease infinite
tap_action:
  action: call-service
  service: browser_mod.popup
  service_data:
    title: Irrigation Controller
    hide_header: true
    card:
      type: vertical-stack
      cards:
        - type: markdown
          content: Enter the name of the sensor for your irrigation controller WiFi signal strength.


                  Leave blank to reset to default.
          style: >
            ha-card {
              font-family: {% raw %}{{ states('input_text.irrigation_ui_font_family') }}{% endraw %};
              font-size: 16px;
            }
        - type: entities
          entities:
            - entity: input_text.irrigation_external_sensor_controller_wifi
              name: Sensor Name
            - entity: input_number.irrigation_controller_offline_wait
              name: Seconds To Wait When Offline
            - type: section


          style: >
            ha-card {
              font-family: {% raw %}{{ states('input_text.irrigation_ui_font_family') }}{% endraw %};
            }
        - type: markdown
          content: You can disable the switches to prevent irrigation while testing.
          style: >
            ha-card {
              font-family: {% raw %}{{ states('input_text.irrigation_ui_font_family') }}{% endraw %};
              font-size: 16px;
            }
        - type: entities
          entities:
            - entity: input_boolean.irrigation_disable_switches
          style: >
            ha-card {
              font-family: {% raw %}{{ states('input_text.irrigation_ui_font_family') }}{% endraw %};
            }
    deviceID:
      - this
    style:
      $: |
        .mdc-dialog {
            backdrop-filter: blur(5px);
          }
        .mdc-dialog .mdc-dialog__container .mdc-dialog__surface {
            border-radius: 1em;
            box-shadow: 0em 0em 0.5em;
          }
  

thanks for your answer, but I dont really understand.
I do not have any WiFi Controller for my watering system.
How do I check the state of “sensor.irrigation_status”?

How are you controlling the zones or valves for your watering? Is that device wireless? Some people use Sonoff 4ch, several Sonoff Basics, or some form of an ESP chip which most have wifi built-in.

thanks @jgosnell.
YES, with my sonoff 4ch and this is the wifi signal of it: sensor.watering_4ch_wifi_signal
where do I configure that device?

it works!!! I use your file with my sensor!
thanks

1 Like

You are welcome.

@jgosnell do you how can I fix the duration time that telegram sent?
I use the telegram script from this thread but the msg tells me that the total cycle will be 0 minutes
Did you try it?
Thanks

Unfortunately I cannot help with that. I use push notifications with the HA Android app instead of Telegram.