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

4thofjuly
diwali
halloween
christmas
holiday

#1

UPDATE: new single piston version with support for pausing lights and sound. you can also use this with only lights and no sound. to disable sound set soundEnabled flag to false and save the piston. if flag is false the soundSpeaker device variable can be left empty.

to pause the light and sound this uses a global variable called @pauseHLCRaFp please create this global boolean variable and set it to false before restoring this piston. once this piston is running, from another piston set this variable to true to pause and false to resume.

how often the sound is played is controlled by the playSoundEveryNthLoop. if you want sound to play always set it to 0. otherwise set to some positive integer number 2…N.

Previous versions

UPDATE: heres a new version thats a single piston: all instructions in the piston image. piston code uvau4:

DO NOT USE: old pistons only here for reference.


Holiday Lights with Rotating Colors and Levels Fade Piston
Christmas Colors Rotate
Piston for looping through specified colors?
Holiday lights color rotate
Gardenspot Halloween color settings
RGBW lights for each holiday/season
I made a candle flicker and think I broke the Device?
Piston Won't Turn Off
Tracking Holidays
#2

My apologies if this is slightly offtopic, but can someone recommend some lights for this?


#3

depends on where and how you would use them. like in a can light, outdoors …?


#4

Outdoors.


#5

these seem to have the richest colors but outdoors will need to be protected from the weather:

this is another option and are meant for outdoors:


#6

Thanks, @bangali. Is there a way to have random colors cycle if the date is not one of the defined holidays?


#7

Lifx bulbs floods are outdoor rated too. I’m using them on my porch and they are brighter than the hue


#8

from the h2t8 piston where the other piston is enabled and executed if its not any of the dates create a random color string and pass it in to the 8z2c3 piston. thats one way.

or in the 8z2c3 piston, for the if at line 70 you could setup a else condition to populate colorToRotate with a random color string if the piston is called with no arguments.


#9

For the variable colorstorotate in 8z2c3, why do I have to add colors here? I thought they were defined In The other piston h2t8?


#10

they are defined in piston h2t8 but passed in, then stored and used in piston 8z2c3. in piston 8z2c3 take a look at the code block from lines 70 - 81 in the image.


#11

So fadecolors is kinda like a global variable but not? Due to args?


#12

fadecolors could be a global variable instead of passing it via args. but when doing an example i try to keep it 1) self contained and 2) give ancillary examples of wC capabilities like passing in arguments on a piston execute task.


#13

I really like these pistons, thanks a lot!

Quick question though… I have a RGBW bulb on my front porch and currently have a piston that sets color/level when the door is opened, then resets color/level when the door has been closed for x amount of time. I’ve been manually going into this piston to change the colors for holidays, would there be a way to combine my piston with yours?

For example, could I have my piston pause this one, set color to white, and level to 100%, then when the door has been closed for 10 min, resume this piston. I imagine that is completely accomplish-able, but I guess I’m wonder what the most effective way to go about it would be.


#14

sure thing.

do a couple of things:

  1. in the scheduler piston here h2t8 set a global variable to true before resuming the colors piston. also set the same global variable to false after pausing the colors piston.
  2. at the start of your door open piston if the global variable is true pause the colors piston. at the end of same piston if the global variable is true resume the colors piston.

and you are done. :slight_smile:


#15

Hi I have been messing around with this great piston to help learn webcore (steep learning curve!) i have a question though. I’m in the UK, is there a way to change the date format in the first piston to the UK format?

I figured it would just be a case of swapping the day/month around but it did not seem to work. tonight i set up two “test” holidays one UK 17/10 and one US 10/17 to see which would trigger and the american date format one triggered.

is there an easy way to change this?


#16

thank you. it will get super easy just takes a little getting used to.

may be try date($year + ‘/10/17’)?

also tagging @Robin whos in the UK.


#17

Thanks it did not pause the piston at the defined time last night and i woke up to my office lights still merrily scrolling away :slight_smile: … probably another issue though

the dates thing is weird as the dates in the green title box at the top of the piston are in UK format DD/MM/YYYY yet the date expression work on the US format MM/DD/YYYY.

“addDays(date(“10/18/” + $year), -1)” did not work

“addDays(date(“18/10/” + $year), -1)” worked

cheers for the help


#18

that is the right date format for the UK … so, all working as it should?


#19

no thats me getting confused sorry :man_facepalming:

I’ve done a bit more research and found that it seems that the time is converted to a value based on the number of seconds since 1st Jan 1970. when i use the UK date and convert the value back it comes out as 7th July 2019. seems that this just has to be in the US format. no problem I’ve just added a note in the description to remind me.

seems to be working at the moment though. we shall see how it goes…

did not stop again! how do i correlate the statement /condition #s in the logs to actual events? or is there page in the wiki that i’m missing?


#20

no worries.

take a look at unix epoch time. just in milliseconds.

if you have full logging turned on with trace, the log will refer to the numbers you see in the code trace above.