CoRE and Piston Rules Engine, first design steps

Ok, back to the turkey… :smiley:

@eibyer and @ady624 Thanks for your response. Maybe I had too much Turkey. But I don’t see what you mentioned. I’m looking in IDE but can’t find anything to uninstall CoRE pistons :joy_cat:

Maybe I should also go back to the Turkey and eat more…
Thanks

Trying not to steal anybodies thunder as you are all eating your Turkey in the US.
IDE -> Locations.

Click on List SmartApps.

Click on edit.

Go to your SmartApp and uninstall it.
EDIT: Oh and then click on Done at the top of the page.

1 Like

US has Turkey on its plate today. Fair enough.

1 Like

Now I found it, Thanks…

Now I can enjoy Thanksgiving much more…:slight_smile:

Thanks, found it now and could uninstall. Thanks for the help! Never looked into this menu.

1 Like

Is there any way I can make my piston not run if it’s public holiday? I couldn’t find any such holiday information in capability list. Is there anything like that?

I need a bit of help. I’m looking to do something similar to the “Doggie Door”. Basically this.

If “Contact” “MB Door” changes to OPEN AND mode is “Night”, turn on the Upstairs Hall light for 5 minutes. When i open the door a second time i don’t want the upstairs hall light to come on again. Then done.

This allows somebody to come out the door and have light, but when they return i don’t need the rule kicking on again.

Use a latching piston or simply use a toggle…

IF
   Door changes to open
Using light...
   > Toggle

The issue is getting the “on first open” turn on the light. On second opening if the light is on, leave on. Then on second closing turn off the light.

I can’t figure out the multiple “When True” part from the examples. I

[https://sjc5.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/ady624/45/32610_1.png] ady624https://community.smartthings.com/users/ady624
November 29

Use a latching piston or simply use a toggle…

IF
Door changes to open
Using light…

If you need to turn off on every other close, latching is the way to go:

IF
   Door changes to open
   AND
   Light is off
THEN
   Using light...
      > Turn on

BUT IF
   Door changes to closed
   AND
   Light is on
THEN
   Using light...
      > Turn off

That’s amazingly simple.

Love it. Thank you so much.

[https://sjc5.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/ady624/45/32610_1.png] ady624https://community.smartthings.com/users/ady624
November 29

If you need to turn off on every other close, latching is the way to go:

IF
Door changes to open
AND
Light is off
THEN
Using light…
> Turn on

BUT IF
Door changes to closed
AND
Light is on
THEN
Using light…

I am trying to setup my third Piston but ran into trouble testing it. To me this piston should work fine, but it only runs the first step of the ‘then’ when the condition is met (set color temperature 6000). Any suggestions on how to flash the lights on and off twice, then set the color temp back to warm (2700) would be very appreciated.

Thank you.

Don’t use the delayed turn on/off - they don’t add wait time and cannot be cancelled. Besides, you can use flash… add a wait after the flash to wait the total flash time. Flash uses delayed ons and offs

Thank you. It’s doing exactly what I want now.

It turns on when door opens and turns off when door closes. However that makes sense. The BUT IF statement would run on every door close.

My other question is how to i make the “Then” a “When True”?

Oh sorry. Remove the two but if conditions, add a group with two conditions and a condition:

BUT IF
   (
      Light is on
      AND
      Door changes to open
   )
   FOLLOWED BY
   Door changes to closed
THEN
   Using light...
      > Turn off

Add the first group with the two conditions, then get out of it and add the last condition. After that tap the AND between the group and the condition and make it a FOLLOWED BY.

Let me know how that works :wink:

First let me say that CoRE has made my SmartThings hub actually usable. It is almost the only thing I use to drive the automation projects in the home. Without it I would be looking at a completely different solution and really appreciate all of the efforts.

One question… I have several 4 in 1 Zooz sensors that trigger lights based on motion. Part of the trigger is a variable that indicates whether or not the lights should come on at 100% or 20%. 100% is the normal routine and the 20% is essentially a night-lite / don’t sear my eyeballs when I’m half asleep and walking through the house level. A separate goodnight piston sets the variable to 1 for night-lite and a morning piston places it back to 0.

For some reason the variable seems to slow down the execution considerably. Without it the lights turn on within a second and with it it seems to take nearly 6 or 7. This may not be related to CoRE, could be a red herring, but I wanted to see if anyone else had a similar experience or if there is a better approach.

It may be that using @ variables slows things down as the parent app needs to run and save those variables. Taking a slightly different approach with webCoRE for this exact reason.

Why use a variable and not a location mode or time restriction on actions/tasks?

IF
   Kitchen motion changes to active
THEN
   Using Hallway Lights...
      > Set level to 100% (only for Home mode)
      > Set level to 25% (only for Night mode)
...

or using action time restrictions:

IF
   Kitchen motion changes to active
THEN
   Using Hallway Lights... 
      > Set level to 100%
   Using Hallway Lights... (only if time is between this and that) <<< set the TOS for this one to Local (not Action) - this will cancel the 100% of the above action
      > Set level to 25%

… or use a virtual switch, see if that makes it faster

2 Likes

This is how my kitchen lights work:

The piston won’t interfere with my lights if I turn them on manually (or via Alexa) - the lights will stay on until I turn them off myself. They also dim for 15 seconds before being turned off when the piston has control of the lights.

1 Like