Coder Social home page Coder Social logo

Delay between Zones about irrigation_unlimited HOT 9 CLOSED

rgc99 avatar rgc99 commented on August 15, 2024
Delay between Zones

from irrigation_unlimited.

Comments (9)

rgc99 avatar rgc99 commented on August 15, 2024 1

There is a pre-release version '2021.3.21pre' available with this feature implemented.

from irrigation_unlimited.

rgc99 avatar rgc99 commented on August 15, 2024

Hi Ivan,
Thank you for your feedback. There are a few solutions here.

The first is to stagger the times but with the default setup this would mean a minimum of a minute which is probably longer than you want. Looks like you were on the right track changing the granularity to 10 seconds but I have just out found this is broken. Should have it fixed shortly but it would allow you to do (Note the seconds on before and after parameters):

irrigation_unlimited:
  granularity: 10
  controllers:
    - name: "Fundos"
      enabled: true
      zones:
        - name: "Gramado"
          entity_id: "switch.irrigacao_grama"
          enabled: true
          minimum: "00:00:10"
          maximum: "00:05:00"
          schedules:
            - name: "Alvorada"
              time:
                sun: "sunrise"
                before: "00:20:20"
              duration: "00:02"
            - name: "Por do Sol"
              time:
                sun: "sunset"
                after: "00:30:10"
              duration: "00:02"
        - name: "Lateral"
          entity_id: "switch.irrigacao_lateral"
          enabled: true
          minimum: "00:00:10"
          maximum: "00:05:00"
          schedules:
            - name: "Alvorada"
              time:
                sun: "sunrise"
                before: "00:20:10"
              duration: "00:02"
            - name: "Por do Sol"
              time:
                sun: "sunset"
                after: "00:30:20"
              duration: "00:02"

The next solution is to leave the switch entity_id (switch.irrigacao_grama...) out and write an automation that tracks the zone entity and put in a delay before turning on the valve. This is not very elegant and creates the situation I was trying avoid in the first place with satellite scripts everywhere, but it would work.

Finally, a delay parameter in the configuration. The easiest way would be to delay calling the switch to turn on. Much like the above automation idea but built in. All of the system would show its on such as status, icons, history but the triggering of the switch would be postponed. This would also reduce the watering time (duration) by the delay amount.

from irrigation_unlimited.

ivanroberto avatar ivanroberto commented on August 15, 2024

Hi Robert,

Sorry for the delay in responding, I understood your proposals perfectly and thank you for that, I even implemented the first one. Thanks!

I know you have done an excellent job so far, however I would like to suggest a different approach with regard to zones, because when there are several valves in the system and we cannot open them at the same time (for example, insufficient water flow limit) , but we want them to all open in the same time range (at sunset and sunrise), instead of "zones" they could contain "schedules", "schedules" could contain "zones", and then create a property in the "zones" for "duration" and another property "delay_zones" in "schedules".

granularity: 10
controllers:
  - name: "Fundos"
    enabled: true
    schedules:
        "delay_zones": "00:00:10"
        - name: "Alvorada"
            time:
            sun: "sunrise"
            before: "00:00"
        - name: "Por do Sol"
            time:
            sun: "sunset"
            after: "00:30"
        zones:
        - name: "Zone1"
            entity_id: "switch.irrigation_zone1"
            enabled: true
            duration: "00:10"
        - name: "Zone2"
            entity_id: "switch.irrigation_zone2"
            enabled: true
            duration: "00:02"        
        - name: "Zone3"
            entity_id: "switch.irrigation_zone3"
            enabled: true
            duration: "00:01"
        - name: "Zone4"
            entity_id: "switch.irrigation_zone4"
            enabled: true
            duration: "00:06"
        - name: "Zone5"
            entity_id: "switch.irrigation_zone5"
            enabled: true
            duration: "00:04"
        - name: "Zone6"
            entity_id: "switch.irrigation_zone6"
            enabled: true
            duration: "00:07"                                    
        - name: "Zone7"
            entity_id: "switch.irrigation_zone7"
            enabled: true
            duration: "00:01"
        - name: "Zone8"
            entity_id: "switch.irrigation_zone8"
            enabled: true
            duration: "00:05"

Thanks

from irrigation_unlimited.

AlfonsPuig avatar AlfonsPuig commented on August 15, 2024

Hi Ivan,

I like very much your proposal. It's the solution I was looking for.

And thanks to Robert for the great job!

from irrigation_unlimited.

rgc99 avatar rgc99 commented on August 15, 2024

I like your idea. It changes the zones and schedule tiers around and essentially creates a zone queue. It's great when you want one and only one zone on at any time and run through them sequentially. It doesn't however allow for more than one zone on at any time which might be possible if water pressure permits and probably does in many situations.

