Need help with a paused piston


#1

1) Give a description of the problem
I have a piston designed to send a text notification if somebody pulls in my driveway (contact sensor 14) and my wife and I (presence sensors 1 & 2) are not present. I only want the alert when they pull in the driveway not when they exit. I have created a 6 minute pause in the piston, which hopefully gives them time to deliver package and leave before resuming the piston.

2) What is the expected behavior?
Only pause piston for 6 minutes and resume normal operation

3) What is happening/not happening?
Its seems the piston is getting stuck being paused. When I log into Webcore it always says it is paused.

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
3485ac94-84af-4057-a62d-8f21564a7b28 4:40:36 PM: debug Power: oldValue: 418.0, newValue: 407.0, delta: 2.7%, threshold: 10%

3485ac94-84af-4057-a62d-8f21564a7b28 4:40:36 PM: debug A sensor event occurred: [name:power, deviceId:7e7bcc3d-9e61-4633-bfc3-df36b1b6a324, isoDate:2019-02-05T21:40:36.002Z, unit:W, value:407]

a8c08a0f-47d8-4f91-8901-0697948a64f6 4:40:36 PM: debug Shipped Event: [epoch:1549402836.103, key:HEM GEN 5(power_W), value:407]

a8c08a0f-47d8-4f91-8901-0697948a64f6 4:40:36 PM: debug shipped events and got 204

a8c08a0f-47d8-4f91-8901-0697948a64f6 4:40:36 PM: trace HEM GEN 5(power:W) 407

3485ac94-84af-4057-a62d-8f21564a7b28 4:40:30 PM: debug Power: oldValue: 418.0, newValue: 395.0, delta: 5.8%, threshold: 10%

3485ac94-84af-4057-a62d-8f21564a7b28 4:40:30 PM: debug A sensor event occurred: [name:power, deviceId:7e7bcc3d-9e61-4633-bfc3-df36b1b6a324, isoDate:2019-02-05T21:40:30.413Z, unit:W, value:395]

a8c08a0f-47d8-4f91-8901-0697948a64f6 4:40:30 PM: debug Shipped Event: [epoch:1549402830.569, key:HEM GEN 5(power_W), value:395]

a8c08a0f-47d8-4f91-8901-0697948a64f6 4:40:30 PM: debug shipped events and got 204

a8c08a0f-47d8-4f91-8901-0697948a64f6 4:40:30 PM: trace HEM GEN 5(power:W) 395

a6a05028-d840-48b9-aff3-4e68894784a4 4:40:28 PM: info â•” Event processed successfully (119ms)

a6a05028-d840-48b9-aff3-4e68894784a4 4:40:28 PM: trace â•‘â•” Execution stage complete. (19ms)

a6a05028-d840-48b9-aff3-4e68894784a4 4:40:28 PM: debug â•‘â•‘ Condition group #1 evaluated false (state did not change) (10ms)

a6a05028-d840-48b9-aff3-4e68894784a4 4:40:28 PM: debug â•‘â•‘ Condition #5 evaluated false (7ms)

a6a05028-d840-48b9-aff3-4e68894784a4 4:40:28 PM: trace â•‘â•š Execution stage started

a6a05028-d840-48b9-aff3-4e68894784a4 4:40:28 PM: trace â•‘ Runtime (38827 bytes) successfully initialized in 46ms (v0.3.109.20181207) (94ms)

a6a05028-d840-48b9-aff3-4e68894784a4 4:40:28 PM: debug â•‘ RunTime Analysis CS > 20ms > PS > 46ms > PE > 27ms > CE

a6a05028-d840-48b9-aff3-4e68894784a4 4:40:28 PM: info â•š Received event [Home].test = 1549402828536 with a delay of 2ms

4:40:23 PM: info Waiting on events…

4:40:23 PM: info For past logs for individual things go to the My Devices section, find the device and click on the Events link on the device information page.

4:40:23 PM: info This console provides live logging of your SmartThings.

REMOVE BELOW AFTER READING


#2

If you pause the piston, it won’t ever get to the code that tells it to resume. I would create a global variable called “hold-timer” set to false and do the following:

If contact sensor changes to open and Presence sensors are not present and hold-timer = false then:

  • send SMS
  • Set hold-timer = true
  • wait 6 minutes
  • set hold-timer = false
    end

Set your if statement to never terminate piston.


#3

The way I would do it is move line 26 to the very bottom (outside the IF). It should work then


#4

Brian-
Thanks for the help. I understand what your saying about the piston not continuing past the pause, that makes sense. I also understand what your telling me to add to the piston to fix the problem but I am not capable of doing it. Could you help me write this piston in the method you explained. I would sure appreciate it. I honestly have built most all of my pistons by finding pistons created by others and modifying them. But I think finding a piston using the functions you are describing with a similar set up is going to be challenging.


#5

I tried to use the drag function to accomplish this and it won’t let me. When I go to that line to add a DO statement that is not an option. I am truly an amateur with Webcore, any change you can modify my piston and post it?


#6

Sure, OK. Give me a minute


#7

Here you go:

I had to add the generic “location” block to house that last line. And then the drag and drop works


#8

Thank you for your help. I got the piston restored and the values fixed. If I have a problem I will revisit.

I don’t quite understand adding the purpose of the location part but I’m gonna see if I can’t educate myself on why by searching the forums. Again, thanks for taking time to build that piston.


#9

All commands need to be inside a block. For example, if you are controlling a light, the “Turn on” command goes into a block dedicated to that bulb. When you have a generic command (such as resume a piston), it can actually go inside any block. Personally, I just use the “location” block as my default.

temp


#10

I have another piston that I wanted to pause just like the one you made last night. I have not had a chance to test the one from last night because the conditions have not been met but the other piston got ran this morning and it got stuck on pause as well. I literally copies what you gave me and made some changes to the devices. It went off this morning and I waited 20 minutes just to log in and check it out… it was still stuck on pause.


#11

I would have to assume the one you created last night is going to do the same thing. I’ll let you know tonight when I get home and piston has had a chance to run.


#12

For what it is worth, I normally try to avoid pausing pistons… I think I should probably mention that my method above will not work in all pistons. Each time an event fires (Contact Sensor 12, 13, 14 or Switch 2) then the other piston will resume.


#13

Any ideas on a way to rewrite the piston and the pause work?


#14

I am sorry, I don’t have much freetime the next 48 hours.
Maybe make a new thread asking about this new piston?


#15

My version would look like this. You would have to create the global variable in the right side of the edit screen. Be sure to change the type from “Device” to “Variable”.


#16

Brain,
Thanks for this. After seeing what you did I educated myself on the global variables feature. This helped me accomplish what I was trying to do. Neat feature.