Evening lock up piston question


#1

1) Give a description of the problem
I have 2 garage doors controlled by the same MyQ controller. I am trying to write a piston to fire at a specified time to turn on the exterior house lights, close both garage doors (if they are open) wait a few seconds and turn out the lights again. I have tried many iterations of the same idea, but seem to be missing something

2) What is the expected behaviour?
(PUT YOUR INFO HERE)

3) What is happening/not happening?
The second garge door does not get closed and the light remains on - likely because the piston does not complete the final IF statement

**4) Post a Green Snapshot of the piston!

5) Attach logs after turning logging level to Full
5/4/2019, 7:40:09 PM +190ms
+1ms ╔Received event [My home].time/recovery = 1557024009190 with a delay of 0ms
+246ms ║RunTime Analysis CS > 121ms > PS > 92ms > PE > 32ms > CE
+249ms ║Runtime (41660 bytes) successfully initialized in 92ms (v0.3.10a.20190223) (246ms)
+250ms ║╔Execution stage started
+301ms ║║Comparison (enum) closed is_any_of (string) closing,open,opening = false (4ms)
+306ms ║║Comparison (enum) open is_any_of (string) closing,open,opening = true (3ms)
+309ms ║║Condition #3 evaluated true (22ms)
+310ms ║║Condition group #2 evaluated true (state did not change) (25ms)
+313ms ║║Cancelling statement #8’s schedules…
+328ms ║║Executed physical command [Exterior Lights].on() (10ms)
+329ms ║║Executed [Exterior Lights].on (13ms)
+333ms ║║Cancelling statement #10’s schedules…
+340ms ║║Executed virtual command setVariable (1ms)
+355ms ║║Comparison (enum) closed is_any_of (string) open,opening = false (4ms)
+358ms ║║Condition #18 evaluated false (14ms)
+360ms ║║Condition group #17 evaluated false (state did not change) (15ms)
+372ms ║║Comparison (enum) open is_any_of (string) open,opening = true (2ms)
+375ms ║║Condition #24 evaluated true (12ms)
+377ms ║║Condition group #23 evaluated true (state did not change) (13ms)
+381ms ║║Cancelling statement #25’s schedules…
+2741ms ║║Executed physical command [null].close() (2357ms)
+2743ms ║║Executed [Matt’s Door].close (2360ms)
+2747ms ║║Cancelling statement #27’s schedules…
+2752ms ║║Executed virtual command wait (1ms)
+2754ms ║║Requesting a wake up for Sat, May 4 2019 @ 7:40:21 PM PDT (in 10.0s)
+2765ms ║╚Execution stage complete. (2515ms)
+2767ms ║Setting up scheduled job for Sat, May 4 2019 @ 7:40:21 PM PDT (in 9.989s), with 1 more job pending
+2780ms ╚Event processed successfully (2780ms)


#2

I would probably remove the WHILE, the extraneous conditions, and the variable, and streamline it something like this:

My logic is that webCoRE is smart enough to not send a “Close” command to a device that is already closed… and the variable you created is hurting more than helping.


Pro Tip:
It might be wise to add another WAIT before the ‘Close’ on line 34 above.
This is in case anyone happens to be nearby, they can see the light before the door starts moving (giving them a chance to get to safety)


#3

Well not surprisingly, your rendition worked considerably better. One last question, though. My hope was that the exterior lights would not turn off if either door fails to close. That was why I was using the variable to shut off the light. Is there an easy way to do this?


#4

Here you go… I added that logic back in:


#5

I really appreciate your help with this. The IF statement at the end for the exterior lights should have been a no brainer. The only issue I’m bumping into is the piston tries to close door 2 before the MyQ is ready to send the command, so door 2 is actively closing when the exterior lights IF is being evaluated. I’ve adjusted the wait timeframes several times and there appears to be a un-programmed delay (random in time but as long as 30 seconds) where the trace shows “pending” before Door 2 gets the command to close. At that point the exterior light IF statement has already evaluated false so the light doesn’t shut off. Is there a way to force the piston to pause (for lack of the appropriate term) until Door 1 is closed, and then again for door 2, then resume?

Otherwise this is mint for my purposes.

Thank you.


#6

A lot of window blinds have the same issue, of not responding as quickly as we’d like and/or not reporting the changes back to the hub fast enough. Increasing the delay is likely the path I would take (for reliability) but you could always squeeze in another IF like I did above to check the status if you wanted.


Another option is to add a safety net at the very bottom, right below this:

                     Wait 5 minutes
                END IF

                IF ALL of Garage Door 1 & 2 are closed
                     Then Turn off Exterior lights
                     Else Send me a loud alert
                END IF