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

Cool thanks. Since the batteries last for several months, I guess I’ll just see how it goes. Thanks for sharing your code!

Having an issue with the following piston. The first IF statement works fine but the second does not. Basically I want my Sonos system to speak “Welcome home Dan” as soon as the front door is seen to close.

The “if” has {DanisHome} is true as a check and right before this gets checked you have Set variable {DanisHome} = false. So it will never run.

This too… lol

1 Like

Try putting the second part in its own ‘If’ statement.

Can anyone tell me if I did this correctly? I had three seperate pistons in CoRe and am trying to combine them into one. I want the system to be in an away mode if the first two conditions are met. However, if those arent met I want it to evaluate the conditions below until it finds one that is supposed to run.

Thanks all for your advice. The reason for setting the {$DanisHome} to true and then 10 mins later setting it too false, is to ensure that when I come in through the front door the message will only be played within the first 10 mins of arriving home. Once the welcome home message has been played {$DanisHome} will be set to false.

Not sure why I can’t have another IF statement within an IF statement. Is this because for the second IF statement to be triggered the conditions have to be satisfied at the same time as the conditions being satisfied for the first IF statement?

Yes, I’m using the latest version. Updated just yesterday. I did restore the piston from a backup code. Could this maybe have something to do with me not getting the warning? I’ll create one from scratch and see if I get the warning. By the way, I have made it a separate IF statement and it now works.

Thought it would. I have a couple like that.

Robin, I have created another piston from scratch and I don’t get the orange warning banner. Do you get the warning only when you are in edit?

That’s what I did on my previous example and I didn’t get a warning. Anyway, I’ve learnt my lesson now so thanks again.

Can anyone point me in the right direction for calling another piston with passing in local variables? I see that I can address the args variable in the called piston, but I don’t see how to parse those ‘args’. For example, I would like to pass in a device and two integer variables and want to know how to parse the args in the called piston to get those values.

I’m having difficulty transitioning a CoRE piston to webCoRE - one that notifies me if a contact is open, but stops the notification if the door contact closes.

The latching CoRE piston is below. I’ve used “cancel all pending local tasks” to end the piston if the contact changes. (I just noticed I have a TCP in there too. Is that even needed?") It’s not elegant, but it seems to get the job done.

And here’s the webCoRE duplicate. I can’t find the cancel pending local tasks in the edit actions section. Would appreciate any assistance!

you adjust your cansels on the first If an With.
You find all kinds of options there. Push the cog.

I’m trying to convert a CoRE piston to a webCoRE piston but I need some help. In my CoRE piston, I save the dimmer level and switch state of six Philips Hue White lights before turning them all ON to 100%. Then later in the piston, I restore them all to their original dimmer levels and switch states. Here are the CoRE commands used to store the state of all six lights at once:

Using light1, light2, light3, light4, light5, light6...
> Refresh
> Capture state of attributes [level, switch] to local store

And then later in the piston, here are the CoRE commands used to restore the state of all six lights at once:

Using light1, light2, light3, light4, light5, light6...
> Restore state of attributes [level] from local store
> Restore state of attributes [switch] from local store

Can someone tell me how to do this in webCoRE? Is my only option to setup variables for each individual light and store them each individually?

Lisa, a change of strategy may be required. Use a while loop:

while
   Door is open
do
   Wait 5 minutes;
   Send notification "door is open";
end with;
Send notification "door is now closed";
1 Like

That is perhaps the last missing task pair in webCoRE. I will look into having those implemented.

1 Like

Any examples of how to use text color and other formatting when setting custom piston state?

Thanks!

When you pick the Execute piston task, enter the local variable you want to pass in the Arguments field.

1 Like

https://wiki.webcore.co/Piston_State

Thanks @eibyer