Announcement

Collapse
No announcement yet.

Totally confused with my setup logic and how to implement it into HS

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Totally confused with my setup logic and how to implement it into HS

    The general idea of my setup is very simple - to periodically turn ventilation On and Off providing fresh air into the house according to different conditions and also occasionally run air circulation fan (for better mixing up air on two floors).
    I only have two devices to operate - Z-Wave modules "A1" and "A2" and they can be On and Off, can have delayed Off actions and can be included into recurring events.

    What complicates my system is that I have too many conditions I would like to take into account - temperatures inside and outside, balcony door sensor status, air conditioner state, Home-Away status and some others). Those conditions create wide array of action patterns for my circulation and ventilation modules. Sometimes ventilation should run constantly and circulation would be recurring. If conditions changes ventilation might stop and only circulation would be engaged etc. There are also a couple conditional rules, for example, if air conditioner is On the circulation device must also be On.

    What tactics should I use to implement my rules so they would not interfere with each other? I know that HS scans the setup every minute and if certain conditions are met the resulting event would run. I think that my problem is that all of my events are recurring, meaning there are delayed actions or wait commands involved.
    What if during the next scan HS determines that conditions have changed and another event must run but some delayed actions might be pending from the previous event? How can the system trace what is pending and decide if the action can be left or must be canceled because it interrupts proper execution of the most recent event?
    The diagram I attach is just a fraction of the scheme. I estimate that I might have around 50 different conditions that would result in about 6 different action patterns.

    Thanks, Alex
    Attached Files

    #2
    I think this is too much logic to rely on triggers and events directly. I would create a single reoccurring event, say every 1 or two minutes, that runs a single script. The script would handle all the logic, using either a few virtual devices to hold variables or the use of GetVar.
    Mike

    Comment


      #3
      Yes, I agree about the script. I was going to combine those multiple conditions into one file with many sections of "if...then". I also was thinking to create a virtual device that would work as an indicator of the most recent action triggered by HS (I'd call it an "ActionID").

      It might work like this: if {"A1" is Off, "A2" is On for 1 min.} > set ID=1. When 1 minute delay expires and "A2" gets turned Off then {"A1" is Off and "A2" is Off} > ID=0.
      By checking the "ActionID" every minute the HS would know if there are pending actions or not. (below I listed all possible "ActionIDs" for my setup)
      I was thinking I should use the "ActionID" as a condition but I am afraid it might be logically incorrect. I am not sure how to explain, I just feel it is wrong way to go.

      You mentioned "GetVar". HS help does not provide clear explanation on this. How can it help in tracing current system condition and especially pending actions (I am not a programmer, just learning)? Maybe an example of a logic or a script would help me to understand the connections.

      Thank you.

      List of all possible Action IDs I was able to came up with:
      ID=0 - A1 is Off, A2 is Off,
      ID=1 - A1 is Off, A2 is On and A2-Off action is pending,
      ID=2 - A1 is On, A1-Off action is pending, A2 is Off
      ID=3 - A1 is On, A2 is On, A2-Off action is pending
      ID=4 - A1 is On, A2 is Off
      ID=5 - A1 is On, A2 is On.

      Comment


        #4
        Looking at your image, it seems like it might be easier to have an event that triggers whenever the AC changes state that passes an AC changed message to the script. Then let the script take actions if you are away or home, and then test the conditions of open/closed windows/door. You could still have the script run reoccuring but it would eliminate some of the logic. I hope that makes sense.

        As for GetVar, as long as HS is running these are global variables that HS remembers, but loses once HS is shut down. The benefit of using global variables is that they don't clutter up your list of (virtual) devices.
        Mike

        Comment


          #5
          You can avoid having to do a script, which hides what is going on too much sometimes, and do it all easily and cleanly via events.

          The trick is to use the "Manual with Conditions" trigger.

          The "Manual with Conditions" trigger allows you to have an event with no trigger, but when that event is run from another event, the applied conditions will be evaluated.

          For each different set of event actions that you want run, create an event. Let's say you have 6 different event actions, so you create events A1, A2, ... A6. Now, set the trigger type on all of those events to "Manual With Conditions", and then to each one, apply all of the condition tests that would make you want to run that set of event actions.

          After you have done that, create a single event that is triggered by the Home/Away status changing, and for the event actions, choose Run Event 6 times and choose each one of the "A" events created earlier. Make sure the Advanced Options are enabled in the event action view, and put a check in the box that asks "Run Only If Conditions are TRUE (Applies to all RUN EVENT actions in this event.)"

          Now when that event triggers, it will run all of the "A" events, but the conditions will only be TRUE on ONE of the events, and so only ONE of the events will actually carry out its actions.

          To see another example of this, visit the HomeSeerOfficial channel on YouTube - here is a link to the Manual with Conditions video:
          http://www.youtube.com/user/HomeSeer...11/QnVW0dm2sHQ
          Regards,

          Rick Tinker (a.k.a. "Tink")

          Comment

          Working...
          X