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

@mrmedia and @hikenbike this is the full piston. Ignore the first IF though - I can’t get it to work when we both arrive home together for it to speak hello to us both:

1 Like

Thanks! That looks to be exactly what I needed.

Firstly, thanks for all the hardwork and putting together WebCoRE.

I am curious as to why the UI doesn’t allow you to just type in code. Is there some reason behind this?

@Townsmcp change the first if to this … that should make it so it says hello to you both when you arrive together. the # 10 allows for 10 seconds for both of you arriving together.

1 Like

Someone please help!! I can’t figure out where I’m going wrong here. For some reason, I can’t get this to evaluate to anything but ‘true’. Driving me crazy!

PS. I can’t get enough of this thread and webCoRE in general. You all are freaking awesome.

should it be {{switchCounter}+1}

I think the counter is actually working… Even if the light is off, the $device switch eval returns true…

you defined your devices? Hard to tell to see with only part of your piston.

Sorry, I was trying to keep it simple. :slight_smile:

Is that inside a for-each loop? $device only works in there…

Yeah, I’m only using it inside that block.

Can you please update to latest version (few minutes ago)?

I saw a similar question to this earlier, with no response, so I am hoping I can get a response. When running a Piston via URL is there a way to pass a URL parm that you could then pull into your piston? For example:

https://graph-na04-useast2.api.smartthings.com/api/token/{numsandletters}/smartapps/installations/{numsandletters}/execute/:numsandletters:?dimlevel=25

Where dimlevel=25 is the URL key/value pair that I would like to use in my piston. Thanks in advance!

Updated to 0.2.0ce and no dice. Still evaluating to true. On a hunch, I turned off the light and tried the expression out in the ‘wizard’ and it evaluates to off. Am I using the correct operand?

Yes. Try logging $device to console, see which device gives you true?

Try logging $args - what you want should be $args.dimlevel

1 Like

That worked perfectly. I had just found “$args.params.{urlparm}”, but “$args.dimlevel” worked straight away. Thanks!

Thanks for pointing out and showing the ability of creating a device. In my case, I have two leak detectors - with the plan to add more sensors at a later time. A wet sensor triggers the main water valve shutoff as well as a push message to say which sensor has detected the leak. Before I knew about the ability to create a device like this, I ‘brute-forced’ the piston with two separate if’s that had extremely similar contents - except for the push message. Now, I have this:

Much cleaner and makes adding the additional sensors at a later date much easier.

1 Like

Here’s what I see when I log to console:

Thanks for the help. Should on be in double quotes?

Hi all, I am trying to use my bosch motion sensor to activate my lights to turn on, which it does. It has a 3 minute timer to detect new motion after it turns off. I was hoping to create a piston that would turn the lights off if there is not any motion detected in that time. For some reason the lights turn on but don’t turn off?

Any help greatly appreciated. Thanks!