RGBW colour flash cycle or fade

Moderator: leecollings

Post Reply
christwigg1974
Posts: 3
Joined: Friday 20 November 2015 11:51
Target OS: -
Domoticz version:
Contact:

RGBW colour flash cycle or fade

Post by christwigg1974 »

Hi All

Firstly, thanks for a great product!

I have a doorbell when pushed triggers a sonos script to play a doorbell mp3.

I would also like the LED lights to flash between red and white for a visual alert. (fade & cycle commands would also be nice to have in the future)

logic:-
if cupboard lights are on > flash red twice > return to white on.
if cupboard lights are off > flash red twice > return to off.

I have tried blocky but all the events happen at the same time which does not change the colour.
I have tried scenes but in blocky you cannot 'switch on after'

any ideas ?

I have also tried lua but cannot figure how to pause between commands.

commandArray = {}
if (devicechanged['Kitchen Cupboard Lights'] == 'On') then
commandArray=['Scene:Kitchen_Cupboard_Lights_Red']='On'
commandArray=['Scene:Kitchen_Cupboard_Lights_White']='On'
commandArray=['Scene:Kitchen_Cupboard_Lights_Red']='On'
commandArray=['Scene:Kitchen_Cupboard_Lights_White']='On'
elseif (devicechanged['Kitchen Cupboard Lights'] == 'Off') then
commandArray=['Scene:Kitchen_Cupboard_Lights_Red']='On'
commandArray=['Scene:Kitchen_Cupboard_Lights_White']='On'
commandArray=['Scene:Kitchen_Cupboard_Lights_Red']='On'
commandArray=['Scene:Kitchen_Cupboard_Lights_White']='On'
commandArray=['Scene:Kitchen_Cupboard_Lights_White']='Off'
print('Kitchen_Cupboard_Flash was switched ON')
end


Any ideas would be greatly appreciated.

Many Thanks

Chris
Roncalli
Posts: 6
Joined: Tuesday 17 February 2015 21:37
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Germany
Contact:

Re: RGBW colour flash cycle or fade

Post by Roncalli »

Hi Chris,

have you tried to include a time component, e.g.:

commandArray = {}
if (devicechanged['Kitchen Cupboard Lights'] == 'On') then
commandArray=['Scene:Kitchen_Cupboard_Lights_Red']='On'
commandArray=['Scene:Kitchen_Cupboard_Lights_White']='On AFTER 3'
commandArray=['Scene:Kitchen_Cupboard_Lights_Red']='On AFTER 6'
commandArray=['Scene:Kitchen_Cupboard_Lights_White']='On AFTER 9'
elseif (devicechanged['Kitchen Cupboard Lights'] == 'Off') then
commandArray=['Scene:Kitchen_Cupboard_Lights_Red']='On'
commandArray=['Scene:Kitchen_Cupboard_Lights_White']='On AFTER 3'
commandArray=['Scene:Kitchen_Cupboard_Lights_Red']='On AFTER 6'
commandArray=['Scene:Kitchen_Cupboard_Lights_White']='On AFTER 9'
commandArray=['Scene:Kitchen_Cupboard_Lights_White']='Off AFTER 12'
print('Kitchen_Cupboard_Flash was switched ON')
end

Additionally, you might want to check wether your doorbell bas been rung:

if (devicechanged['Doorbell'] == 'On' and otherdevices['Kitchen Cupboard Lights'] == 'Off') then
...

Also, I'm not sure whether the elseif works. You might want to try simple if-statements. Check the wiki (http://www.domoticz.com/wiki/Events).

Rgds F.
Domoticz Stable on RaspberryPi 3B+ running stretch-light
Aeon-Labs stick with 23 z-wave devices, RFXtrx with 14 devices, Netatmo with 6 modules, Satel Integra, Instar IP Camera
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest