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

@Savio here’s a simple example

Stupid me! Thank you.

Wait … does that mean you have it working? :slight_smile:

Not yet - will only be able to try it later today. Will let you know.

OK :thumbsup:

I had a few minutes so I quickly tried it. I set it up like this:

But it does not work:

(I cycled inputSwitch a few times)

here’s an example. i am using a regular screenshot so you can see the piston state when switch is on. when the switch changes to off the piston state shows blank. note in my example i use $now for time … you will need to change it to your time variable.

EDIT: try changing “state” to “switch” … i don’t remember why i typed state previously. for most devices switch should work.

mmm…now you mention it I do find that the speak text on its own seems to be a bit temperamental. Sometimes it works and other times it doesn’t. I’ll go back to using the restore/resume, however as pointed out, it does not resume whatever is currently playing.

Small things amuse small minds I suppose, but this is fantastic. Thanks @bangali, it works great.
I figured out the obvious to programmers i.e. that the second part will be the false result, so I done it like this:
(upper([inputSwitch : switch]) == ‘ON’ ? “Alarm is [blue|ON] (Set for [blue|{alarmTime}]. [green|{pistonDevice1}: {pistonDevice1OnTime}; {pistonDevice2}: {pistonDevice2OnTime}; {pistonDevice3}: {pistonDevice3OnTime}])” : “Alarm is [red|OFF]”)

Which, if ON, gives me:

And when OFF:

How would I configure the time-variable to change the way time is displayed? Currently it is displayed as 4:44:00 PM SAST, but I would like to display it in a simple 24hour format:16:44? Edit: I figured this one out - I had to use {$time24}

And do you know of a way to report in the Dashboard wich condition returned as false? I would like to add something like “Did not turn on {PistonDevice1} due to … e.g. Presence sensor not present or Temperature above threshold”.

Quick question about timer based pistons.

I have a timer based piston and when I started it I saw, briefly, a message that says “This piston does not subscribe to any events, it will never run on its own.”

I believe it has been running but maybe the piston its supposed to control has just been on continuously, now I’m not sure.

Is this message legit or just some sort of artifact? Example below.

Technically it is not subscribed to anything. It will just happen at the prescribed time. So it is kind of an artifact sprinkled with some truth. However as long as it has a next scheduled date/time then all is working as it should

@949BFN yep, join the club :wink: you are welcome. nicely done. yes, $time24 will work for current time.

yes. please post a snapshot of the current piston … will try to point to a relevant example for the piston.

I tried your piston, but it doesn’t change from away to not away. I modified it to use time restrictions, but I think they’re just a special case of conditions. I wish that someone could explain the reason why these don’t work but my 2 piston solution works.

Doesn’t work:


I think it has something to do with restricting by Mode vs restricting by time.


I’m having an issue with this piston I created, I’m hoping someone can guide me.

Basically me and my wife each have an arrival sensor in the car, and our phones. The phone is usually seen first, the arrival sensor can take up to 90 seconds to be seen. I basically want the code to detect if either sensor changes to present, run “I’m back” and send notification. The issue is that it does it when the phone shows up, then again 60-90 seconds later when the arrival sensor shows up.

I want it to run only once, for the first device that shows up.

So I tried two different if statements, the first one uses a variable to track the status, the second pauses the piston. The idea being when the 2 minute wait is up, both devices are present, therefore “changes to present” no longer applies.

I feel like the issue is with the “wait” command, seems to just run everything in sequence without actually waiting 2 minutes. I could be wrong.

Any thoughts,

Thank you.

on the with for the wait tasks block click on the cog at bottom of popup window and change Task Cancellation Policy to Never Cancel.

OR if you don’t want to use wait and variables change the those 2 ifs to this structure:

if {presence sensor 4 changes to present and presence sensor 2 is not present}
… OR
… {presence sensor 2 changes to present and presence sensor 4 is not present}

need to use if groups and this will not need any variable or wait.

1 Like

Giving it a shot, gonna test it out.

Thanks for the tip.

sure, you are welcome. see my edit to the original for how i usually structure these. but thats just a personal preference because i mostly avoid using waits and timers.

I like your method, seems cleaner, gonna try it out



Actually on second thought, I don’t think that would work in my situation, because sometimes the cars stay at home if we leave with someone else, or on foot, so the arrival sensors would remain present.

Your first tip seems to have worked though, gonna keep an eye on it.

Thanks again.

@ady624 posted a piston for garage door and SHM you may want to look at for some ideas
WebCore Help - Open Garage Door

@kraken glad that wait worked for you.

here’s what i use to allow for that. presence sensor 4 is the phone sensor and presence sensor 2 is the car sensor. 600000 = 10 min * 60 sec * 1000 ms. if the phone has been away for greater than 10 mins with the car still in driveway this will send the notification when the phone shows up. so, for me this works for - went walking OR left with the wife in her car OR friend gave me a ride.

if { presence sensor 4 changes to present AND
… { previousAge([presence sensor 4 : presence]) is greater than 600000 OR presence sensor 2 is not present }
… }
… OR
… { presence sensor 2 changes to present AND presence sensor 4 is not present }