[DEPRECATED Thread: visit community.webcore.co for assistance] webCoRE - Piston Design Help (ask your fellow members for assistance)

Where did you post this example? I’m trying to recreate a core latching piston.

CoRE or webCoRE?
This thread is for webCoRE.

In the wiki samples page

I’m still having issues with this piston. The 2nd half seems to execute multiple times. Below is the piston and below that is a portion of the log showing what it did. I am assuming I need to set the execution condition but not sure where.

5/4/2017, 4:51:31 PM +740ms
+0ms ╔Received event [Home].alarmSystemStatus = away with a delay of 38ms
+745ms ║Piston waited at a semaphore for 569ms
+746ms ║Runtime successfully initialized (v0.1.09e.20170503) (744ms)
+747ms ║╔Execution stage started
+1322ms ║║Executed virtual command executeRoutine (158ms)
+1337ms ║║Executed virtual command setVariable (4ms)
+1435ms ║╚Execution stage complete. (689ms)
+1479ms ╚Event processed successfully (1478ms)
5/4/2017, 4:51:30 PM +925ms
+1ms ╔Received event [Home].alarmSystemStatus = away with a delay of 98ms
+365ms ║Piston waited at a semaphore for 262ms
+366ms ║Runtime successfully initialized (v0.1.09e.20170503) (364ms)
+367ms ║╔Execution stage started
+800ms ║║Executed virtual command executeRoutine (131ms)
+810ms ║║Executed virtual command setVariable (3ms)
+882ms ║╚Execution stage complete. (515ms)
+1035ms ╚Event processed successfully (1035ms)
5/4/2017, 4:51:30 PM +156ms
+1ms ╔Received event [Home].alarmSystemStatus = away with a delay of 68ms
+418ms ║Piston waited at a semaphore for 266ms
+419ms ║Runtime successfully initialized (v0.1.09e.20170503) (417ms)
+420ms ║╔Execution stage started
+702ms ║║Executed virtual command executeRoutine (184ms)
+714ms ║║Executed virtual command setVariable (4ms)
+791ms ║╚Execution stage complete. (372ms)
+825ms ╚Event processed successfully (824ms)
5/4/2017, 4:51:29 PM +466ms
+1ms ╔Received event [Home].alarmSystemStatus = away with a delay of 214ms
+387ms ║Piston waited at a semaphore for 262ms
+388ms ║Runtime successfully initialized (v0.1.09e.20170503) (386ms)
+389ms ║╔Execution stage started
+650ms ║║Executed virtual command executeRoutine (165ms)
+661ms ║║Executed virtual command setVariable (3ms)
+728ms ║╚Execution stage complete. (339ms)
+757ms ╚Event processed successfully (757ms)
5/4/2017, 4:51:28 PM +657ms
+1ms ╔Received event [Home].alarmSystemStatus = away with a delay of 48ms
+378ms ║Piston waited at a semaphore for 263ms
+378ms ║Runtime successfully initialized (v0.1.09e.20170503) (376ms)
+380ms ║╔Execution stage started
+774ms ║║Executed virtual command executeRoutine (319ms)
+793ms ║║Executed virtual command setVariable (5ms)
+862ms ║╚Execution stage complete. (483ms)
+893ms ╚Event processed successfully (893ms)
5/4/2017, 4:51:27 PM +897ms
+1ms ╔Received event [Home].alarmSystemStatus = away with a delay of 43ms
+390ms ║Piston waited at a semaphore for 263ms
+391ms ║Runtime successfully initialized (v0.1.09e.20170503) (389ms)
+392ms ║╔Execution stage started
+836ms ║║Executed virtual command executeRoutine (355ms)
+851ms ║║Executed virtual command setVariable (3ms)
+932ms ║╚Execution stage complete. (541ms)
+970ms ╚Event processed successfully (969ms)
5/4/2017, 4:51:27 PM +242ms
+0ms ╔Received event [Home].alarmSystemStatus = away with a delay of 54ms
+412ms ║Piston waited at a semaphore for 267ms
+413ms ║Runtime successfully initialized (v0.1.09e.20170503) (411ms)
+414ms ║╔Execution stage started
+636ms ║║Executed virtual command executeRoutine (135ms)
+647ms ║║Executed virtual command setVariable (4ms)
+737ms ║╚Execution stage complete. (323ms)
+783ms ╚Event processed successfully (783ms)
5/4/2017, 4:51:26 PM +529ms
+1ms ╔Received event [Home].alarmSystemStatus = away with a delay of 161ms
+408ms ║Piston waited at a semaphore for 267ms
+410ms ║Runtime successfully initialized (v0.1.09e.20170503) (407ms)
+412ms ║╔Execution stage started
+683ms ║║Executed virtual command executeRoutine (153ms)
+696ms ║║Executed virtual command setVariable (5ms)
+776ms ║╚Execution stage complete. (364ms)
+821ms ╚Event processed successfully (820ms)
5/4/2017, 4:51:25 PM +771ms
+1ms ╔Received event [Home].alarmSystemStatus = away with a delay of 39ms
+382ms ║Piston waited at a semaphore for 263ms
+383ms ║Runtime successfully initialized (v0.1.09e.20170503) (380ms)
+384ms ║╔Execution stage started
+634ms ║║Executed virtual command executeRoutine (178ms)
+650ms ║║Executed virtual command setVariable (4ms)
+732ms ║╚Execution stage complete. (349ms)
+761ms ╚Event processed successfully (760ms)
5/4/2017, 4:51:25 PM +423ms
+2ms ╔Received event [Jim White’s Android].presence = not present with a delay of 128ms
+97ms ║Runtime successfully initialized (v0.1.09e.20170503) (95ms)
+98ms ║╔Execution stage started
+366ms ║║Executed virtual command executeRoutine (196ms)
+387ms ║║Executed virtual command setVariable (4ms)
+447ms ║╚Execution stage complete. (350ms)
+473ms ╚Event processed successfully (473ms)

