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

I use the SHM as a lazy alarm. Gives me alerts when something happens. I only use webcore to update the status of my smartthings envrionment so I have to turn this off when home or away when gone.

I am not sure I understand what you are asking if you are referencing something in my piston? I have no triggers in there. Everything is a condition. So since I have no triggers all my conditions are subscribed and listen for events.

If you are just in general asking about mixing them then yes. If you have a trigger with conditions then only the trigger will receive events. You could force a subscription to your conditions but it would not make a difference because the trigger would never happen at the same time as the condition. All that is considering both the trigger and condition are part of the same if block.

You can have a trigger in one if block and just conditions in another if block and make that work but you will have to subscribe to that condition probably. If you do that then your condition only block will execute.

I dont why the icon wont change for you. You can change the icon in the code yourself though. It is well documented here: http://docs.smartthings.com/en/latest/device-type-developers-guide/tiles-metadata.html

Here is som icons aswell:
http://scripts.3dgo.net/smartthings/icons/

Hey guys – I created a piston to do the following: At night, turn on the light when motion is detected, and then turn off the light 30 secs after motion stops. Unless the light was already on, in which case, do not do anything.

I have two questions:

  • Is this the best way to structure the piston, or is there a more elegant/shorter way to accomplish what I’m trying to do?
  • The way I’ve have structured the conditions – the piston will keep getting unnecessary motion events throughout the day, which seems wasteful. The piston only needs to be subscribed to motion at night, and sleep throughout the day. Can I do that? Or do you think that’s over-optimization?

You can set your time restriction above execute. That will restrict the whole piston. But it doesn’t really hurt anything the way it is. The ole saying: “If it works…”. You might want to async your else with statement if you want your 30 sec timer to reset with new motion within that 30 sec, but if, that is the way you want it to work.

I’m having the same issue using Chrome on Android. Have to register every time and also I can’t edit any pistons.

Can anyone tell me what I am doing wrong with formatting?
format(‘Temperature is %.2f’,[Temp])

I am trying to output the Variable “Temp” and I keep getting the following error:
Invalid parameters. Expecting sprintf(format, arguments)

The Variable Temp is a local Variable that is populated with a Temperature.

Jeff – Thanks for your reply! I tried moving the time restriction to the top-level “only when”. But that doesn’t change much; the piston still subscribes to the motion event, receives it, and then immediately terminates execution because of the time restriction. But yes, I agree about “If it works…”, especially if further optimization will make it overly complicated :slight_smile:

I notice mine are showing up blank. And no editing.

1 Like

Despite adding that (resume) it happened again. In my case Spotify-playing-thru-Alexa Dot-connected line-in on my (older) ZP100 Sonos amp. (vs. selecting Spotify & playing direct from using just the Sonos app. prior to the speech msg. triggering as set up in the piston). I’ll have to try things again without using line-in/Dot to see if the music tream resumes playback.

Thanks, I’ll take a look. Note that I am able to change the icon - it just changes back to the original default when one leaves the settings after changing the time.

Looks like something has changed with the last webCoRE update. After the update, the time the change is made in respect in the settings of the Tile, is used as the execution time, instead of the time set in the DH.
I changed my DTH back to your original “Z-Wave Metering Switch With Timer” with the same result.
Are you also seeing this?

Yes it broke for me aswell after latest update, trying to figure it out.

1 Like

anyone using webcore with a HEM reading each clamp power separately? i have one (of the many) HEM DHs showing power for each clamp separately, but in webcore it doesn’t seem to have a way to pick clamp 1 or clamp 2.

If your ELSE you may be able to add a “AND light is ON” to prevent it from going through the OFF logic and “wait” each time when its already off.

My favorite approach to lights on/off based on motion is different. I like to say If motion changes to active then turn on lights, then in a separate IF block I have the logic to turn the lights back off “If motion stays inactive for x minutes then turn off”. In your case, however, I believe it is made a bit more complicated because of your requirement not to take action if the light was already on, hence your variable/flag. You may be able to combine the flag with my logic to keep things “tight” so that the events are not coming in left and right for no reason, as you are concerned with.

Yes I could, but then I would still need to add logic to set my flag to false – that part of the OFF logic still needs to be executed.

@ady624 feature request: UI support for reordering of define statements.

thank you.

3 Likes

Do you mean being able to drag and drop statements so that you can re-order the statements?
If so, you can do this already.

not statements, variables defined in the define block. thank you.

EDIT: also, global variables use random ordering all over the place. a sorted list would be much simpler for locating these variables, whether in drop down lists or in the EDIT UI and other places.

i have been modifying a piston someone had posted for battery check and notification. this line at line 32 gives an easy way to find what the minimum battery level is for my battery powered devices. any recommendation for the simplest way to find what the corresponding device name is for this minimum battery level that the min() statement returns?

thanks!

This is what I use. Runs once a week which I find adequate.

1 Like