Looping RGB lights for Xmas

Posted on
Mon Dec 26, 2016 12:59 pm
Turribeach offline
Posts: 429
Joined: Feb 06, 2015
Location: London, UK

Looping RGB lights for Xmas

Hi all,

I got some RGB led lights which I control with a Fibaro RBG module. I want them to cycle through the RGB colours so that they resemble Xmas lights. I have already coded all the colour changes in separate action groups. Then I created a parent action group which executes the individual colour action group changes via a Phyton script. Now I want to execute the parent action group in a loop. The trigger for this action group will be another device, while that device it's on I want the parent action group to execute and change the RGB colours in an infinite loop. Once the device is switched off I want the LED to stop changing colours and switch off. I thought of doing a schedule which executes every 10 seconds and checks the device's state but executing a schedule so often sounds wrong to me. I could also execute the parent action group via a trigger (when the said device goes on) and have a loop in my script checking the device's state to stop when it goes off. But I am not sure if having a script running for long could be an issue. What is the best way to do what I want?

Thanks,
Christian

Posted on
Mon Dec 26, 2016 1:40 pm
hamw offline
Posts: 1212
Joined: Mar 31, 2008

Re: Looping RGB lights for Xmas

Why not create a variable which you can set to on/off or true /false from a control page. Put a conditional in your script so:
"if value of variable "LED_Lights" is "on" then .... (but in python-ese)

and your script will check the status before looping. If it is "off" or any other value the script will stop.

The script will live as an external script which is launched by a trigger when the "LED_Lights" variable is changed. External scripts run in separate processes so they minimize the impact on the Indigo server.

Posted on
Wed Dec 28, 2016 3:57 am
Turribeach offline
Posts: 429
Joined: Feb 06, 2015
Location: London, UK

Re: Looping RGB lights for Xmas

Thanks hamw. I did it with regular triggers on the On event but I followed your advice and put all the RGB cycle code in an external script to minimize the impact on the Indigo server.

Posted on
Wed Dec 28, 2016 8:28 am
DomoPat offline
User avatar
Posts: 210
Joined: Jul 17, 2010
Location: Toulouse, France

Re: Looping RGB lights for Xmas

There is a 'rainbow' mode preprogrammed in the Fibaro RGB module. When you start it the module will cycle automatically through colors until you send any other order to the module.

To start this mode you have to make a new action group and select 'modify configuration parameter ZWAVE', then edit action settings will open a window where you select the device, enter 72 for the param index, param size select 1 byte, and param value enter 8. Enjoy !

Posted on
Wed Dec 28, 2016 9:20 am
Turribeach offline
Posts: 429
Joined: Feb 06, 2015
Location: London, UK

Re: Looping RGB lights for Xmas

Hi DomoPat, I wasn't aware of the rainbow mode, nice tip! I tried and it works fine as per your instructions.. I still prefer my manual RGB cycle as I can choose which colours I want to cycle, their order, the time separation between changing colours, etc. But the rainbow mode is much more efficient for the Z-Wave network as it is a single command whereas I am sending commands all the time to do my RGB cycle. Thanks!

Posted on
Wed Dec 28, 2016 10:12 am
DomoPat offline
User avatar
Posts: 210
Joined: Jul 17, 2010
Location: Toulouse, France

Re: Looping RGB lights for Xmas

If you like the rainbow mode, you are going to like the Storm mode: set the parameter to 7 and wait for lightning to happen.... And what about the wood fire mode ? try parameter 6. For party nights you might like parameter 10 ! :D

Posted on
Wed Dec 28, 2016 5:59 pm
Turribeach offline
Posts: 429
Joined: Feb 06, 2015
Location: London, UK

Re: Looping RGB lights for Xmas

Oh dear, I clearly have been missing all the fun side of this device. I really like the party nights mode although not really applicable for toilet lights. :mrgreen:

I might have to buy a new RGB LED strip for the living room then!

Many thanks for the tips.

Posted on
Thu Dec 29, 2016 2:11 am
DomoPat offline
User avatar
Posts: 210
Joined: Jul 17, 2010
Location: Toulouse, France

Re: Looping RGB lights for Xmas

Ah ah, I have now three LED strips in the living room because of this, and also because it is so easy to control them with the RGB modules and Indigo... glad you like it !

Posted on
Thu Dec 29, 2016 3:52 am
GlennNZ offline
User avatar
Posts: 1565
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: Looping RGB lights for Xmas

Have a look at this very simple plugin - to select LED light modes - to make life slightly easier.

:wink:

viewtopic.php?f=222&t=17652

Glenn

Posted on
Thu Dec 29, 2016 11:50 am
DomoPat offline
User avatar
Posts: 210
Joined: Jul 17, 2010
Location: Toulouse, France

Re: Looping RGB lights for Xmas

Nice plugin, makes it easier to switch to the fun modes ! I missed it when you announced it.

But there is a problem if the name of the device contains an accented character like 'é' or 'è' or 'å', I get an error in the log:

Traceback (most recent call last):
File "plugin.py", line 161, in setLEDeffect
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 4: ordinal not in range(128)


and the command is not sent to the RGB module.

Thank you fo this plugin !

Posted on
Thu Dec 29, 2016 3:02 pm
GlennNZ offline
User avatar
Posts: 1565
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: Looping RGB lights for Xmas

DomoPat wrote:
Nice plugin, makes it easier to switch to the fun modes ! I missed it when you announced it.

But there is a problem if the name of the device contains an accented character like 'é' or 'è' or 'å', I get an error in the log:
Traceback (most recent call last):
File "plugin.py", line 161, in setLEDeffect
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 4: ordinal not in range(128)

and the command is not sent to the RGB module.

Thank you fo this plugin !


Thanks for the feedback - simple error - should be fixed now - just get the plugin to check or update to version 0.0.3

I agree certainly easier than remembering the parameters - particularly for next Xmas - when we have all long forgotten.
Keen to add Aeon Labs LED Bulb support as well - it has similar, although far more complication cycles of patterns (need a; and they provide a excel spreadsheet to calculate!)
Just waiting for version 7.0.3 Indigio version to fix a bug which is limiting progress.

Glenn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests