Holiday Lights: 4th of July / Diwali / Halloween / Christmas - Your Pick



Hate to bother you, but I’m really stumped with this error after “saving” the piston: It also occurs when the pistol executes. The result is nothing works :frowning: I changed the time and dates just for testing purposes.

An error occurred while executing the event: java.lang.NullPointerException: Cannot get property ‘v’ on null object

edit: Nevermind. That’s what I get for skimming the first post: @pauseHLCRaFp :slight_smile:


How do I set a global variable ?


@sgrayban Edit any existing piston. On the left hand side of the screen you should see a list of devices. At the very top of that list is a gray link…Add a new global piston. Create your piston there and save out without making any other changes.


thank you.

thank you for the consideration. that is much appreciated. but you should open up a new example piston thread and post your example there. if you want to acknowledge my work feel free to reference it there or not. :smile:

thanks again.


And to start it I need to create a new piston to set @pauseHLCRaFp to true or false ? Confused at this one.


it starts at whatever time is set in the time happens at in the first if condition of the piston.

@pauseHLCRaFp should be left set to false, you dont need to manually modify it.


Hi again, is there anywhere I can add an action to occur when during these holidays?

I have my trigger as when any one of my “holiday” lights turn on, I would also like to turn on an outside outlet and turn off my porch lights at the same time, but only for Halloween and Christmas.

I tried changing the “with location DO set fade color variable” to “with outletA DO set fade color variable and turn on” but it didn’t seem to work. Then I also didn’t figure out how to add an action to turn off the porch lights.

Thanks again for this postin, I’m sure it’s getting a ton of use right now!


that should work. please post a green snapshot.


Here I tried to put an action to turn off a couple lights but only during Halloween and Christmas. These are my outdoor lights that are just switches. I’m also looking for a place to add an action to turn on an outlet but only during Halloween and Christmas. Any ideas?

Edit: so it looks like turning OFF those lights in this piston works, but I’m still looking for a way to turn other switches and outlets on.


ahh you are using the old version of the piston. have you considered switching to the new version with piston code n45aq?


Sorry I didn’t realize there was a new piston, I’ll install it when I get a chance. I did have a couple of specific things that you helped me with before. I want any one of a set of lights coming on to trigger all this, easy enough, but I want a light turning off to stop all the action, I didn’t see where that would go when I skimmed over the piston. Also, I would like the lights selected to change to a random color any time is turned on and NOT one of the selected holidays, could you help me there? Lastly, what about adding functions to other lights on the days that are selected holidays?


eh … no worries.

when that light turns on set @pauseHLCRaFp to true and then set it to false when the light turns off.

set fadeColors to a random color on piston line #56. that will do it.

like what kind of functions?


like what kind of functions?

I have 2 switches I want to turn off and 2 outlets I’ll wait to turn on.

Edit: I’m a total noob at formatting

  1. add a boolean variable and in define set it to false
  2. when any of the holidays set boolean to true
  3. when boolean is true turn on and off those 2 switches


Ok I kind of understand a little of this. First, I don’t see anywhere or how to define @pauseHLCRaFp. Second, in the very first “set variable {fadeColors}” I define it at $randomColorName correct? This is the entry above the 4th of July entry? Lastly, I created a Boolean variable and initially defined it at false, then in the Halloween and Christmas chunk I set that variable as true. Is that all I need to do for that variable? Then make an action later on in the piston to do what I’m wanting to do with the other devices?

Edit: you also have a trigger in the middle of this piston that is time based. I’m not really sure what it does but time doesn’t matter to me, only if the lights are on or off, what should I do about this?


see this in the first post on the thread:



do you mean in the while loop? that decides till what time the piston runs. you can change the while loop to say while light is on to have it do the color fade only when the light is on and not at other times.


I’m picking up what you’re putting down. I couldn’t quite get things the way I wanted but you taught me enough that I just added the boolean variable to the older piston and and did my extra actions based on that. Thank you for bearing with me and helping me out!


Ok so this is way over my head I think?. Add imported this and put in the three Hue lights I want to use. So I cant tell exactly when this shuts off? I want it to come on at sunset and turn off at sunrise. Also when its not a holiday will my lights come on at sunset and off at sunrise in just white? This is my first attempt as useing web core and no matter how much I have read Im not sure whats gonna happen.

Heres what Im hoping
Lights turn on at sunset and colors adjust based on seasonal dates. Dont need sound and that is set to false
When not in seasonal dates lights come on in white sunset to sunrise
Only useing three hue bulbs on my porch and I think I added them in the right sport


cool. if it works for you, it works. :smile:

i would be happy to help you get on the new single piston as well with the changes you need. if you want to do that at some point ping me again.


change the if statement at the top of the piston to remove the 30 minutes offset from sunset so it reads

if time happens daily at sunset

this is the line the stops the piston:

while time($now) is less than time("23:00")

change that to:

while isBetween($now, $sunset, $sunrise)

EDIT: after you change this please check if isBetween handles $sunset to $sunrise properly. if not we will have to figure something else out. :slight_smile: