Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running multiple sequences one after another, without specifying the time from 2nd sequence onwards #188

Open
evercape opened this issue Oct 27, 2024 · 2 comments

Comments

@evercape
Copy link
Contributor

Hi Robert,

I like to group certain sprinkler zones by sequences (alternatively individual controllers) since it gives a better visual overview, and also allows me control those sequences (or controllers) at once using the UI of the companion card. In addition, seasonal schedules of run times typically apply to those group of sprinkler zones.

For instance, all lawn zones should be under "LAWNS", all the little drip line around the trees under "DRIPLINE TREES" and so on.

In an ideal case scenario, I would like to set the first sequence start time (ie sunrise +15) with its schedule to maybe cycle a few times 5 minutes or so through each zone, and then move to the next sequence.

However, the documentation prescribes a start time for each sequence.

As a work around, I could manually calculate the maximum total time of each sequence, and add that plus a bit to the first sequence start time in order to make sure that there is ample time for the first sequence to run, before the second sequence commences, and so on.

Is there any other cleve way to group either zones in sequences or via individual controllers and have them just run one after another? I went through the documentation (which has gotten very detailed and long!) but I can't come up with a clever solution.

Below is my yaml for multiple sequences, but each requiring a start time:

  irrigation_unlimited:
    controllers:
      - name: Benguela
        zones:
          - name: "Courtyard East" #01
            entity_id: switch.irr01_courtyward_east
          - name: "Driveway East" #02
            entity_id: switch.irr02_driveway_east
          - name: "Boundary Top West" #03
            entity_id: switch.irr03_boundary_top_west
          - name: "Driveway West" #04
            entity_id: switch.irr04_driveway_west
          - name: "Berms Trees" #05
            entity_id: switch.irr05_berms_trees
          - name: "Top of Berms" #06
            entity_id: switch.irr06_top_of_berms
          - name: "Guest House Deck" #07
            entity_id: switch.irr07_guest_house_deck
          - name: "Courtyward West" #08
            entity_id: switch.irr08_courtyward_west
          - name: "Lawn South" #09
            entity_id: switch.irr09_lawn_south
          - name: "Lawn North" #10
            entity_id: switch.irr10_lawn_north
          - name: "Bed Lawn / Back Braai" #11
            entity_id: switch.irr11_bed_lawn_and_back_of_braai
          - name: "Front Pool" #12
            entity_id: switch.irr12_front_of_pool
          - name: "Dripline Trees" #13
            entity_id: switch.irr13_dripline_trees
          - name: "Dripline Embankment" #14
            entity_id: switch.irr14_dripline_embankment
        sequences:
          - name: "Lawns"
            duration: "00:05"
            repeat: 4
            schedules:
              - name: "Spring"
                time:
                  sun: "sunrise"
                  after: "00:15"
                weekday: [mon, wed, fri]
                month: [oct, nov]
            zones:
              - zone_id: 9
              - zone_id: 10
          - name: "Upper Driveway"
            duration: "00:05"
            repeat: 2
            schedules:
              - name: "Spring"
                time:
                  sun: "sunrise"
                  after: "00:15"
                weekday: [mon, wed, fri]
                month: [oct, nov]
            zones:
              - zone_id: 2
              - zone_id: 4
              - zone_id: 3
              - zone_id: 5
              - zone_id: 6
          - name: "Middle Terrace"
            duration: "00:05"
            repeat: 2
            schedules:
              - name: "Spring"
                time:
                  sun: "sunrise"
                  after: "00:15"
                weekday: [mon, wed, fri]
                month: [oct, nov]
            zones:
              - zone_id: 7
              - zone_id: 8
              - zone_id: 1
          - name: "Lower Pool"
            duration: "00:05"
            repeat: 2
            schedules:
              - name: "Spring"
                time:
                  sun: "sunrise"
                  after: "00:15"
                weekday: [mon, wed, fri]
                month: [oct, nov]
            zones:
              - zone_id: 11
              - zone_id: 12
          - name: "Dripline Trees"
            duration: "00:05"
            repeat: 2
            schedules:
              - name: "Spring"
                time:
                  sun: "sunrise"
                  after: "00:15"
                weekday: [mon, wed, fri]
                month: [oct, nov]
            zones:
              - zone_id: 13
              - zone_id: 14

If you have any ideas, or someone else, please let me know.
Thanks
Martin

@rgc99
Copy link
Owner

rgc99 commented Nov 4, 2024

It sounds like you want a type of sequence chaining. How about an automation that triggers when the sequence finishes and starts the next. Two ways to detect the end of a sequence; The state of the sequence entity goes from on to off or listen for the irrigation_unlimited_finish notification (there was new information added in the last release). Now fire a manual run on the next sequence but here is the trick, do not specify a time. It will calculate the default time.

@evercape
Copy link
Contributor Author

evercape commented Nov 5, 2024

Thanks Robert, that is exactly what I am trying to achieve. Automation is fine, however, isn't a start time always required?

Here is my setup code which works just fine, as I provide for ample time in between sequences:

  #IRRIGATION CONTROLLER
  irrigation_unlimited:
    history:
      span: 3
    refresh_interval: 15
    controllers:
      - name: Benguela
        enabled: true
        check_back:
          states: none
        all_zones_config:
          show:
            timeline: true
            config: true
          future_span: 6

        #Master Valve swith on/off before/after each zone run.
        preamble: 5 # Seconds
        postamble: 5 # Seconds
        entity_id:
          - switch.irr24_master_valve #master switch

        zones:
          - name: "Lawn North & South" #01
            entity_id:
              - switch.irr09_lawn_south
              - switch.irr10_lawn_north

          - name: "Driveway East" #02
            entity_id: switch.irr02_driveway_east
          - name: "Driveway West" #03
            entity_id: switch.irr04_driveway_west

          - name: "Top West Boundary" #04
            entity_id: switch.irr03_boundary_top_west
          - name: "Top of Berms" #05
            entity_id: switch.irr05_berms_trees
          - name: "Top Retaining wall" #06
            entity_id: switch.irr06_top_of_berms

          - name: "Courtyard East" #07
            entity_id: switch.irr01_courtyward_east
          - name: "Courtyward West" #08
            entity_id: switch.irr08_courtyward_west
          - name: "Guest House Deck" #09
            entity_id: switch.irr07_guest_house_deck

          - name: "Bed Lawn / Back of Braai" #10
            entity_id: switch.irr11_bed_lawn_and_back_of_braai
          - name: "Front of Pool" #11
            entity_id: switch.irr12_front_of_pool

          - name: "Dripline Trees" #12
            entity_id: switch.irr13_dripline_trees
          - name: "Dripline Embankment" #13
            entity_id: switch.irr14_dripline_embankment

        sequences:
          - name: "Lawns"
            duration: "00:25"
            repeat: 1
            schedules:
              - name: "Spring"
                time:
                  sun: "sunrise"
                  after: "00:15"
                weekday: [mon, wed, fri]
                month: [oct, nov]
              - name: "Summer"
                time:
                  sun: "sunrise"
                  after: "00:15"
                weekday: [mon, tue, wed, thu, fri, sat, sun]
                month: [dec, jan, feb, mar]
              - name: "Autumn"
                time:
                  sun: "sunrise"
                  after: "00:15"
                weekday: [mon, fri]
                month: [apr, may]
            zones:
              - zone_id: 1

          - name: "Upper Driveway"
            duration: "00:05"
            repeat: 2
            schedules:
              - name: "Spring"
                time:
                  sun: "sunrise"
                  after: "01:00"
                weekday: [mon, wed, fri]
                month: [oct, nov]
              - name: "Summer"
                time:
                  sun: "sunrise"
                  after: "01:00"
                weekday: [mon, tue, wed, thu, fri, sat, sun]
                month: [dec, jan, feb, mar]
              - name: "Autumn"
                time:
                  sun: "sunrise"
                  after: "01:00"
                weekday: [mon, fri]
                month: [apr, may]
            zones:
              - zone_id: 2
              - zone_id: 3
              - zone_id: 4
              - zone_id: 5
              - zone_id: 6

          - name: "Middle Terrace"
            duration: "00:05"
            repeat: 2
            schedules:
              - name: "Spring"
                time:
                  sun: "sunrise"
                  after: "02:00"
                weekday: [mon, wed, fri]
                month: [oct, nov]
              - name: "Summer"
                time:
                  sun: "sunrise"
                  after: "02:00"
                weekday: [mon, tue, wed, thu, fri, sat, sun]
                month: [dec, jan, feb, mar]
              - name: "Autumn"
                time:
                  sun: "sunrise"
                  after: "02:00"
                weekday: [mon, fri]
                month: [apr, may]
            zones:
              - zone_id: 7
              - zone_id: 8
              - zone_id: 9

          - name: "Lower Pool"
            duration: "00:05"
            repeat: 2
            schedules:
              - name: "Spring"
                time:
                  sun: "sunrise"
                  after: "03:00"
                weekday: [mon, wed, fri]
                month: [oct, nov]
              - name: "Summer"
                time:
                  sun: "sunrise"
                  after: "03:00"
                weekday: [mon, tue, wed, thu, fri, sat, sun]
                month: [dec, jan, feb, mar]
              - name: "Autumn"
                time:
                  sun: "sunrise"
                  after: "03:00"
                weekday: [mon, fri]
            zones:
              - zone_id: 10
              - zone_id: 11

          - name: "Nature Reserve"
            duration: "00:05"
            repeat: 2
            schedules:
              - name: "Spring"
                time:
                  sun: "sunrise"
                  after: "04:00"
                weekday: [mon, wed, fri]
                month: [oct, nov]
              - name: "Summer"
                time:
                  sun: "sunrise"
                  after: "04:00"
                weekday: [mon, tue, wed, thu, fri, sat, sun]
                month: [dec, jan, feb, mar]
              - name: "Autumn"
                time:
                  sun: "sunrise"
                  after: "04:00"
                weekday: [mon, fri]
            zones:
              - zone_id: 12
              - zone_id: 13

Thanks
Martin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants