Sensor left open web request help


#1

1) Give a description of the problem
I cannot get this piston to fire the 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

This is my first time trying to write a piston with integer

2) What is the expected behaviour?
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

3) What is happening/not happening?
the web request is not triggering

**4) Post a Green Snapshot of the piston![image|45x37]

5) Attach logs after turning logging level to Full
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)


#2

The web request has a wake up built into it after 20 secs I believe, it’s canceling your wait. What is the web request for?


#3

it is a voice monkey to alexa.
the voice monkey trigger works when I remove the interval and current duration


#4

Curious why you chose to structure the piston that way? You can use a ‘while loop’ or a ‘repeat loop’. Do you have Advanced Statements enabled?


#5

I am not familiar with advanced statements. If you are willing to walk me through what I should do I would love to learn.
I am new to writing pistons and saw an example that was structured similarly. I am open to any examples or suggestions yo can offer.


#6

I modified your piston, this is untested… I set the Task Cancellation Policy to Never where you see the “N” so that the wait timer doesn’t get cancelled by the web request… not sure if it will work though :slight_smile:


#7

Thank you. I’ll try it now.
I like to look at examples and instead of importing, try to figure out how to recreate them. I’ve learned quite a bit this way.


#8

Yep, sounds good.


#9

It still didn’t execute the web request or the sms.

how to you create the repeat loop?


#10

While in Edit mode, click Options and enable Advanced Statements


#11

Ok. I had it wrong. I re-wrote it to match yours and am trying it again.


#12

Nope. Still didn’t work. I let it run for 10 minutes and nothing.


#13

Are you using your piston or the one I posted? Your triggers are indicated by the orange lightning bolt, if you’re using your piston, then the only trigger is the door closing so it will not doing anything.


#14

I tried writing one to match yours. I obviously failed. I ran yours and it works. :confounded:


#15

Let’s see a green snapshot of your latest version.


#16

Update: I did it. I deleted mine completely and started from scratch following yours AND it actually works!

Thank you so much for the help and the tip about advanced options!


#17

Would you be willing to look at another one that I’m having trouble with? If yes, can i post it here or do I need to start a new thread?


#18

Go ahead and post it here.


#19

Kitchen lights turn on/off with motion except when switch is used.

The auto on/off works but they still shut off even when the switch is used.


#20

Need some additional logic in the bottom part also…

Edit: Remove the ‘on’, got sidetracked watching a movie lol