Front Exterior Lighting - ST Scenes Assignment


#1

I have my ST up and running since December and I was looking to use WebCore to consolidate various ST scenes and several Smart Lighting Automations into a single WebCore piston for various groups of lighting. The simplest and obvious one to start with is my exterior lighting.

The plan of action is:
A) At Sunset - Activate Evening Lighting Scene (House lights to 100% at 3100k or holiday colors, Side Yard Light Off and Landscape Lights Off - I set these in the ST scene).
B) At Midnight - Activate Overnight Lighting Scene (dim House lights to 70% at 2700k, Side Yard Light Off and Landscape Lights off); void if house mode is ‘Away’.
C) At ‘Good Night!’, only if after midnight, Activate Overnight Lighting Scene (see B above).
D) On front door motion - Activate front door hue light to 100% at 3500k
E) After 20 minutes of no motion, return front door light to respective scene (either A or B above)
F) At sunset, turn all lights off.

House lights are Hue bulbs, Side Yard light is a standard LED on a GE switch (non-dimmer) and goes off at midnight because it lights my neighbors bedroom window. Landscape Lights are standard non-dimming low voltage landscape lighting.

So here are my questions:

  1. Can I assign existing ST scenes using WebCore or do I need define my scenes within WebCore? Based on community search, it seems to be the latter.
  2. If I have to assign my scenes within WebCore, what is the best practice to do so, within the piston or a dedicated “sub” piston? I ask because I change my light colors based on holidays, otherwise default to colors stated above.
  3. What are my trigger events? If I have this right, they would be:

a) Time changes to $sunset
b) Time changes to $midnight (not ‘Away’)
c) Mode changes to ‘Good Night’ where Time is after $midnight
c) Time changes to $sunrise
d) Motion(front door) changes to active
e) Motion(front door) changes to inactive (wait 20 minutes)

  1. What would the best programming layout be here? Should I do a series of stand alone if Trigger statements, of should these be nested with in the Else If?

Once I get this done, it would basically be a copy for my backyard patio, except the ‘Away’, ‘Good Night’ and ‘Motion’ triggers would not apply, nor would holiday scenes.

Thanks!


Looking for good examples on how to use List type variables
#2

You can work around Scenes not being in webCoRE so you don’t have to redefine them. Simply make an Automation Routine in your ST App that activates your scene, then call it using the Execute Routine option in webCoRE:

You’re on the right path with triggers. Some minor edits:
a) Select Virtual Device, then Time, and then “happens daily at”… choose Sunset from the list of defaults.

b) Same as above, with an “AND mode is not Away” clause

c1) Select Virtual Device, then Time, and then “happens daily at”… choose Midnight from the list of defaults, followed by THEN change mode to ‘Good Night’.

c2) Select Virtual Device, then Time, and then “happens daily at”… choose Sunrise from the list of defaults.

d) Correct as is

e) I’d change this to “Motion front door stays inactive for 20 minutes”. As you get used to webCoRE, you’ll find avoiding WAIT commands will keep your piston from behaving unexpectedly.

For triggers, I’ve had the best luck by keeping them at the top of individual IF statements. Once triggers start getting buried in the code being executed, sometimes the “changed to xxx” doesn’t evaluate the way you’d expect it to and you might get false positives/negatives to debug.


#3

Thanks @michicago, I will lay it all out tonight and see what happens.

I was really hoping to not have to create routines for each scene, as that can get insane. On the native ST setup I have, the routines folder is pretty streamlined. But I have an insane number of scenes (and Smart Light App rules).

What I may do instead is write some pistons that develop scenes outside of the code itself, but still within WebCore, or perhaps develop the scenes as variables at the front of the code where it is Piston specific, so they are not buried within the code. I just want an easy way to tweak the scene settings over time.

Now, regarding the statement “Time happens daily at…”, how is this different from “Time changes to…”. I am not questioning you or the approach, just trying to under the difference.

Also, I planned to defined sunset and sunrise times as global variables so that if I decide later on the alter them by an offset, I can do so once globally instead of at each piston.

Great advise on the triggers and logic layout; I will proceed accordingly.