TLDR; Two questions:
- Does/will EZLogic support sequences for actions? That is, in response to a trigger, run action “A”, wait for condition “B”, run action “C”, wait for condition “D”, etc.
- Using two virtual switches for testing, and adding them both with an “AND” logic under the trigger section results in somewhat confusing phrasing (at least to me), in that both entries say “Whenever switch state changes”, seemingly indicating that both switches would have to change value to trigger the MeshBot. Presumably, if one switch was already in the correct state, and only the other one changed, the “AND” would now be true, and trigger the action, correct?
Full explanation:
Once the DSC plugin is available, I want to set up a scene that performs the following sequence:
- Disarm the security system if needed (doesn’t hurt to just run the disarm command regardless)
- Wait for system to be in a “ready” state
- Arm the system in “Away” mode
- Wait for the system to be in an “Exit Delay” state.
- Trigger the garage door opener
At each step we need to pause to check the state of the system, since if we try to arm it before it is “ready”, then nothing will happen. Ideally, each check step would have a timeout value as well, that would emit an error if the timeout occurred without the desired state being reached (for example, step 2 may never occur because a window was left open - and I don’t want the sequence to resume as soon as I close the window- I want to restart it later! )
Is there/will there be a way to accomplish this easily in EZLogic?
As a workaround for not being able to find such an option, I came up with the idea of using a “guard” switch (a virtual switch that is turned on while running the sequence and turned off after/in the event of an error) and a number of MeshBots. The guard switch is needed to prevent the MeshBots from running at other times, for example in the morning when I disarm my system causing it to switch to a “ready” state.
So that makes the logic the following:
- MeshBot Step1
- Triggers: Guard is on AND System is “Armed Stay”
- Action: Disarm system
- MeshBot Step2
- Triggers: Guard is on AND System is “Ready”
- Action: Arm system in away mode
- MeshBot Step3
- Triggers Guard is on AND system is “Exit Delay”
- Actions: trigger garage door opener and set Guard to Off
- MeshBot Timeout
- Purpose is to stop the sequence should it get “stuck” at any point (such as step 2 never running due to system never being “ready”), so it doesn’t resume again as soon as the issue is resolved.
- Trigger: Guard is set to “on”
- Action (delay 30 seconds or so): Set guard to off
- MeshBot ExitHouse:
- kick off the entire sequence
- Trigger: Whatever I want to use to trigger this mess
- Action: Guard set to on
Does this sound like good logic? Is there a better way other than having multiple MeshBots like this? The whole sequence would be triggered by turning the “guard” virtual switch to “on”, which in turn would be triggered by some sort of remote button press, or perhaps directly via the iOS app.
In modeling this logic using virtual switches to represent the various states, I noticed that if I had two switches in the trigger section, combined with AND (as is the case for all the “steps” above), the phrasing seemed to indicate that it would only go true if both changed to a value of “On” at the same time. Presumably, though, this is simple phraseology, and if one switch was already on, then the action of turning on the second one only would, in fact trigger the MeshBot