CoRE - Get peer assistance here with setting up Pistons

Just changed it to this and it worked. But now I’m not sure if it’s from the TCP in the original statement or the BUT IF I just added…

Basically the same logic as the if/then/else. Looks like it should be what you want. You’re basically using the But If as an else since your But If is just the inverse of your If.

Exactly. I was just too lazy to redo everything through a If/Then/Else. Thanks for the help!

1 Like

You’ll just need to add the “Followup with Piston Name Here after X minutes” in your last task to make it reevaluate your piston. Something similar to below:

IF
Garage motion stays inactive for at least 5 minutes
AND
Garage door is open
Using location...
  > Send SMS to XXX Text message here
  > Followup with Piston Name Here after X minutes
1 Like

I’ll give that a shot, thanks. Not at home right now so can’t test it till tonight. haha.

1 Like

Nope, I have the motion sensed areas under control.

I’m thinking this might just need a long string of “or-ifs”?

Hmm, so this is what you use the “Followup with Piston” for! Even easier! So no need to set Cancel on Piston State Change because after the Followup and if it evaluates as false then it automatically cancels?

I learn so much from just reading other peoples post. I love this forum!

Thanks!

Ah, yes, forgot that one minor detail! Thank you, I hope @chadbaldwin sees your post.

1 Like

It might work :slight_smile:

eibyer helped me out with a simple piston to control light/fan in bathroom. Turns on for 20 minutes and then turns off. unless in night mode, then just 1 light comes on at 10 percent then turns off.

Ok, that all works great! (Thanks eibyer) but now on to the Spousal acceptance factor.
How would I go about making it so that the piston would remember the state of the fan?

example. Walk into bathroom, fan and lights come on. I don’t want the fan on because I am doing my makeup (ok my wife is doing her makeup) she turns off the fan, but then motion detector detects motion and turns the fan on again.

What I would like to happen is this, lights and fan come on, you turn off fan, fan stays off untill the lights go out (you have left room for 20 minutes). then when it detects motion (person enters bathroom later) the lights and fan come on again.

This is what I have so far, (once again thanks eibyer)

IF
Motion changes to active (only home, away)
Using light

Set level 100 (cancel on piston state change)
Turn on
Wait 20 mins
Turn off
Using fan
Turn on (cancel on piston state change)
Wait 20 mins
Turn off

BUT IF
Motion changes to active (only night)
Using light

Set level 10 (cancel on piston state change)
Turn on
Wait 10 mins
Turn off

Is there anyway to turn on a mode with core? So for example if kodi and light are turned off then change mode to home

Hadn’t seen if anyone replied to this yet but wanted to let you know this is possible but from what I can see outside of CoRE. There is an app in the marketplace under lighting called double tap that can do this very thing.

You’re welcome :slight_smile:

There sure is. I have a bunch of these setup.
-Rob

How do you pull in accuweather? What all variables are available?

Can someone help

I would like to do this: if my harmony hub turns on activity A, turn on my WeMo switch and if the activity stops turn off the WeMo switch.

I don’t see how to call up the activity in CoRE

Brian,

You need to add the AccuWeather SmartApp.

Automation > SmartApps > Add a SmartApp > Climate Control > AccuWeather Connect

From there you can configure it to your location.
I have no idea all the variables. I just use it for the temperature and humidity.

Regards,
-Rob

Can anyone provide some assistance with my while loop logic? This is my second piston and new to ST’s as of 2 weeks ago. When I dont include the “loop end - 5 seconds (or 30 seconds)”, the while loop only executes once, and I get the following error:

“977ed02e-9009-453b-a0be-9b027c005f1b 2:21:42 AM: error ║║░░ ERROR: An error occurred while processing event physicalgraph.app.EventWrapper@39d66776: java.lang.NullPointerException: Cannot get property ‘action’ on null object @ line 5784”

When I do include the “loop end - 5 seconds”, I get an error, " error java.util.concurrent.TimeoutException: Execution time exceeded 20 app execution seconds: 126619633423991 @ line 1891" and the piston seems to do nothing or fire any of my push notifications. I’m sure there is a simpler way to do what I am trying to do, but would love it to work the way I designed it…

Update: I gave up on the while and for loops. It appears that the SmartThings API (I believe) prevents code from running longer than 20 seconds. Guessing if I did my while loop within 20 seconds it would work. Ended up switching to follow up piston, but dont like that it makes the loop more complex.

Right after I posted this, I saw two posts later you should how to get the app. Thanks.

How do you get CoRE to use it as a trigger?