Aiper Irrisense 2

This is not my integration. But since it was never shared here, I decided to share it along with my irrigation schedule/automation setup.
There is a general Aiper integration, but as far I can tell as of today it doesn’t include the Irrisense 2 irrigation devices.
This one is dedicated to Irrisense 2:

With this integration I am able to create irrigation schedules that are not possible with the official Aiper app. With the app you can only create one a schedule linked to one irrigation zone. This is problematic when you have multiple zones and just want them to be watered sequentially. With the app you need to time separate schedules for different zones to make sure they don’t overlap.
With HA you can use the Active Zone state change to start a new zone.

alias: Irrigation
description: ""
triggers:
  - trigger: time
    at: "23:00:00"
    id: start-23_00
  - trigger: state
    entity_id:
      - sensor.irrisense_1_active_zone
    from:
      - Flowers
    to:
      - Idle
    id: flowers_end
    for:
      hours: 0
      minutes: 0
      seconds: 5
  - trigger: state
    entity_id:
      - sensor.irrisense_1_active_zone
    from:
      - Yard
    to:
      - Idle
    id: yard_end
    for:
      hours: 0
      minutes: 0
      seconds: 5
  - trigger: state
    entity_id:
      - sensor.irrisense_2_active_zone
    from:
      - Back Yard
    to:
      - Idle
    id: back_yard_end
    for:
      hours: 0
      minutes: 0
      seconds: 5
conditions: []
actions:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - start-23_00
        sequence:
          - action: select.select_option
            metadata: {}
            target:
              entity_id: select.irrisense_1_dosis
            data:
              option: 3 mm
          - action: select.select_option
            metadata: {}
            target:
              entity_id: select.irrisense_1_wateringzone
            data:
              option: Flowers (Line)
          - action: button.press
            metadata: {}
            target:
              entity_id: button.irrisense_1_watering_start
            data: {}
          - action: input_boolean.turn_on
            metadata: {}
            target:
              entity_id: input_boolean.watering_via_automation_started
            data: {}
        alias: Flowers at 23h
      - conditions:
          - condition: trigger
            id:
              - flowers_end
          - condition: state
            entity_id: input_boolean.watering_via_automation_started
            state:
              - "on"
        sequence:
          - action: select.select_option
            metadata: {}
            target:
              entity_id: select.irrisense_1_dosis
            data:
              option: 6 mm
          - action: select.select_option
            metadata: {}
            target:
              entity_id: select.irrisense_1_wateringzone
            data:
              option: Yard (Area)
          - action: button.press
            metadata: {}
            target:
              entity_id: button.irrisense_1_watering_start
            data: {}
        alias: Yard
      - conditions:
          - condition: trigger
            id:
              - yard_end
          - condition: state
            entity_id: input_boolean.watering_via_automation_started
            state:
              - "on"
        sequence:
          - action: select.select_option
            metadata: {}
            target:
              entity_id: select.irrisense_2_dosis
            data:
              option: 6 mm
          - action: select.select_option
            metadata: {}
            target:
              entity_id: select.irrisense_2_wateringzone
            data:
              option: Back Yard (Area)
          - action: button.press
            metadata: {}
            target:
              entity_id: button.irrisense_2_watering_start
            data: {}
          - action: input_boolean.turn_off
            metadata: {}
            target:
              entity_id: input_boolean.waterung_via_automation_started
            data: {}
        alias: Back Yard
mode: single

This simplified example demonstrates switching between watering zones and even different Irrisense 2 devices whenever a specific watering active zone switches from a particular zone to Idle using trigger IDs. The first trigger ID is a time based trigger when irrigation is to begin. The rest is accomplished whenever the prior irrigation zone has turned to an idle state, meaning it is finished.

Hope this is useful to anyone.

BTW: as for the limitation that Aiper only allows one account to connect to its cloud at any given time and your HA integration and App will constantly throw each other out - I noticed it was not enough to just make sure the App on your smartphone is closed. Apparently it will still wake up and connect in the background, which constantly caused the HA integration to go unavailable.
I was able to fix this by denying the app the ability to connect to my local network and by disabling notifications for the App. I use iOS, so not sure how this is done on Android as Android users have noticed the same issue. In my case (with iOS) this keeps my HA integration available at all times. If I want to use the app for anything (like firmware updates), I disable the Irrisense integration in HA and open the app. I have to login again in the app, but it works until I close the app and re-enable the HA integration.

1 Like

I was looking for this! Great, thank you

Made a slight modification to my automation. Since I noticed that sometimes the state would change to Idle twice within a second, I wanted to make sure this doesn’t cause a problem. So, I added to the triggers (beginning from the second) a 5 second pause. So, it will only trigger if the Active Zone changes to Idle for 5 seconds.
I also wanted to avoid the automation from triggering when I manually start an irrigation action. So, I created an input boolean helper (input_boolean.watering_via_automation_started) that turns to the on state when the first time based trigger starts the automated irrigation series. Then the following zone watering actions are only triggered as long as this input boolean is on. The last watering action in the series turns it off. So, if I start a watering action manually while this helper’s state is off, then it doesn’t trigger a whole series of events when I only wanted to water one zone manually.