CoRE - Get peer assistance here with setting up Pistons

I’ve done some automations and I’m about to build something bigger in core than anything I’ve done yet. Ive written the pseudocode, and I need some peer review before I start plugging it in. If somebody wouldnt mind, I’d love it if someone would look my logic over, and make suggestions for piston types and if something should be done differently.

I have it conceptualized as 4 pistons. One for opening/closing windows, one for windows open/closed, one for turning on the house fan automatically, and one for turning it off. These are done separately because of the potential for manual fan activations by physical switch.

If outside 66-76, rain off, humidity<60%, windows closed
Push "open windows"
But if outside not 58-80, humidity>60%, rain on, windows open
Push “close windows”

If outside 68-74 but not inside and windows open
Then housefan on.

If Windows open, thermostat off.
Else housefan OFF, thermostat on.

If housefan on for 45 min, housefan off.

What do you think?

I’d like to do something kind of similar, though not managing a house fan. I already have GreenThermostat set up to turn off my thermostat when the windows are open for more than a couple minutes. What I would like to do is to get my phone to prompt me to open or close the windows based on the indoor / outdoor temperature.

Do you know where you would be getting the outside temperature from? Do you have a weather station, or is there already something in ST that can provide temperature?

Yes, there is a smart weather tile 2.0 or something smartapp you can install. You can find it on these forums. It pulls weather information from weather underground. Once you install it it gives you all that temperature data. I have the window notifications and thermostat on/off currently automated in rule manager so I have to delete them and redo it with all the rest of this in core.

Can anyone tell me why (in this instance) Happens At does not work? I changed it to after Midnight and it told me the next scheduled event was tomorrow as it should be.

Ummm… is it because it’s not Sep 3rd 2016 yet? Kidding, will look at it tonight.

BTW, what version are you on? Important detail…

I have this exact thing set up…

Here are instructions for the tile.

But you have to instruct it to refresh or it waits for you to manually push the refresh button. This is what I went with for that.

My set up for the reminder was when the outside temp was equal to the inside to remind me to shut them.
I also use this tile for outdoor lux ratings of 1000 or lower to turn on some lights inside the house.

Version of Core?

Edit: I have now updated to v0.2.145.20160822

And no rush on it. As I said, changing it to After Midnight seemed to return the expected result. I just wondered if I was interpreting the Happens At incorrectly.


Still new to this, but how do you get the “Trigger happens every 5 minutes”?

Under the conditions there is a date/time section. Scroll down through there and there is a wait condition and you can then specify how many minutes/seconds you want to wait before running it again.

So I like others on here am using Zoneminder as my NVR for my cams. What I would like to do is be able to make the web call to zoneminder and tell it hey put ZM into this mode. I tried to use the web request feature in core but I think that its attempting to make an external call where my ZM is only open to my LAN for obvious reasons :slight_smile: So first off is there a way to tell Core that this should be a hub call? 2nd how do I just tell it to hit a URL I was using the GET method but it still requires a variable.

Thank you all for your help with this in advance. And sure I could open up my ZM to the world, and I would if I knew all of ST subnets and I could just limit my FW down to their subs but I’d rather just keep it in house.

1 Like

Thank you very much, just tried it, perfect.

If you or anyone else dont mind, I have one more task I cant seem to get right.

I try making a piston for my livingroom lights.

If illuminance is less then 10 and Apple TV harmony activity is off

Then turn on spot 1 and spot 2
Fade from 1% til 50% in 120 sec

But If
Illuminance is greater then 10
Turn off spot 1 and 2

And If I start Apple TV activity from harmony either while the 2 spots are fading or not, it should turn off spot 1 & 2 right away or fade out to off

I would appreciate it, cause it didnt work straight forward like that.

If i try starting activity the spots blinking and fading in / out, and wont turn off.

Thanks in advance y

Trying to build in a debounce on a switch. I am trying to improve on the Mood Cube interface by building in a delay from start of motion until the start of an action. (The not moving is a 12 second delay, a little long for the application.)

I want to do:

If (motion) {
wait 3 seconds
If Position == “Up” {thing one}
else if Position == “Down” {thing two}
else if Position == "Right {thing3}

Is this possible in CoRE?

Yep. Enable expert mode and use individual actions in a basic piston. Add the stay trigger, then add a group. Change the AND between the stay trigger and the group by tapping on it. Select THEN IF.

   Motion stays active for 3 seconds
      Orientation is up >>> when true > do something
      ELSE IF
      Orientation is down >>> when true > do something else
      ELSE IF
1 Like

It only gives me minutes. What am I missing?

Okay, I need to add seconds then :wink:


Thanks. Just trying to debounce the sensor. perhaps the code you use in the wait could be recycled here. (Number, units)

I’m having a problem understanding the groups and how to set them up properly. I end up getting lost when I get a couple groups deep.

Here is what I want to accomplish:
If Garage Door is open
Fan Off
Wait 3 Min
Garage Thermostat Off
Else IF
If Garage Door is closed
(Garage Temp is less than 35F
Then 
Set Garage Thermostat to Heat
Wait 10 Seconds
Set Garage Thermostat setpoint to 40F
Fan On)
(Garage Temp is greater than or equal to 40F

Set Garage Thermostat to Heat
Wait 10 Seconds
Set Garage Thermostat setpoint to 35F
Fan Off)
Here is what I have so far.

Can anyone help me fix this to accomplish the above?

I have this piston written which is designed to activate by 2 methods, one is a virtual switch, one is a physical switch… and the piston keeps them tied together. I put a notification in the piston and it sends it twice. I imagine thats because its activating the piston for the one switch first, then as it flips the other, reactivates itself again.

I also have a need for a condition I want to be true only when at least 3 windows are open. Is that going to require introducing special variables?

Well, first thing you have to do is upload a picture of the piston you already have.

Yes, sorry here it is

So its a whole house fan I’ve automated, but, I want to be sure that there is sufficient ventillation so the fan doesnt kick in when its not wise, for example, if one sensor is stuck and not actually closed, or one bedroom window is open but the door is closed. I feel as though “at least x” and in my case x would be 3, should be a simpler thing for me to do. Alas. If you have any ideas!