Continuation of my previous post. The first part of the piston which disarms the alarm when either my wife or I arrive. If we happen to arrive within a few seconds of each other, which occurs due to the location not being precise on both our phones, I used the variable to prevent the piston from executing twice. And that works ok. The problem is if we set the alarm from another method then the variable doesn’t get changed. Any ideas on some other way to write this piston?

I could tell you how to fix it but I want you to figure it out yourself, so here’s a hint:

Without looking at the piston, figure out which events are the important ones, which events you are REALLY expecting. Make note of them, then look at the piston and look for all the orange bolts. Do they match your requirements?

Second hint: you can inhibit unwanted events in two ways:

  1. convert the important events to triggers, leaving the unwanted ones as conditions
  2. leave them all conditions but alter the Subscription method for the conditions you do not want to subscribe to events, by setting it to Never subscribe.

Let me know if tou figured it out.

I haven’t had a chance to convert this to WCORE, but here is one that has worked flawlessly for months for us…

How exact does the phrasing have to be with that? I.e. can you say “run the sleep routine” or “run sleep routine” and it will resolve the same? I will be able to remember exact but worry it will frustrate the wife. With the just switches it seems to be I can say “Turn off master bedroom” and my wife can say " Turn off the master bedroom light" and both resolve ok.

Then again I am the only one who will thing to run this routine so maybe in the end it doesn’t matter lol.

I currently have CoRE (not new super CoRE) set to turn my thermostat to a home, but not occupied, program when it doesn’t detect motion for 15 minutes upstairs. Then if it detects motion it will resume the regular home program. Seems to be working well, but my issue is people frequently run upstairs to get something and run back down so only upstairs for a few min. I would like to add a delay to the resume that requires multiple motion events to occur before it decides to resume and new super CoRE seems much easier to code this in.

I haven’t exactly figured out the logic so looking for ideas and then likely coding advice since I haven’t used variables yet and my hunch says going to need that. My thought is something like if there is motion for 3 minutes then resume but the problem is it is quite likely that it may not be continuous motion so there will be brief time outs of no motion. I had also thought of some # of motion events within a period but not sure if continuous motion shows as multiple motion events or just one on.Also feels like I am over thinking this and maybe there is a more elegant solution than tracking series of events with variables.

Does below piston look ok? Not tried testing it yet as at work. Tried to base it on the ‘doggy door’ piston I saw on an old CoRE thread

Use case

Open door and lights go on. If weather band I want to shut door and lights to stay on as I do whatever outside. Then open door to come back in and when it closes once im in for lights to go off

If weather nice then i normally keep door open, do whatever outside then come back in close door and lights to go off

Why wouldn’t you want the Turn Off to happen even if you were no longer home? I’d remove the condition on lines 28 and 29 so if you leave during that 10 minutes, the lights will still turn off.

How do I say when a motion sensor is active, turn this on. When it has been inactive for 2 minutes, turn this off.

@c1arkbar he’s all yours

3 Likes

Go to the wiki and check out the samples page

Ugh, I was just coming back to post that I was an idiot.

When I get a window contact sensor open event is there a way to get the room that sensor is in (as set up in the SmartThings app)? Then, using the room can I get the motion sensor in that room (if any) and see if it is reporting active or not?

The idea is to determine if the window is being opened from the inside which could mean it is being opened for fresh air as opposed to being opened from the outside which could mean the beginning of a break-in.

In my theoretical mind there is a solution. Add all your contact sensors. Have it set to if any changes to open. Then using a switch statement with $currentEventDevice as the switch. You can add cases. The cases would be the names of all your contact sensors in the initial IF. Then for the actions of each case you can have an if Motion is not active then alert me.

ST does not currently share the room along with the devices, so no, not at the moment

Thank you @c1arkbar and @ady624. I was hoping to avoid hard coding this.

BTW, Dustin mentioned $currentEventDevice which reminded me to ask where is the list of all these variables that webCoRE can use?

BTW 2: Thank you very much for CoRE and now webCoRE. I was just getting my feet wet with CoRE so I do not have many pistons to port to webCoRE. Which also means I’m still learning it all.

Do you add the room name to the device name like I do? I.e. Living Room Motion Sensor?