I made a candle flicker and think I broke the Device?


#1

1) Give a description of the problem
After creating the piston below with a ‘while loop’ the device will not shut off possibly due to all the delay commands

2) What is the expected behavior?
The piston behaves as expected to say that it takes a philips hue bulb and randomly adjusts the dim very rapidly and randomly to mimic a candle flickering effect.

3) What is happening/not happening?
I can no longer turn off the device because I think it is still trying to continue to execute the loop prior to receiving the off command.

The goal is to run the loop when the device is on and to be able to successfully shut the device off.

4) Post a Green Snapshot of the pistonimage
(UPLOAD YOUR IMAGE HERE)

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


LIFX Effect Help Needed
#2

is the candle still flickering?

off topic: could we get a video of the flickering candle? thinking for use on halloween maybe :slight_smile:


#3

Can’t you just pause the piston to see if it stops. Then adjust accordingly?


#4

When i get back home I will post a video… it looks quasi realistic but the “turning off” problem makes the piston unusable.


#5

Pausing the piston will stop the flicker after about 1 minute.

@Gopack2 you mentioned an adjustment… what adjustment.

I guess the simplest question, “how can I turn off the light”? Hitting the ‘off’ switch in the ST app has no effect because the piston continues to run through the loop.


#6

thanks.

add a virtual switch in ST and change the while condition to Dimmer 17 switch is on and Virtual Switch is on. turn off the virtual switch when you want the piston to stop and you will be all set on the “turning off” problem :slight_smile:


#7

Attached. I need to play with the delays to shorten them a bit. Believe it or not, there is not a lot of research on how long candles typically flicker for.

Here is the video


#8

thanks. the video timer shows 0:00 … maybe takes a little time to upload?

believe you are looking for this? :slight_smile:


#10

Of course someone would have already done this. I hope the video worked. I had to paste a Dropbox link as the site does not allow videos.

Anyway feel free to adjust the delay times to how you see fit.

I find that you never want brightness to be below 10 or above 50. And ending the loop by turning off candle does work, it just takes about 60 seconds to complete the ‘cached’ looped commands.


#11

Love the candle flicker effect. Thank you. I have it set up with a switch and 4 lifx robe bulbs. Tried to combine your idea to flicker each bulb by defining each bulb and running the delays for each, so they would flicker independently and the piston would hang. So, now I have a separate piston for each bulb flicker and call those pistons from my main porch lighting piston. Works like a champ.

Have been trying to do this from webcore straight away, but it does not have access to the effect that are built into the lifx app. This is one effect down, now to try to figure out the others in a round about way like this. In particular, the lighting effect and the spooky effect.

Btw. How did you start on this by the delays… did you find an algorithm somewhere to point you in the right direction?


#12

Honestly. Trial and error with the delays.

When you stop the VS how long before the candle stops flickering?


#14

thank you for the video. that looks really nice.

i am probably going to use this on a outdoor bulb. so, i am experimenting a little with setting the bulb temperature lo as low as possible and playing with the level and timing.


#15

Immediately. I have my lifx bulbs hooked to a ge smart switch so that turns their power completely off. However if i turn the switch off the piston tries to run for a bit, usually 30 seconds or less then stops.


#16

Here is what I am working with right now. Still a work in progress. But, it is working at the moment :sweat_smile:

There are 4 candle light pistons that get called from the main one, on for each bulb in soffit of my porch.



#17

#18

@JDogg016 thanks for the great idea. here is the one i settled on for use on halloween day outside. not quite candle flicker but more like halloween lights flicker. :slight_smile:


#19

@bangali can you look at my main piston that I posted. I know it should be sunset to 10:00 pm. The issue I am having is, when it sets the scene it saves correctly. Albeit, not as random as I would like. However when I turn on the switch for my porch, then wait 30 seconds for the lifx bulbs to connect, it does not always apply the scene correctly. Many times it will set it to the last scene they were on when they were shut off? Otherwise it is working correctly. Any ideas?


#20

try inserting a couple of seconds wait between the activate and execute piston tasks.


#21

I was JUST thinking about Halloween lighting pistons. Some awesome stuff here. Can’t wait to give to give them a shot! All my bulbs are Lifx bulbs, 25 total (a blessing and a curse). Since they are most Definitely cloud-based I wonder how the above pistons will do…there’s a pretty big delay in smartthings when it comes to showing what the bulb is actually doing. I have to use the “refresh” command in webcore often. Hmmmm…Let’s the testing and tweaking begin!


#22

not specifically for halloween but generally for any holiday light, heres another one: