CoRE - Get peer assistance here with setting up Pistons

I am building the same thing in a piston, I still have VLD up and running, and the piston disabled for now.

I have mine set to sunset-60 to midnight, and mode home or away.

I will need to add the wait random before shutoff as well, this is a good start.

I can’t use the else action though, otherwise when it’s not between sunset/midnight and mode/home away I think it will turn off my lights!

Yeah, that random wait after midnight will make it more convincing as the light show doesn’t always end exactly at midnight. Cinderella can stay late.

I’m trying to do a similar piston for lighting when away for evening or on holiday

When on holiday the piston can be similar to above, but if we’re only out for evening and come back before the ‘end’ time. How would i do it so when we return home, selected lights stay on, if on, or switch on, if off, (i.e. entrance hall) and all other selected lights switch off. Would then need to revert back to other light control pistons??

I use Holiday modes(day,evening & night) and Away modes(day,evening) and Home modes (day, evening, night)

The piston below is not yet finished. You can ignore the variables as I was playing around with trying to get more randomness into the piston.

This is what i have so far. I was going to put a ‘when true’ section under each of the 3 groups with 3 different lighting schedules to add more randomness. I just cant get my head around the else section as would it affect pistons I already have set up for light control.

Do i need to switch on ‘only execute on piston state change’ for the else action?

I’ve gotten myself all messed up here, so looking for input on the best way to do something simple.

My living room lights. I want them to turn on…

  1. Whenever mode changes to home or disarm, if lux is less than 50
  2. If lux dips below 50, only if mode is home or disarm

I originally had set up like

If illumanance < 50

AND

Mode is one of Home, Disarm

turn on the lights…

But I was getting kind of odd results with lights seeming to turn on based on only one of those requirements. Suggestions on the best way? Thanks!

IMO

If
Lux is less than 50 (Condition, make sure this is not a trigger)

 Then 
     Turn on the lights (Restricted to modes Home or Disarm)

Condition is the empty circle, correct?

This is what I’d changed my piston to yesterday, thinking I was getting all smart. This morning when I woke up and mode switched from Night to Home… the lights did not come on. I waited about a minute to see if they were slow and finally turned them on myself.

SO this way works great for the light level, restricted to proper mode… but doesn’t manage the mode part it doesn;t seem

Yes Condition is the empty circle. I would troubleshoot why it didn’t work, or see if anyone else sees a flaw with the logic. From my perspective, it should work.

Won’t work. mode restrictions do not subscribe to mode changes.

IF
   Lux is less than 50 lux
   AND
   Mode is one of Home or Disarm
THEN
   Using lights...
      Turn on

This should work. It should turn the light on when both conditions are met, regardless of which one just became true.

Thanks. That was where I started… and now I forget why I felt the need to tinker. Something wasn’t working right, but it could have been system related. I’ll roll back to that method and watch the performance.

Thanks!

1 Like

You may also want to enable “execute on piston state change only” so that if you turn off the light yourself, it would only turn back on if the condition would bounce through false first. Maybe this was your problem? You want the light on when the condition becomes true, not while it is (lux will be reported every now and then, causing the light to turn on if you turned it off yourself)

1 Like

I’ll give that a try and keep an eye on the lights!

Can someone enlighten me why this doesn’t work?

Do a time changes to trigger maybe instead of the “is” statements? Like this:

This is how I’ve done my thermostats and I’ve no problems at all.

Will give this a shot. I’m just surprised mine doesn’t work the way I had it since I have a similar piston that controls my porch lights flawlessly.

Hello everyone!

I just installed CoRE and I intend to switch to it from Rule Machine.

To do so, I would like some help, since when I tried to set the pistons myself, they did not work as intended.

Here is what I want to do:

  1. I want all my lights to turn on to the level of 1% on sunset and stay that way until 08:30pm.

  2. When someone arrives (mobile presence sensor), a piston should capture the state of all the lamps and then dim them to the level of 100% for the period of 10 minutes. After that, the piston should restore them to their previous state.

This should happen from sunset to sunrise, meaning that after 08:30pm, the lights will go from off to on (100%), and then back to off.

Here’s something that I need to avoid (In the Rule Machine, I used a virtual override switch to keep it fro happening), let me explain:

