Page 1 of 2
Fibaro RGBW control by Fibaro switch
Posted: Monday 14 November 2016 8:05
by piokuc
Hi
I have connected to led strip Fibaro RGBW. But to light i have Fibaro 2x1,5 relay switch but one switch is used. Second is free. I want use second switch to control On and OFF Fibaro RGBW.Fibaro RGBW can has ststus on or off. I think that i must write EVENT but i dont know how. I add this second switch and setup it as type PUSH ON in Domoticz. Please anybody help me how write tghis event or any solution... Thanks
Re: Fibaro RGBW control by Fibaro switch
Posted: Monday 14 November 2016 8:32
by emme
You can also configure the RGBW as a slave/secondary device on the 2x1,5 spare switch
so you would not need to write script
Anyhow... if you want to use a script:
Type: Device
Code: Select all
commandArray {}
if devicechanged['Fibaro Free Switch Name'] then
if otherdevices['Fibaro Free Switch Name'] == 'On' then
commandArray['Fibaro RGBW Name'] = 'On'
else
commandArray['Fibaro RGBW Name'] = 'Off'
end
end
return commandArray
this script will be activate ONLY when a devicechange event is triggered, than.... it checks that the change regards the switch and evaluate its state and take action
ciao
M
Re: Fibaro RGBW control by Fibaro switch
Posted: Monday 14 November 2016 8:52
by piokuc
Thanks for help
Now i try with setup slave/secondary.
To device RGBW add as secondary device name SWITCH. It works ok but not full. When i turn ON switch , ok RGBW also is ON. When turn OFF switch also RGBW is OFF. But when i turn RGBW ON, status on SWITCH is still OFF. Status SWITCH only is change when i turn on/off by switch.
But when turn ON RGBW (status switch still off) and now turn ON SWITCH and then turn OFF RGBW status SWITCH also is change to OFF.
Ststua SWITCH is only not change when i turn ON RGBW.
Anybody help me please...?
Re: Fibaro RGBW control by Fibaro switch
Posted: Monday 14 November 2016 14:32
by antares
Just as side question: I have an RGB stripe connected to the Fibaro RGBW dimmer. According to the manuals, it is possible to set RGB or RGBW in the Fibaro Homecenter. But do you know, how I can tell the device in Domoticz that I use RGB and that nothing is connected to the W? Currently, if I chose white color, the stripe turns off (obviously because the dimmer sends all power over W where nothing is connected).
Thanks!
Re: Fibaro RGBW control by Fibaro switch
Posted: Monday 14 November 2016 14:37
by piokuc
Please create other topic because your question is with other problem.
Re: Fibaro RGBW control by Fibaro switch
Posted: Monday 14 November 2016 14:48
by emme
the key is parameter 14
accordin to this document
http://manual.rgbw.fibaro.co.uk/
the default (RGBW) is set to hex: 1111 dec: 4369
if you want to exclude channel W (the forth) it should be set to 0, so it would be: hex: 1110, dec 4368
..I guess
Re: Fibaro RGBW control by Fibaro switch
Posted: Monday 14 November 2016 16:04
by antares
Hi emme,
yes - I figured that before and tried 4368 according to the calculation explained in the manual, but it didn't work either.

Re: Fibaro RGBW control by Fibaro switch
Posted: Monday 14 November 2016 16:05
by piokuc
please create other topic
Re: Fibaro RGBW control by Fibaro switch
Posted: Tuesday 15 November 2016 9:03
by emme
Ststua SWITCH is only not change when i turn ON RGBW.
add the switch as a secondary device on RGBW controller
OR
Code: Select all
commandArray {}
if devicechanged['Fibaro Free Switch Name'] then
if otherdevices['Fibaro Free Switch Name'] == 'On' then
commandArray['Fibaro RGBW Name'] = 'On'
else
commandArray['Fibaro RGBW Name'] = 'Off'
end
end
if devicechanged['Fibaro RGBW Name'] and otherdevices['Fibaro RGBW Name'] == 'On' then
if otherdevices['Fibaro Free Switch Name'] == 'Off' then
commandArray['Fibaro Free Switch Name'] = 'On'
end
end
return commandArray
Re: Fibaro RGBW control by Fibaro switch
Posted: Tuesday 15 November 2016 9:06
by emme
antares wrote:Hi emme,
yes - I figured that before and tried 4368 according to the calculation explained in the manual, but it didn't work either.

parameter 6 set to 0 (Normal DIMMER mode)
try to reappy config and reboot server and device
Re: Fibaro RGBW control by Fibaro switch
Posted: Tuesday 15 November 2016 9:17
by piokuc
emme wrote:Ststua SWITCH is only not change when i turn ON RGBW.
add the switch as a secondary device on RGBW controller
OR
Code: Select all
commandArray {}
if devicechanged['Fibaro Free Switch Name'] then
if otherdevices['Fibaro Free Switch Name'] == 'On' then
commandArray['Fibaro RGBW Name'] = 'On'
else
commandArray['Fibaro RGBW Name'] = 'Off'
end
end
if devicechanged['Fibaro RGBW Name'] and otherdevices['Fibaro RGBW Name'] == 'On' then
if otherdevices['Fibaro Free Switch Name'] == 'Off' then
commandArray['Fibaro Free Switch Name'] = 'On'
end
end
return commandArray
I added switch as secondary to RGBW, and when turn on switch it turn on LED RGBW, when turn off switch it turn off LED RGBW,but when i turn on RGBW it no change to ON status on SWITCH. Change time last seen. But then i manua turn on switch and then Turn off RGBW and it change status switch also to OFF.
Only not working when i click on RGBW to Turn ON , it no change status SWITCH to ON.
Re: Fibaro RGBW control by Fibaro switch
Posted: Tuesday 15 November 2016 9:18
by emme
give the script a chance

