Problem with “Irrigation Unlimited HACS Integration”. Enabled attribute

Try this:

alias: IU Start Bewässerung
sequence:
  - choose:
      - conditions:
          - condition: and
            conditions:
              - condition: state
                entity_id: binary_sensor.irrigation_unlimited_c1_m
                state: 'off'
              - condition: state
                entity_id: binary_sensor.irrigation_unlimited_c2_m
                state: 'off'
        sequence:
          - choose:
              - conditions:
                  - condition: template
                    value_template: >-
                      {{ state_attr('binary_sensor.irrigation_unlimited_c1_z1',
                      'enabled') == True }} 
                sequence:
                  - service: irrigation_unlimited.manual_run
                    data_template:
                      entity_id: binary_sensor.irrigation_unlimited_c1_z1
                      time: >-
                        {{
                        ((states("input_number.iu_zone_1_run_time")
                        | float * 60.0) | int) | timestamp_custom("%H:%M",
                        False) }}
                  - wait_for_trigger:
                      - platform: state
                        entity_id: binary_sensor.irrigation_unlimited_c1_z1
                        from: 'on'
                        to: 'off'
            default: []
          - choose:
              - conditions:
                  - condition: template
                    value_template: >-
                      {{ state_attr('binary_sensor.irrigation_unlimited_c1_z2',
                      'enabled') == True }} 
                sequence:
                  - service: irrigation_unlimited.manual_run
                    data_template:
                      entity_id: binary_sensor.irrigation_unlimited_c1_z2
                      time: >-
                        {{
                        ((states("input_number.iu_zone_2_run_time")
                        | float * 60.0) | int) | timestamp_custom("%H:%M",
                        False) }}
                  - wait_for_trigger:
                      - platform: state
                        entity_id: binary_sensor.irrigation_unlimited_c1_z2
                        from: 'on'
                        to: 'off'
            default: []
          - choose:
              - conditions:
                  - condition: template
                    value_template: >-
                      {{ state_attr('binary_sensor.irrigation_unlimited_c1_z3',
                      'enabled') == True }} 
                sequence:
                  - service: irrigation_unlimited.manual_run
                    data_template:
                      entity_id: binary_sensor.irrigation_unlimited_c1_z3
                      time: >-
                        {{
                        ((states("input_number.iu_zone_3_run_time")
                        | float * 60.0) | int) | timestamp_custom("%H:%M",
                        False) }}
                  - wait_for_trigger:
                      - platform: state
                        entity_id: binary_sensor.irrigation_unlimited_c1_z3
                        from: 'on'
                        to: 'off'
            default: []
          - choose:
              - conditions:
                  - condition: template
                    value_template: >-
                      {{ state_attr('binary_sensor.irrigation_unlimited_c1_z4',
                      'enabled') == True }} 
                sequence:
                  - service: irrigation_unlimited.manual_run
                    data_template:
                      entity_id: binary_sensor.irrigation_unlimited_c1_z4
                      time: >-
                        {{
                        ((states("input_number.iu_zone_4_run_time")
                        | float * 60.0) | int) | timestamp_custom("%H:%M",
                        False) }}
                  - wait_for_trigger:
                      - platform: state
                        entity_id: binary_sensor.irrigation_unlimited_c1_z4
                        from: 'on'
                        to: 'off'
            default: []
          - choose:
              - conditions:
                  - condition: template
                    value_template: >-
                      {{ state_attr('binary_sensor.irrigation_unlimited_c2_z1',
                      'enabled') == True }} 
                sequence:
                  - service: irrigation_unlimited.manual_run
                    data_template:
                      entity_id: binary_sensor.irrigation_unlimited_c2_z1
                      time: >-
                        {{
                        ((states("input_number.iu_zone_5_run_time")
                        | float * 60.0) | int) | timestamp_custom("%H:%M",
                        False) }}
                  - wait_for_trigger:
                      - platform: state
                        entity_id: binary_sensor.irrigation_unlimited_c2_z1
                        from: 'on'
                        to: 'off'
            default: []
          - choose:
              - conditions:
                  - condition: template
                    value_template: >-
                      {{ state_attr('binary_sensor.irrigation_unlimited_c2_z2',
                      'enabled') == True }} 
                sequence:
                  - service: irrigation_unlimited.manual_run
                    data_template:
                      entity_id: binary_sensor.irrigation_unlimited_c2_z2
                      time: >-
                        {{
                        ((states("input_number.iu_zone_6_run_time")
                        | float * 60.0) | int) | timestamp_custom("%H:%M",
                        False) }}
                  - wait_for_trigger:
                      - platform: state
                        entity_id: binary_sensor.irrigation_unlimited_c2_z2
                        from: 'on'
                        to: 'off'
            default: []
          - choose:
              - conditions:
                  - condition: template
                    value_template: >-
                      {{ state_attr('binary_sensor.irrigation_unlimited_c2_z3',
                      'enabled') == True }} 
                sequence:
                  - service: irrigation_unlimited.manual_run
                    data_template:
                      entity_id: binary_sensor.irrigation_unlimited_c2_z3
                      time: >-
                        {{
                        ((states("input_number.iu_zone_7_run_time")
                        | float * 60.0) | int) | timestamp_custom("%H:%M",
                        False) }}
                  - wait_for_trigger:
                      - platform: state
                        entity_id: binary_sensor.irrigation_unlimited_c2_z3
                        from: 'on'
                        to: 'off'
            default: []
          - choose:
              - conditions:
                  - condition: template
                    value_template: >-
                      {{ state_attr('binary_sensor.irrigation_unlimited_c2_z4',
                      'enabled') == True }} 
                sequence:
                  - service: irrigation_unlimited.manual_run
                    data_template:
                      entity_id: binary_sensor.irrigation_unlimited_c2_z4
                      time: >-
                        {{
                        ((states("input_number.iu_zone_8_run_time")
                        | float * 60.0) | int) | timestamp_custom("%H:%M",
                        False) }}
                  - wait_for_trigger:
                      - platform: state
                        entity_id: binary_sensor.irrigation_unlimited_c2_z4
                        from: 'on'
                        to: 'off'
            default: []
          - choose:
              - conditions:
                  - condition: template
                    value_template: >-
                      {{ state_attr('binary_sensor.irrigation_unlimited_c2_z5',
                      'enabled') == True }} 
                sequence:
                  - service: irrigation_unlimited.manual_run
                    data_template:
                      entity_id: binary_sensor.irrigation_unlimited_c2_z5
                      time: >-
                        {{
                        ((states("input_number.iu_zone_9_run_time")
                        | float * 60.0) | int) | timestamp_custom("%H:%M",
                        False) }}
                  - wait_for_trigger:
                      - platform: state
                        entity_id: binary_sensor.irrigation_unlimited_c2_z5
                        from: 'on'
                        to: 'off'
            default: []
      - conditions:
          - condition: state
            entity_id: binary_sensor.irrigation_unlimited_c1_m
            state: 'on'
        sequence:
          - service: irrigation_unlimited.cancel
            data:
              entity_id: binary_sensor.irrigation_unlimited_c1_m
      - conditions:
          - condition: state
            entity_id: binary_sensor.irrigation_unlimited_c2_m
            state: 'on'
        sequence:
          - service: irrigation_unlimited.cancel
            data:
              entity_id: binary_sensor.irrigation_unlimited_c2_m
    default: []
mode: restart
icon: 'mdi:sprinkler'

Everything works great.
Thanks again.

Thanx all,
Just started messing around with this integration in HA, having a little issue with the example card for the manual operation from the github readme.md . Overall the card it self works, it displays the basic card graphics, just no data is available for selection. Also pyscript seems to be working. I am getting the below errors in the HA log. Any one have any ideas?
Thanx
mikew

2021-06-13 22:04:08 ERROR (MainThread) [custom_components.pyscript.function] run_coro: got exception Traceback (most recent call last):
File "/config/custom_components/pyscript/eval.py", line 689, in call
raise TypeError(
TypeError: irrigation_unlimited_call_cancel() missing 1 required positional arguments
2021-06-13 22:07:09 ERROR (MainThread) [custom_components.pyscript.file.irrigation_unlimited_service_shim.irrigation_unlimited_call_manual_run] Exception in <file.irrigation_unlimited_service_shim.irrigation_unlimited_call_manual_run> line 108:
time = state.get(time_entity)
^
NameError: name 'input_datetime.irrigation_unlimited_time' is not defined
2021-06-13 22:07:52 ERROR (MainThread) [custom_components.pyscript.file.irrigation_unlimited_service_shim.irrigation_unlimited_list_config] Exception in <file.irrigation_unlimited_service_shim.irrigation_unlimited_list_config> line 39:
data = json.loads(irrigation_unlimited.coordinator.configuration)
^
AttributeError: 'StateVal' object has no attribute 'configuration'
2021-06-13 22:07:57 ERROR (MainThread) [custom_components.pyscript.file.irrigation_unlimited_service_shim.irrigation_unlimited_list_config] Exception in <file.irrigation_unlimited_service_shim.irrigation_unlimited_list_config> line 39:
data = json.loads(irrigation_unlimited.coordinator.configuration)
^
AttributeError: 'StateVal' object has no attribute 'configuration'
2021-06-13 22:20:08 ERROR (MainThread) [custom_components.pyscript.file.irrigation_unlimited_service_shim.irrigation_unlimited_list_config] Exception in <file.irrigation_unlimited_service_shim.irrigation_unlimited_list_config> line 39:
data = json.loads(irrigation_unlimited.coordinator.configuration)
^
AttributeError: 'StateVal' object has no attribute 'configuration'
2021-06-13 22:20:08 ERROR (MainThread) [custom_components.pyscript.file.irrigation_unlimited_service_shim.irrigation_unlimited_list_config] Exception in <file.irrigation_unlimited_service_shim.irrigation_unlimited_list_config> line 39:
data = json.loads(irrigation_unlimited.coordinator.configuration)
^
AttributeError: 'StateVal' object has no attribute 'configuration'

Please make sure you are using at least version 2021.6.3 of Irrigation Unlimited. Also there is a package irrigation_unlimited_controls.yaml that needs to go into your config/packages directory and the following in configuration.yaml if you don’t already have it.

homeassistant:
  packages: !include_dir_named packages

thanx that did it!
all good

mikew

Hello! Can anyone help me? I’m trying to make a manual irrigation, but when I click on the lovelace button the Zóna1 turns on for 1 sec, and turns off. Then after 1 sec. the Zóna2 turns on, and after 1sec turns off. and so it continues with Zóna3 and Zóna4. Please help me I’ve been looking for the bug for 3 days.

This is my configuration.yaml:

irrigation_unlimited:
  granularity: 1
  refresh_interval: 1
  controllers:
    name: Öntözésvezérlő
    preamble: '00:00'
    postamble: '00:00'
    zones:
      - name: 'Zóna1'
        entity_id: 'switch.ontoz1'
      - name: 'Zóna2'
        entity_id: 'switch.ontoz12'
      - name: 'Zóna3'
        entity_id: 'switch.ontoz13'
      - name: 'Zóna4'
        entity_id: 'switch.ontoz14'
    sequences:
      - name: 'Öntözés'
        delay: '00:00'
        repeat: 1
        schedules:
          - name: 'Ontozes'
            time: '21:46'
        zones:
          - zone_id: [1]
            duration: "00:10"
          - zone_id: [2]
            duration: "00:10"
          - zone_id: [3]
            duration: "00:10"
          - zone_id: [4]
            duration: "00:10"

This is my script:

kezi_ontozes:
  alias: Kézi öntözés
  sequence:
  - choose:
    - conditions:
      - condition: state
        entity_id: binary_sensor.irrigation_unlimited_c1_m
        state: 'off'
      sequence:
      - choose:
        - conditions:
          - condition: template
            value_template: '{{ state_attr(''binary_sensor.irrigation_unlimited_c1_z1'',
              ''enabled'') == True }} '
          sequence:
          - service: irrigation_unlimited.manual_run
            data_template:
              entity_id: binary_sensor.irrigation_unlimited_c1_z1
              time: '{{ ((states("input_number.Zóna1_run_time")
                | float * 1.0) | int) | timestamp_custom("%H:%M", False) }}'
          - wait_for_trigger:
            - platform: state
              entity_id: binary_sensor.irrigation_unlimited_c1_z1
              from: 'on'
              to: 'off'
        default: []
      - choose:
        - conditions:
          - condition: template
            value_template: '{{ state_attr(''binary_sensor.irrigation_unlimited_c1_z2'',
              ''enabled'') == True }} '
          sequence:
          - service: irrigation_unlimited.manual_run
            data_template:
              entity_id: binary_sensor.irrigation_unlimited_c1_z2
              time: '{{ ((states("input_number.ontoz12_run_time")
                | float * 1.0) | int) | timestamp_custom("%H:%M", False) }}'
          - wait_for_trigger:
            - platform: state
              entity_id: binary_sensor.irrigation_unlimited_c1_z2
              from: 'on'
              to: 'off'
        default: []
      - choose:
        - conditions:
          - condition: template
            value_template: '{{ state_attr(''binary_sensor.irrigation_unlimited_c1_z3'',
              ''enabled'') == True }} '
          sequence:
          - service: irrigation_unlimited.manual_run
            data_template:
              entity_id: binary_sensor.irrigation_unlimited_c1_z3
              time: >-
                {{ ((states("input_number.Zóna3_run_time") 
                | float * 60.0) | int) | timestamp_custom("%H:%M", False) }}
          - wait_for_trigger:
            - platform: state
              entity_id: binary_sensor.irrigation_unlimited_c1_z3
              from: 'on'
              to: 'off'
        default: []
      - choose:
        - conditions:
          - condition: template
            value_template: '{{ state_attr(''binary_sensor.irrigation_unlimited_c1_z4'',
              ''enabled'') == True }} '
          sequence:
          - service: irrigation_unlimited.manual_run
            data_template:
              entity_id: binary_sensor.irrigation_unlimited_c1_z4
              time: >-
                {{ ((states("input_number.ontoz14_run_time") 
                | float * 60.0) | int) | timestamp_custom("%H:%M", False) }}
          - wait_for_trigger:
            - platform: state
              entity_id: binary_sensor.irrigation_unlimited_c1_z4
              from: 'on'
              to: 'off'
        default: []
    - conditions:
      - condition: state
        entity_id: binary_sensor.irrigation_unlimited_c1_m
        state: 'on'
      sequence:
      - service: irrigation_unlimited.cancel
        data:
          entity_id: binary_sensor.irrigation_unlimited_c1_m
    default: []
  mode: restart
  icon: mdi:sprinkler

And this is lovelace:

type: button
tap_action:
  action: toggle
name: Kézi öntözés
show_state: true
entity: script.kezi_ontozes

Thanks for your help!

I recommend you to use the code suggested in the addon in the part manual-run-card:

I’m also having issues with manual irrigation.
Script works and scrapes the controller/line/sequence as you can see on the screenshot below:

image

But it behaves weirdly. If I select only one line from Controller/Zone dropdown and leave “none” for the Controller/Sequence dropdown it doesn’t start. If I just select Controller/Sequence it does work, but sometimes it lags a lot (clicking cancel stops after 10 sec or so etc.).
Nothing in the Hass log, no errors.

Any ideas where to start debugging this? My config is exactly the same as in your instructions.

The lag you experience may be due to parameters granularity and refresh_interval. You can read their use here: GitHub - rgc99/irrigation_unlimited: ♒Irrigation controller for Home Assistant

I recommend you to write if you have issues in the author’s addon page: Issues · rgc99/irrigation_unlimited · GitHub

Hi everyone,

can anyone tell me what the Irrigation Unlimited Coordinator is?
Unfortunately I didn’t find anything in the description.
Thank you.


Oh, by the way, very good integration.

Here is a screenshot of my irrigation, if you are interested

The coordinator is a component entity and serves the integration. The reload service call for example is directed here. Along with its associated class it sits on top of the tree driving the controllers and zones. Mostly handles the config loading, clock, service calls and testing. It is also used to export some of the configuration data and acts as a bridge to the manual run card. The format is json and is easily consumed by other languages providing a possible link to other front end cards.

It is not intended to control anything like a valve but more of a gateway to HA and other integrations. I will leave it open for suggestions on what other information to output that might be useful.

Nice screen. Love those graphs, what component are you using?

Ahh ok
I thank you.

I use custom: apexcharts-card.

Can you please create a new topic under Share your project with Irrigation Unlimited.
So that people can present their projects, suggestions or changes?
That would be great.

Thank you again

Good idea. All done Irrigation Unlimited Integration

You are correct…the lag is due to refresh interval and granularity. In the end everything works, just takes some time to start/stop, which is not all that important :slight_smile:
Thanks!

Hi miguelpucela,

get the following error message
can you maybe help me?

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/connection.py:146
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 06:59:45 (3 occurrences)
Last logged: 07:00:03

[547135015280] Error handling message: template value should be a string for dictionary value @ data[‘value_template’]. Got None (invalid_format)


I don’t see any problems … Try to watch binary_sensor.irrigation_unlimited_c1_z1 in Developer Tools → States to make sure there is an enabled attribute and which value it has.

You could also try the template in Developer Tools → Template.

In my configuration it works ok …

The configuration works, I just noticed that the error message comes when testing in the script.
Unfortunately, I didn’t make a backup of the configuration, so I have to set up the entire irrigation system again.

Backups are a MUST in HA, if you don’t want to throw your work away.

I recommend you to use the Home Assistant Google Drive Backup addon

I know,
I also do it regularly, but something went wrong with the watering.
Anyway I’m almost done.

I have another question
Was it always like that when you start the irrigation manually that the next zone is not displayed?
I started the irrigation using the script that I stated in the post above.

In my case, if I don’t have automatic sequences programmed, Next zone gives the correct information, but if I have automatic schedules, it gives the next automatic irrigation programmed.

Maybe you can ask Robert Cook through Irrigation Unlimited issues page at github https://github.com/rgc99/irrigation_unlimited/issues, as it seems related to the inners of the package.