Sensor left open webcore help

I cannot get this piston to fire the voice monkey web request or send an SMS since adding in the define integer portion. Prior to this, it would make 1 web request and send 1 SMS after being open for 3 minutes

My goal is that when the sensor is left open for 3 minutes, make a web request
Repeat the web request every 3 minutes up to 10 times or until the sensor closes

LOGS:
9/24/2020, 1:52:42 PM +84ms
+0ms ╔Received event [TeBa’s House].execute = recovery with a delay of 58ms
+42ms ║RunTime Analysis CS > 20ms > PS > 5ms > PE > 16ms > CE
+44ms ║Runtime (39947 bytes) successfully initialized in 5ms (v0.3.110.20191009) (43ms)
+45ms ║╔Execution stage started
+58ms ║║Comparison (enum) open is (string) open = true (1ms)
+60ms ║║Condition #2 evaluated true (11ms)
+63ms ║║Comparison (integer) 0 is_less_than_or_equal_to (integer) 10 = true (1ms)
+64ms ║║Condition #7 evaluated true (4ms)
+65ms ║║Condition group #1 evaluated true (state did not change) (17ms)
+67ms ║║Cancelling statement #4’s schedules…
+71ms ║║Executed virtual command wait (1ms)
+72ms ║║Requesting a wake up for Thu, Sep 24 2020 @ 1:55:42 PM MST (in 180.0s)
+76ms ║╚Execution stage complete. (32ms)
+77ms ║Setting up scheduled job for Thu, Sep 24 2020 @ 1:55:42 PM MST (in 179.996s)
+85ms ╚Event processed successfully (85ms)
9/24/2020, 1:43:18 PM +3ms
+1ms ╔Received event [Fridge Garage Sensor Simulated].contact = open with a delay of 61ms
+39ms ║RunTime Analysis CS > 18ms > PS > 6ms > PE > 14ms > CE
+41ms ║Runtime (39965 bytes) successfully initialized in 6ms (v0.3.110.20191009) (39ms)
+42ms ║╔Execution stage started
+49ms ║║Comparison (enum) open is (string) open = true (1ms)
+51ms ║║Cancelling condition #2’s schedules…
+52ms ║║Condition #2 evaluated true (5ms)
+55ms ║║Comparison (integer) 0 is_less_than_or_equal_to (integer) 10 = true (1ms)
+57ms ║║Condition #7 evaluated true (4ms)
+58ms ║║Cancelling condition #1’s schedules…
+58ms ║║Condition group #1 evaluated true (state changed) (12ms)
+60ms ║║Cancelling statement #4’s schedules…
+64ms ║║Executed virtual command wait (0ms)
+65ms ║║Requesting a wake up for Thu, Sep 24 2020 @ 1:46:18 PM MST (in 180.0s)
+69ms ║╚Execution stage complete. (27ms)
+70ms ║Setting up scheduled job for Thu, Sep 24 2020 @ 1:46:18 PM MST (in 179.996s)
+83ms ╚Event processed successfully (83ms)

It should probably look more something like this: (Get rid of the “if” conditional and go with a “while” - “do”. Use a wait for the repeat function within the do loop.

Also, you need to increment your current duration interval by one on each loop. Not sure you why you are adding your interval of “3” in each iteration. That will only give you 3 loops before you reach the limit (<= 10).

You may want to just have a virtual switch that you can use to abort the actions (That is what my “yard work” switch does.

I got it working. Thank you

1 Like