Re: Fibaro RGBW control by Fibaro switch
Posted: Tuesday 15 November 2016 9:19
by piokuc
no i try script. but why not working correct slave device ? It looks as bug in Domoticz.
Re: Fibaro RGBW control by Fibaro switch
Posted: Tuesday 15 November 2016 9:21
by emme
..not really sure, but MAYBE.... you cannot chain Device1 --> slave --> Device2 --> slave --> Device1
But here we would need a Domoticz GURU reply!

Re: Fibaro RGBW control by Fibaro switch
Posted: Tuesday 15 November 2016 9:29
by piokuc
No
I have
Device1 - RGBW LED
Device2 - Switch
Device2 is a only slave/secondary device in Device1
I try your script but has a problem in log:
2016-11-15 09:26:40.062 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_device_Osw_kiniet_Michal.lua: ...domoticz/scripts/lua/script_device_Osw_kiniet_Michal.lua:1: attempt to call global 'commandArray' (a nil value)
This is script:
Code: Select all
commandArray {}
if devicechanged[Switch_2] then
if otherdevices[Switch_2] == 'On' then
commandArray[Osw_kiniet_Michal] = 'On'
else
commandArray[Osw_kiniet_Michal] = 'Off'
end
end
if devicechanged[Osw_kiniet_Michal] and otherdevices[Osw_kiniet_Michal] == 'On' then
if otherdevices[Switch_2] == 'Off' then
commandArray[Switch_2] = 'On'
end
end
return commandArray
Re: Fibaro RGBW control by Fibaro switch
Posted: Tuesday 15 November 2016 9:54
by emme
you miss the brackets
No: otherdevice[Switch_2]
Yes: otherdevice['Switch_2']
Re: Fibaro RGBW control by Fibaro switch
Posted: Tuesday 15 November 2016 10:00
by piokuc
Still is problem
Code: Select all
2016-11-15 09:59:36.229 OpenZWave: Domoticz has send a Switch command! NodeID: 23 (0x17)
2016-11-15 09:59:36.247 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_device_Kinkiet.lua: /home/pi/domoticz/scripts/lua/script_device_Kinkiet.lua:1: attempt to call global 'commandArray' (a nil value)
2016-11-15 09:59:36.230 (Z-Wave) Light/Switch (Kinkiet)
Code: Select all
commandArray {}
if devicechanged['Switch2'] then
if otherdevices['Switch2'] == 'On' then
commandArray['Kinkiet'] = 'On'
else
commandArray['Kinkiet'] = 'Off'
end
end
if devicechanged['Kinkiet'] and otherdevices['Kinkiet'] == 'On' then
if otherdevices['Switch2'] == 'Off' then
commandArray['Switch2'] = 'On'
end
end
return commandArray
Re: Fibaro RGBW control by Fibaro switch
Posted: Tuesday 15 November 2016 10:15
by emme
uh.. but this lua script is not supposed to be stored in a file under /scripts folder
it's supposed to be under EVENTS section (Config/More Option) as a Device Script
Re: Fibaro RGBW control by Fibaro switch
Posted: Tuesday 15 November 2016 10:49
by piokuc
Ok add to events and delete from scripts
But still is wrong:
Code: Select all
2016-11-15 10:47:38.326 OpenZWave: Domoticz has send a Switch command! NodeID: 23 (0x17)
2016-11-15 10:47:38.345 Error: EventSystem: in Kinkiet: [string "commandArray {}..."]:1: attempt to call global 'commandArray' (a nil value)
2016-11-15 10:47:38.326 (Z-Wave) Light/Switch (Kinkiet)
Code: Select all
commandArray {}
if devicechanged['Switch2'] then
if otherdevices['Switch2'] == 'On' then
commandArray['Kinkiet'] = 'On'
else
commandArray['Kinkiet'] = 'Off'
end
end
if devicechanged['Kinkiet'] and otherdevices['Kinkiet'] == 'On' then
if otherdevices['Switch2'] == 'Off' then
commandArray['Switch2'] = 'On'
end
end
return commandArray
Re: Fibaro RGBW control by Fibaro switch
Posted: Tuesday 15 November 2016 11:16
by piokuc
Ok i found a bug
should be
and i change small this LUA and now looks that works ok
Code: Select all
commandArray = {}
if devicechanged['Switch2'] then
if otherdevices['Switch2'] == 'On' then
commandArray['Kinkiet'] = 'On'
else
commandArray['Kinkiet'] = 'Off'
end
end
if devicechanged['Kinkiet'] then
if otherdevices['Kinkiet'] == 'On' then
commandArray['Switch2'] = 'On'
else
commandArray['Switch2'] = 'Off'
end
end
return commandArray