2 people get home at the same time: first people makes the rule run, thus making the lights dim from 1% to 100%, this happens by checking the previous state then running full power 100% for 10 minutes and returning it to 1% at the end.

Since a second person arrived at the same time (same car), the second person makes the rule run again, but this time, it makes the light dim from 100% to 100%, because, when it captures the previous light states, those are already at 100%.

Any help is much appreciated.

This is what I had in Rule Machine, the user bamarayne, helped me a great deal:

Rule one: lights on at sunset
Condition - time between sunset and 10pm
Rule - time between sunset and 10pm
Actions for true: dim corridor lights: 10%

Rule two: capture/restore lights
Condition - private Boolean: this rule: false
Rule - private Boolean: this rule: false
Action for true - Capture: corridor lights, Set private Boolean: rule three: false
Actions for false - restore captured bulbs, set private Boolean: rule three: true, turn off the virtual override switch

Rule three: arrival lights
Conditions - private Boolean: this rule: false
Rule - private Boolean: this rule: false
Actions for true - dim corridor lights: 99%, set private Boolean: rule two: true - delay 10 minutes
Actions for false - leave blank

Rule four: trigger - someone arrives
Trigger actions - presence sensor arrives (any)
Actions - set private Boolean: rule two: false
Action - Turn on Virtual Override Switch
Restrictions - only between two times: sunset and sunrise
Switch to disable rule: Virtual Override Switch

Question about setting light color/level/hue, etc.

I want certain lights to come on a certain levels and colors at certain times/conditions.

  • Tried setting Level and then Color, but I’m pretty sure that Color also affects level. As in Light Blue is a different level and a different Saturation than Blue. So the Color will change the Level when it executes.
  • Ok, I set color and then light. This mostly works, but sometimes the level comes on at 100, changes color and then turns it down to a barable level like 30%. So not quite what I need.
  • Today I thought I would set Level and then Hue. Hue should be color only and not affect level. But what are the parameters for setting the Hue? I thought I would just cross reference what it said in my Hue Lights app for the color of my choice. But the number they give me there is 8677/65535. Ok, nothing like that can be entered in Core for Hue. It says to enter a value below 360.

So does anyone have any thoughts? A reference for what Core means when it says Hue? A better idea for not blasting myself with light at 4 am and then it turning down? Or coming on low, then changing to a random level because that is what the ‘color’ tells it to be at?

Thanks!!!

Oh, and has anyone had any trouble with Core and their Hue Lights in the last couple of days? I’ve had some trouble with Hue and Routines the last few days, but this morning got my first trouble with Hue and Core. 1 light in my set up (right beside my bed) came on at 100% Cold White instead of the programmed 20% Gold. Not a nice wake up for sure.

@ady624

Please tell me if my logic and thought process is correct on this.

Group one must occur BEFORE group two can be true? (This is the second half of a latching piston)

@ady624 Edit -

Basically what I want is this…

I step out of the shower and it does the stuff in the first block. Things stay like that until I’m done.

Then when I leave the room, all of the motion goes inactive and it does the stuff in the second block.

@ady624 bump

Here’s one that would be even more random for you, but at the cost of having a separate piston for each set of lights.

 (Piston name: Kitchen Random)
 IF
       Time is between 60 minutes before sunset and midnight
 THEN
       Using "Kitchen Lights"
           Wait 1-30 minutes
           Turn on
           Wait 20-90 minutes
           Turn off
           Follow up with piston "Kitchen Random" after 1 seconds

So effectively after each on/off cycle, the piston reboots itself for a new cycle. The reason you need a separate one for each set of lights is that you don’t know which set of lights will finish its cycle first (because they’re random) but if they were all in the same piston you would only want to follow up once for the whole group.

You could also create a Simulated Switch which you could turn on/off through the SmartThings app or SmartTiles so you could turn off the cycle (say, if you’re home and you don’t want the random lights going on/off). Make the IF condition include “AND ‘Randomness Switch’ is ON” and then if you shut off that “switch” the piston won’t run anymore. You would probably want a piston to run at 00:01 each day to turn the switch back on for the next day’s cycles.

How can I do cascading if’s in one piston? Basically, more than one else if? I can do one - and I’ve seen examples of people doing 5-6 else-ifs…but I can’t seem to figure out how to do it.