Fibaro RGBW control by Fibaro switch Topic is solved

For Z-Wave related questions in Domoticz

Moderator: leecollings

piokuc

Fibaro RGBW control by Fibaro switch

Post 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
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Fibaro RGBW control by Fibaro switch

Post 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
The most dangerous phrase in any language is:
"We always done this way"
piokuc

Re: Fibaro RGBW control by Fibaro switch

Post 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...?
antares
Posts: 48
Joined: Saturday 24 September 2016 9:25
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Germany
Contact:

Re: Fibaro RGBW control by Fibaro switch

Post 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!
piokuc

Re: Fibaro RGBW control by Fibaro switch

Post by piokuc »

Please create other topic because your question is with other problem.
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Fibaro RGBW control by Fibaro switch

Post 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
The most dangerous phrase in any language is:
"We always done this way"
antares
Posts: 48
Joined: Saturday 24 September 2016 9:25
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Germany
Contact:

Re: Fibaro RGBW control by Fibaro switch

Post 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. :-(
piokuc

Re: Fibaro RGBW control by Fibaro switch

Post by piokuc »

please create other topic
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Fibaro RGBW control by Fibaro switch

Post 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
The most dangerous phrase in any language is:
"We always done this way"
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Fibaro RGBW control by Fibaro switch

Post 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
The most dangerous phrase in any language is:
"We always done this way"
piokuc

Re: Fibaro RGBW control by Fibaro switch

Post 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.
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Fibaro RGBW control by Fibaro switch

Post by emme »

give the script a chance ;)
The most dangerous phrase in any language is:
"We always done this way"
piokuc

Re: Fibaro RGBW control by Fibaro switch

Post by piokuc »

no i try script. but why not working correct slave device ? It looks as bug in Domoticz.
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Fibaro RGBW control by Fibaro switch

Post by emme »

..not really sure, but MAYBE.... you cannot chain Device1 --> slave --> Device2 --> slave --> Device1
But here we would need a Domoticz GURU reply! :P
The most dangerous phrase in any language is:
"We always done this way"
piokuc

Re: Fibaro RGBW control by Fibaro switch

Post 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
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Fibaro RGBW control by Fibaro switch

Post by emme »

you miss the brackets ;)

No: otherdevice[Switch_2]
Yes: otherdevice['Switch_2']
The most dangerous phrase in any language is:
"We always done this way"
piokuc

Re: Fibaro RGBW control by Fibaro switch

Post 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
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Fibaro RGBW control by Fibaro switch

Post 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
Attachments
Cattura-1.jpg
Cattura-1.jpg (39.83 KiB) Viewed 2450 times
Cattura-1.jpg
Cattura-1.jpg (53.79 KiB) Viewed 2450 times
The most dangerous phrase in any language is:
"We always done this way"
piokuc

Re: Fibaro RGBW control by Fibaro switch

Post 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
piokuc

Re: Fibaro RGBW control by Fibaro switch

Post by piokuc »

Ok i found a bug

Code: Select all

commandArray {}
should be

Code: Select all

commandArray = {}
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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest