CoRE - Get peer assistance here with setting up Pistons

hello and thank you for your help.

i finally got the piston running and im happy with the results. However,

as a recap i have a Home and Away piston which uses presence sensor(phone)
to alert me of somebody leaving and coming home.

with {presence sensor} as variable, i am able to get alerts when somebody leaves or arrives home, but everytime somebody else comes home or leaves, i get push notificiations that includes someone who has already left or at home.

for example:
for “is home” (Home)push notification:
“house occupant #1 is home” when house occupant #2 gets home, i get a push notification “house occupant #1, house occupant #2 is homel” and etc.

for “has left” (Away) notification:
“house occupant #1 has left” when house occupant #2 leavesm, i get a push notification “house occupant #1, house occupant #2 has left” and etc.

how do i refine my push notifications so that it does not included the house occupants that already at home or already has left?

thank you.

Switch the condition to a trigger. So instead of “is home”, make it “changes to Home”.

Edit: if you upload a picture of the piston from the dashboard view I can offer better assistance.

1 Like

I would create a piston with these settings:

IF
Any of these presence sensors changes
THEN
Using location send push message
SEND THIS MESSAGE
$device has $action at $time

This will send a push message every time a presence arrives and departs.

The message will be,

Susan has arrived/departed at 12:37 pm

1 Like

I’m pretty new to CoRE, and SmartThings in general. I do have a fairly generic question that I would like to get clarified. I’ve read a lot of comments on various outlets where people have “moved all of my automations into CoRE”. At the same time, I’ve already read that CoRE runs entirely in the cloud, not local on the hub, therefore is not reliable if the hub is offline.

So this begs the question, should CoRE be used ALWAYS… or am I more correct in understanding that CoRE serves a purpose, but so do smart apps that run natively on the ST hub? My approach, thus far, is see if I can do it with things like Smart Lighting. If not, then do it in CoRE.

1 Like

Hi all,

New to this forum and smartthings in general. I was able to download CoRE, but am having a hard time creating a piston for my application. The problem I was trying to solve was that I had a front door sensor that would turn on all lights when opened, but the problem is it would also on all lights when I leave the house as well (simple if sensor open turn on all lights).

To solve this I bought a motion sensor that I placed outside the door. The idea is that I want to create a strict/specific sequential process. That is, motion detected -> door sensor open -> turn on lights. Also if there reversed happened (door senor -> motion sensor) nothing would turn on, as that would mean I am leaving the house. Is this possible?

Your help on this would be greatly appreciated. Also, I apologize if this has been asked already.

Your approach is correct. If you can do things in apps that run locally, by all means, you should do it. If you’re dealing with complex scenarios that no local running app can achieve, or dealing with devices whose DTHs do not run locally, other apps, including CoRE, may be the answer.

2 Likes

This would best be accompolished outside of CoRE using routines and modes. Put your motion sensor inside . Set your “I’m leaving” routine to automatically run when your phone (or other presence sensor) is away and there is no motion, the leaving routine would then set its mode to “Away”. Then set your “I’m back” routine to trigger when the motion sensor detects motion and have it turn the mode to “Home”. Then setup a Smart Lighting app to turn on the necessary lights when the door contact is opened, but only when in Away mode.

This way, Away mode gets set when you leave your house. When you get back and open the door, it’ll be in “away” mode and the smart lighting app will turn your lights on. Other wise, as long as you are home and your motion detects motion inside, it won’t turn on the lights when the door is opened.

Hi Michael,

Thank you for response! The problem with a presence sensor is that I am in a high rise building, and when in the gym downstairs, for example, it still shows I am present. Not sure if that’s a setup issue…

Sure it worked this time as a simple time happens at x time turn on light. I’ll rebuild the Piston again with M-F at a fixed time… and see what happens

Thanks
Rick

Hello guys. I have a quick question. Is there any way to program a piston to get Sonos to play a certain track when motion is detected?
Thanks :slight_smile:

@macombweare
This but in order to get the correct output you would have to change $device to $currentEventDevice and $action to $currentEventValue.

I did notice that you are also using this piston to set your home and away mode. That logic wouldn’t fit into this scenario.

1 Like

Yeah… what he said… lol… it’s been a while since I played with the variables…

2 Likes

With the presence sensors not being an option, you could also just put the motion sensor so that it can see the entry to your. Set your “I’m Back” routine to set your mode to “Home” when it detects motion. Have the “I’m Leaving” routine to set your mode to “Away” when there is no motion. When you leave, it’ll set to Away. Then have the Smart Lighting app trigger when the door is opened, but only when its mode is “Away”. So when you are standing in the entry way, it’ll detect motion so it will be in Home mode. When you open the door to leave, the smart app will not trigger because its only supposed to run in “away”. You close the door and leave. A few seconds later, the motion will see motion has stopped, it’ll set itself to “Away”. You come back, open the door, it trips app to turn on the light, the motion sees your presence and turns the mode back to Home.

This is what im getting.

please ignore…just saw the previous post…making changes now…

thanks

and for $time?

sorry im not getting this. suggestions to make it better or work? thank you in advance.

This may be a dumb question, but I added a new SkyBell HD doorbell to Smartthings, but its not showing up in CoRE. Where would I need to go to update the devices that CoRE has access to?

So this works - mostly. Definitely better than what I had before. However… and I do not see the logic in this, but. Say I trigger this motion sensor, then I sit still for long enough that it runs through the 90 seconds and turns the light off. For some weird reason, triggering motion will not turn the light back on - at least not for a couple of minutes. Anyone have thoughts on this?

Here’s another one that is puzzling me.

I have a number of motion sensors and door sensors. When I run “goodnight” ST changes SHM to Armed/Stay mode - works as expected. However, there are times when I do not want to run “good morning”, like say I want to let the dog out. I created this piston to temporarily change the SHM status to Disabled while specific lights are on. Problem is, I am getting “false” alarms when I turn on one of these lights, then open a door. I believe the problem is in a delay between the piston changing the status and when the door gets opened. But should there be a delay? How long should I have to wait? Or is something wrong with my piston?