irrigation_unlimited icon indicating copy to clipboard operation
irrigation_unlimited copied to clipboard

Sequence not working(?)

Open AlessandroTischer opened this issue 2 years ago • 1 comments

Version of the custom_component

2022.08

Configuration

irrigation_unlimited:
  controllers:
    - name: "Giardino"
      zones:
        - name: "Sud"
          entity_id: "switch.sprinkler_1"
        - name: "Ovest"
          entity_id: "switch.sprinkler_2"
        - name: "Nord"
          entity_id: "switch.sprinkler_3"
        - name: "Est"
          entity_id: "switch.sprinkler_4"
        - name: "Magnolia"
          entity_id: "switch.sprinkler_5"
        - name: "Aceri"
          entity_id: "switch.sprinkler_6"
      sequences:
          schedules:
            - time: "21:35"
#            - time:
#                sun: "sunset"
#                after: "00:39"
              anchor: start
          zones:
            - zone_id: 2
            - zone_id: 3
            - zone_id: 4
            - zone_id: 5
            - zone_id: 6
    - name: "Aiuole"
      zones:
        - name: "Aiuole"
          entity_id: "switch.sprinkler_7"
      sequences:
        - name: "Aiuole"
          schedules:
          - name: "Prima dell'alba"
            time:
              sun: 'sunrise'
              before: '00:20'
            duration: '00:07'
          - name: "Dopo il tramonto"
            time:
              sun: 'sunset'
              after: '00:30'
            duration: '00:07'
          zones:
            - zone_id: 1

Describe the bug

I'm sure I got something wrong somewhere. It's my first time trying implementing irrigation unlimited.

I'm using SmartIrrigation to get irrigation timings for the controller named "Giardino". The controller "Aiuole" works fine. The controller "Giardino" has a sequence which should run the sprinklers in order from 1 to 6. For some reason it works correctly only for the first in the sequence (this is why in my config you can see only 2 to 6: it's a test. Before it was 1 to 6). After the first one, the run times from SmartIrrigation are not used, nor the sprinklers switched on.

These are my automations:


alias: Smart Irrigation Adjustment
description: Adjust watering times based on smart irrigation calculations
trigger:
  - platform: time_pattern
    minutes: /58
condition: []
action:
  - service: irrigation_unlimited.adjust_time
    data:
      actual: >-
        {{
        timedelta(seconds=states('sensor.smart_irrigation_sud_hourly_adjusted_run_time')
        | int(0))}}
      entity_id: binary_sensor.irrigation_unlimited_c1_z1
    enabled: true
  - service: irrigation_unlimited.adjust_time
    data:
      actual: >-
        {{
        timedelta(seconds=states('sensor.smart_irrigation_ovest_hourly_adjusted_run_time')
        | int(0))}}
      entity_id: binary_sensor.irrigation_unlimited_c1_z2
    enabled: true
  - service: irrigation_unlimited.adjust_time
    data:
      actual: >-
        {{
        timedelta(seconds=states('sensor.smart_irrigation_nord_hourly_adjusted_run_time')
        | int(0))}}
      entity_id: binary_sensor.irrigation_unlimited_c1_z3
    enabled: true
  - service: irrigation_unlimited.adjust_time
    data:
      actual: >-
        {{
        timedelta(seconds=states('sensor.smart_irrigation_est_hourly_adjusted_run_time')
        | int(0))}}
      entity_id: binary_sensor.irrigation_unlimited_c1_z4
    enabled: true
  - service: irrigation_unlimited.adjust_time
    data:
      actual: >-
        {{
        timedelta(seconds=states('sensor.smart_irrigation_magnolia_hourly_adjusted_run_time')
        | int(0))}}
      entity_id: binary_sensor.irrigation_unlimited_c1_z5
    enabled: true
  - service: irrigation_unlimited.adjust_time
    data:
      actual: >-
        {{
        timedelta(seconds=states('sensor.smart_irrigation_aceri_hourly_adjusted_run_time')
        | int(0))}}
      entity_id: binary_sensor.irrigation_unlimited_c1_z6
    enabled: true
mode: single



alias: Smart Irrigation Reset Bucket
description: Resets the Smart Irrigation bucket after watering
trigger:
  - platform: state
    entity_id:
      - binary_sensor.irrigation_unlimited_c1_z1
    from: "on"
    to: "off"
    id: Sud
  - platform: state
    entity_id:
      - binary_sensor.irrigation_unlimited_c1_z2
    from: "on"
    to: "off"
    id: Ovest
  - platform: state
    entity_id:
      - binary_sensor.irrigation_unlimited_c1_z3
    from: "on"
    to: "off"
    id: Nord
  - platform: state
    entity_id:
      - binary_sensor.irrigation_unlimited_c1_z4
    from: "on"
    to: "off"
    id: Est
  - platform: state
    entity_id:
      - binary_sensor.irrigation_unlimited_c1_z5
    from: "on"
    to: "off"
    id: Magnolia
  - platform: state
    entity_id:
      - binary_sensor.irrigation_unlimited_c1_z6
    from: "on"
    to: "off"
    id: Aceri
action:
  - choose:
      - conditions:
          - condition: trigger
            id: Sud
        sequence:
          - service: smart_irrigation.smart_irrigation_sud_reset_bucket
            data: {}
      - conditions:
          - condition: trigger
            id: Ovest
        sequence:
          - service: smart_irrigation.smart_irrigation_ovest_reset_bucket
            data: {}
      - conditions:
          - condition: trigger
            id: Sud
        sequence:
          - service: smart_irrigation.smart_irrigation_nord_reset_bucket
            data: {}
      - conditions:
          - condition: trigger
            id: Ovest
        sequence:
          - service: smart_irrigation.smart_irrigation_est_reset_bucket
            data: {}
      - conditions:
          - condition: trigger
            id: Sud
        sequence:
          - service: smart_irrigation.smart_irrigation_magnolia_reset_bucket
            data: {}
      - conditions:
          - condition: trigger
            id: Ovest
        sequence:
          - service: smart_irrigation.smart_irrigation_aceri_reset_bucket
            data: {}
    default: []


I post some pictures to make it a little more clear:

image

Actual sprinklers entities: image

AlessandroTischer avatar Sep 23 '22 19:09 AlessandroTischer

Can you post the system log entries. You will first need to turn on debug messages by adding the following to your config.

logger:
  default: info
  logs:
    custom_components.irrigation_unlimited: debug

In Settings -> System -> Log and search for 'irrigation_unlimited'. The messages I am particularly interested in should look like the following but post what is available:

2022-09-23 16:58:11.291 DEBUG (MainThread) [custom_components.irrigation_unlimited] CALL [2022-09-23 16:58:11] service: adjust_time, controller: 1, zone: 1, data: {"entity_id": "binary_sensor.irrigation_unlimited_c1_z1", "actual": "11:44:43"}

rgc99 avatar Sep 24 '22 22:09 rgc99

Hi @AlessandroTischer, sorry for my intrusion, but does HASmartIrrigation works for you? I have errors when it create the entity and adjusted_run_time is always 0

DamMenGH avatar Oct 21 '22 11:10 DamMenGH

Can you post the system log entries. You will first need to turn on debug messages by adding the following to your config.

logger:
  default: info
  logs:
    custom_components.irrigation_unlimited: debug

In Settings -> System -> Log and search for 'irrigation_unlimited'. The messages I am particularly interested in should look like the following but post what is available:

2022-09-23 16:58:11.291 DEBUG (MainThread) [custom_components.irrigation_unlimited] CALL [2022-09-23 16:58:11] service: adjust_time, controller: 1, zone: 1, data: {"entity_id": "binary_sensor.irrigation_unlimited_c1_z1", "actual": "11:44:43"}

I had lots of problem with my home server, so I'm rebuilding it from scratch. As soon as I get to the gardening section, I'll try again and report.

AlessandroTischer avatar Oct 21 '22 11:10 AlessandroTischer

Hi @AlessandroTischer, sorry for my intrusion, but does HASmartIrrigation works for you? I have errors when it create the entity and adjusted_run_time is always 0

Yes, it works. I think it would be better for you to ask on HASI gHub repo

AlessandroTischer avatar Oct 21 '22 11:10 AlessandroTischer

Yes, it works. I think it would be better for you to ask on HASI gHub repo

Thanks, but it seems a dead report, I will try

DamMenGH avatar Oct 21 '22 11:10 DamMenGH

Stale issue

rgc99 avatar Jul 31 '23 05:07 rgc99