Without upsetting the apple cart too much, retaining what we have and adding in your feature this is my suggestion. First relax the requirement that a zone contain at least one schedule. Next is to create a new section, here I have called it "queues" but I remain open to a better name. Now we implement your idea but instead of the actual zones we refer back to the zones section. Its kind of creating a map. Finally, why stop at one list, let's have many - unlimited. A configuration example probably explains it best.

irrigation_unlimited:
  controllers:
    - name: "Fundos"
      zones:
        - name: "Gramado"
          entity_id: "switch.irrigacao_grama"
        - name: "Lateral"
          entity_id: "switch.irrigacao_lateral"
        - name: "Corredor"
          entity_id: "switch.irrigacao_corredor"
        - name: "Horta"
          entity_id: "switch.irrigacao_horta"
      queues:
        - name: "Run 1"
          delay: "00:00:10"
          schedules:
            - name: "Alvorada"
              time:
                sun: "sunrise"
            - name: "Por do Sol"
              time:
                sun: "sunset"
                after: "00:30"
          zones:
            - zone_id: 1
              duration: "00:10"
            - zone_id: 2
              duration: "00:02"        
            - zone_id: 3
              duration: "00:01"
            - zone_id: 4
              duration: "00:06"
        - name: "Run 2"
          delay: "00:00:10"
          schedules:
            - name: "Midday"
              time: "12:00"
          zones:
            - zone_id: 2
              duration: "00:02"        
            - zone_id: 3
              duration: "00:01"

from irrigation_unlimited.

ivanroberto avatar ivanroberto commented on August 15, 2024

Hi Robert,

Great! Even better this way.
I just suggest declare zone_id manually when declared zones, so this way its can avoid mistakes. About name "queues", is it good, or maybe "sequence"

irrigation_unlimited:
  controllers:
    - name: "Fundos"
      zones:
        - name: "Gramado"
          entity_id: "switch.irrigacao_grama"
          zone_id: 1
        - name: "Lateral"
          entity_id: "switch.irrigacao_lateral"
          zone_id: 2
        - name: "Corredor"
          entity_id: "switch.irrigacao_corredor"
          zone_id: 3
        - name: "Horta"
          entity_id: "switch.irrigacao_horta"
          zone_id: 4
      queues:
        - name: "Run 1"
          delay: "00:00:10"
          schedules:
            - name: "Alvorada"
              time:
                sun: "sunrise"
            - name: "Por do Sol"
              time:
                sun: "sunset"
                after: "00:30"
          zones:
            - zone_id: 1
              duration: "00:10"
            - zone_id: 2
              duration: "00:02"        
            - zone_id: 3
              duration: "00:01"
            - zone_id: 4
              duration: "00:06"
        - name: "Run 2"
          delay: "00:00:10"
          schedules:
            - name: "Midday"
              time: "12:00"
          zones:
            - zone_id: 2
              duration: "00:02"        
            - zone_id: 3
              duration: "00:01"

Thank you so much

from irrigation_unlimited.

ivanroberto avatar ivanroberto commented on August 15, 2024

Hi Robert,

Worked perfectly! Congratulations, great job!
The only thing I had to do is change the "granularity" to "00:00:05", because I was randomly failing to start a valve or another, adjusting to 5 seconds, I no longer noticed any problems (maybe because I used just 10 seconds for test purpose).

Another thing I noticed (but this happened before) is that if you disable a controller through the interface and then restart the home assistant, it will be enabled again.

Your work was great, thank you very much for your time and commitment!

granularity: 5
controllers:
  - name: "Fundos"
    zones:
      - name: "Gramado"
        entity_id: "switch.irrigacao_grama"
      - name: "Lateral"
        entity_id: "switch.irrigacao_lateral"
      - name: "Corredor"
        entity_id: "switch.irrigacao_corredor"
      - name: "Horta"
        entity_id: "switch.irrigacao_horta"
    sequences:
      - name: "Run 1"
        delay: "00:00:10"
        schedules:
          - name: "Alvorada"
            # time:
            #   sun: "sunrise"
            time: "21:25"
          - name: "Por do Sol"
            # time:
            #   sun: "sunset"
            #   after: "00:30"
            time: "21:27"
        zones:
          - zone_id: 1
            duration: "00:00:10"
          - zone_id: 2
            duration: "00:00:10"
          - zone_id: 3
            duration: "00:00:10"
          - zone_id: 4
            duration: "00:00:10"

from irrigation_unlimited.

rgc99 avatar rgc99 commented on August 15, 2024

The enable/disable is now persistent across HA restarts. Please see pre-release version '2021.3.23pre'.

from irrigation_unlimited.

ivanroberto avatar ivanroberto commented on August 15, 2024

Great Robert,
Works!
Thanks

from irrigation_unlimited.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.