CoRE - Get peer assistance here with setting up Pistons

For sure, that makes sense… Wonderful, thanks for the help!

Alright. I have the dumb. I am trying to set up a piston that does the following:

If Presence (me) OR Presence (wife) Changes to: Present AND Time is between 5 minutes before sunset to 5 minutes after sunrise OR Luminance <=1000 Then Turn on Front Door Light, wait 5 minutes then turn off

Every which way I set this up, I can only do all OR, or all AND. What am I doing wrong?

Enable expert mode in settings if you have not done so yet and try it again.

I’ve had expert mode on the whole time… but I figured out what I was missing. I wasn’t starting off creating a group, leaving the initial conditions in the main conditions group, and that was screwing the whole thing up.

1 Like

I have a similar one for a carport light. I would scrap the sunset to sunrise, as it is usually dark then.


With this change for the presence…

I suppose I could rely on lux value only, but have it set up this way:

I would like to create a piston that uses a virtual momentary button to turn on the Sonos and play a certain playlist when I come home. I have setup my computer as a node server for the Sonos HTTP api and it works when I enter the http://localhost:5005/Kitchen/playlists/Acoustic Rock in my browser. I can’t seem to find any information on how to make this command work in ST and CoRE. Any help with this would be greatly appreciated.

In latest version, try the Make Web request task. Enter the URL there. Note: You cannot use https for local requests, they will be made as HTTP requests.

Am i right in thinking that looking at the screen shot the app (core is running commands) but then so is the device which then in tern seems to be overwritting the app commands? having issues with lights that has been used to set a scene via a different app ( manually )

Last night for some reason my backyard lights didn’t come on as usual. When I looked at the dashboard I noticed that had 01:03:42 past due at the top of the piston. How does this happen?

I tried this but nothing happened. Am I doing it correctly?

any access/error logs on the server listening on port 5005?

None that I can see. I setup a Virtual Momentary Button (Sonos Button). Then I have it call the web request at a certain time. It doesn’t seem like anything is happening. I have the web request setup like this:
URL: http://192.168.1.102:5005/Kitchen/playlist/Acoustic Rock
Method: Post
Content Type: JSON

Not sure if this is correct or if I have to use a different type of virtual switch? Also, can I have the space in between “Acoustic” and “Rock”?

If you open the link in the browser and it works, then it needs to be a GET, not a POST. Browsers do GET when address is typed in the address bar.

Ok I changed it to GET but still nothing happened.

Not sure if CoRE encodes the spaces in URL, give Acoustic%20Rock or Acoustic+Rock a try.

1 Like

Yes, that worked Acoustic%20Rock! You rock!

1 Like

Hey guys. First thanks for taking your time into helping others.
Second here is another alarm arm situation:
I would like to setup one piston that can handle triggering stay mode or away mode.
So if contacts 1,2,5 are off and motion 1,2 are inactive: for 2 hours then trigger stay.
For 10 hours: if presence sensors 1,2 are away then trigger away.

I would like to have this situation to be using the least memory and ressource as possible but still efficient.
Sorry if this has already asked and answered. I searched for days now for a concrete example.

Uhh, time to get URLs encoding properly :slight_smile: Thank you for pointing it out

2 Likes

Well, I would do a latching piston and setup Group Conditions. You have the concept in your description of what you want to do.

IF
Contacts 1 and 2 and 5 IS OFF
AND
Motion 1 and 2 is inactive
(When True
Wait 2 hours
Then Set Location Mode to Stay
Wait 10 Hours) - Cancel on State Change
OR
Both of Presence Sensor 1 and 2 are away
(When True
Set Location Mode to Away)

Something like this. Also have you looked at these? https://community.smartthings.com/t/share-core-show-tell-all-about-pistons/50255/12

1 Like