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

Here’s my version of @ady624’s original text > ifttt > media player. The piston is just a partial part of it, I have keywords in the beginning of the text message (ALL in this example) which tells the piston where to play the message to.

Thank you for this and does your results match wunderground.com


I am trying to create a piston which checks the state of the device whether it has been changed in the past based on time. For some reason the below switch gets turned on before 5 mins even though the state of the device was changed less than 5 mins. I have tried STATUS as well but that did not work either.

This is not evaluating correctly and I cannot figure out why. I have been looking at it for two days.

($time24 > time(‘0:00’) & $time24 < time(‘12:00’) ? ‘1’ : ($time24 > time(‘12:00’) & $time24 < time(‘18:00’) ? ‘2’ : ($time24 > time(‘18:00’) & $time24 < time(‘21:00’)? ‘3’ : ($time24 > time(‘21:00’) & $time24 < time(‘23:59’) ? ‘4’ : ‘false’))))

EDIT: Ah. Found it. Time is not needed in the operand.

EDIT: Not so fixed as I thought it was. It was evaluating fine, and then it stopped. Not sure what I broke. So, I’ve simplified it. Anyone have any ideas?

($time24 > (‘00:00’) & $time24 < (‘12:00’) ? ‘1’ : ($time24 > (‘21:00’) & $time24 < (‘23:59’) ? ‘4’ : ‘false’))

^^^ always evaluates as false.


I would recommend that you read $args.content in a local variable, local variables are faster than composite variables.

1 Like

I remember you mentioned it in another thread, time to revisit this piston, last edit was 6/1 :slight_smile:

@Kanishk_Singh try this. and before you ask i dont actually know what checkInterval is used for :slight_smile: but age( ) works well and returns milliseconds.

EDIT: in the age statement Outdoor Holiday Light is the same as Switch 6


Well I am not too far from where my zip code shows on a map. It’s maybe a few miles from me. Even though there is a few weather stations actually closer to my physical address. But since it’s based on zip code it could vary greatly

@bangali Thanks a lot, that worked!

Ditto the request. I can’t figure out how to ping an ip address (much less evaluate the response) in webCoRE.

At this point, neither can it. The option to ping a device with a known IP address seems to lack the ability to evaluate the response. And I have thus far been unable to determine how to save the ping response into a variable.

EDIT: If you don’t need the ping time and instead only want to see if the hub is online, then that could be accomplished by checking the state of a Thing and checking the power state of the hub, and having those values recorded to a variable along with the time. Have the piston evaluate the difference between time($now) and the time recorded in the variable, and if it exceeds your tolerance, have it do something that does not rely upon the hub being online,

1 Like

you are welcome.

@eibyer @ady624 @c1arkbar

You guys are Awesome! Got it to work! Thank you!

@ady624 - I just updated the Smart app (all files of it) through the repo and now i have this warning popping up each time. Any way to fix this?

WARNING: Results may be unreliable because the parent app’s version (v0.2.0e0.20170726) is newer than the child app’s version (v0.2.0db.20170717). Please consider updating both apps to the same version.

is there a way to use a specific SMS response as a trigger?

IE: Trash day reminder

Daily at 12:01 am
Set variable {trash_day} to false

Daily at 12:02 am
if monday or thursday set variable {trash_day} to true

At 11am:
if {trash_day}=true, send text "Today is trash day, did you take out the trash? Test (ifttt recipe) Y or N.

wait 1 hr.
if {trash_day}=true, send text "Today is trash day, did you take out the trash? Test (ifttt recipe) Y or N.
if variable {trash_day}=true, send text "Today is trash day, did you take out the trash? Test (ifttt recipe) Y or N.

IF IFTTT message = “Y” then set variable {trash_day} to false
IF IFTTT message = “N” do nothing

Possibly but you need a wake word of some sort, before the Y\N reply so your piston knows what to do with the text it receives from ifttt.

On second thought, maybe that’s not needed. Hmm bed time.

1 Like

Ive tried testing it just like you did… I’m convinced that I’m dealing with the weather api from hell, or I’m in the twilight zone. Unless I wrote expression wrong, its just pulling up 0 for the max after I tried wrapping it in the integer.

It looks correct to me. I think you are in the twilight zone my friend. You are up to date on everything?

You put everything inside an integer - that is wrong, each item needs to be inside its own integer()

When updating you need to update all 4 files

edit: https://wiki.webcore.co/webCoRE#Updating_webCoRE

And Publish - publish is required

1 Like