I can't get RGBW to work

Easy to use, 100% Lua-based event scripting framework.
Post Reply
Marque1968
Posts: 12
Joined: Tuesday 03 April 2018 18:41
Target OS: Linux
Domoticz version:
Contact:

I can't get RGBW to work

Post by Marque1968 » Tuesday 03 April 2018 18:48

Hi all. Rather a noob here.

I tried to execute this scripts: (device Piushaven - THB is a Wunderground weather station)

Code: Select all

return {
	on = {
		devices = {
			'Piushaven - THB'
		}
	},
	execute = function(domoticz, device)
	    local tempBlue = domoticz.devices('Piushaven - THB').temperature
	    local tempRed  = domoticz.devices('Piushaven - THB').temperature
	    if (tempRed < 5) then tempRed = 5 end
	    if (tempRed > 25) then tempRed = 25 end
	    tempRed = tempRed - 5 
	    tempRed = domoticz.round(tempRed * (256/20))
	    
	    if (tempBlue < -5) then tempBlue = -5 end
	    if (tempBlue > 20) then tempBlue = 20 end
	    tempBlue = 0 - (tempBlue - 20)
	    tempBlue = domoticz.round(tempBlue * (256/25))

		domoticz.log('Device ' .. device.name .. ' was changed. Attempting Blue to ' .. tempBlue .. ', Red to ' .. tempRed, domoticz.LOG_INFO)
	    
	    domoticz.devices(89).setRGB(tempRed,0,tempBlue)  
	    
		domoticz.log('Device ' .. device.name .. ' was changed. Succeeded Blue to ' .. tempBlue .. ', Red to ' .. tempRed, domoticz.LOG_INFO)
	end
}

Upon execution I get:

Code: Select all

2018-04-03 18:45:00.397 dzVents: Info: ------ Start internal script: testrgb:, trigger: every 1 minutes on mon,tue,wed,thu,fri
2018-04-03 18:45:00.402 dzVents: Error (2.4.1): Method setRGB is not available for device "RGBW-Overloopkast" (deviceType=Color Switch, deviceSubType=RGBWWZ). If you believe this is not correct, please report.
2018-04-03 18:45:00.402 dzVents: Info: Device was changed
2018-04-03 18:45:00.402 dzVents: Info: ------ Finished testrgb
I also tried the second device the Fibaro RGBW gives me, but the same error occurs.


When I used the Fibaro RGBW the first time I know I had also a switch with an color palet to choose from. That has disapeared since. After which I reinstalled the RGBW dimmer.

Secondly, I should have a setRGBW command, but can't find that.
Last edited by Marque1968 on Tuesday 03 April 2018 21:07, edited 1 time in total.

dannybloe
Posts: 1480
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi
Domoticz version:
Location: Ermelo
Contact:

Re: I can't get RGBW to work

Post by dannybloe » Tuesday 03 April 2018 19:27

You have to make sure you use the very latest beta because I merged a fix for this problem. You need to have dzVents 2.4.2 (and you have 2.4.1).
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.

Marque1968
Posts: 12
Joined: Tuesday 03 April 2018 18:41
Target OS: Linux
Domoticz version:
Contact:

Re: I can't get RGBW to work

Post by Marque1968 » Tuesday 03 April 2018 20:56

Ok, I did allow the update to run this afternoon, and I also selected a reboot. It seems that this has not worked properly, as after I rebooted the OS (Ubuntu) tonight, I got different logs.

I created a test script (as not to need to wait until the temperature drops significantly)

Code: Select all

return {
on = {
        timer = {'Every 1 minutes on mon,tue,wed,thu,fri'}
    },
	execute = function(domoticz)
	    domoticz.devices(99).setRGB(255,0,0)
		domoticz.log('Device was changed', domoticz.LOG_INFO)
	end
}
This is the resulting log now.

Code: Select all

2018-04-03 20:47:00.333 dzVents: Info: ------ Start internal script: testrgb:, trigger: every 1 minutes on mon,tue,wed,thu,fri
2018-04-03 20:47:00.338 dzVents: Info: Device was changed
2018-04-03 20:47:00.338 dzVents: Info: ------ Finished testrgb
2018-04-03 20:47:00.358 EventSystem: Script event triggered: /home/marc/domoticz/dzVents/runtime/dzVents.lua
2018-04-03 20:47:00.383 Error: Error opening url: http://127.0.0.1:8088/json.htm?type=command¶m=setcolbrightnessvalue&idx=99&hue=0&brightness=100&iswhite=false
Secondly, is there no way to also set the white value? (as I have an RGBW led-strip) Seperate command is acceptable.
Last edited by Marque1968 on Tuesday 03 April 2018 21:07, edited 1 time in total.

Marque1968
Posts: 12
Joined: Tuesday 03 April 2018 18:41
Target OS: Linux
Domoticz version:
Contact:

Re: I can't get RGBW to work

Post by Marque1968 » Tuesday 03 April 2018 20:58

PS. Temperature drop was apparently sufficient. The same error occurs here:

Code: Select all

2018-04-03 20:54:35.241 dzVents: Info: Handling events for: "Piushaven - THB", value: "14.2;77;3;998;3"
2018-04-03 20:54:35.241 dzVents: Info: ------ Start internal script: KastTempColor: Device: "Piushaven - THB (Weerstation)", Index: 26
2018-04-03 20:54:35.241 dzVents: Info: domoticz.round deprecated. Please use domoticz.utils.round.
2018-04-03 20:54:35.241 dzVents: Info: domoticz.round deprecated. Please use domoticz.utils.round.
2018-04-03 20:54:35.241 dzVents: Info: Device Piushaven - THB was changed. Attempting Blue to 59, Red to 118
2018-04-03 20:54:35.241 dzVents: Info: Device Piushaven - THB was changed. Succeeded Blue to 59, Red to 118
2018-04-03 20:54:35.241 dzVents: Info: ------ Finished KastTempColor
2018-04-03 20:54:35.258 EventSystem: Script event triggered: /home/marc/domoticz/dzVents/runtime/dzVents.lua
2018-04-03 20:54:35.292 Error: Error opening url: http://127.0.0.1:8088/json.htm?type=command¶m=setcolbrightnessvalue&idx=89&hue=330&brightness=46.274509803922&iswhite=false
Last edited by Marque1968 on Tuesday 03 April 2018 21:08, edited 1 time in total.

dannybloe
Posts: 1480
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi
Domoticz version:
Location: Ermelo
Contact:

Re: I can't get RGBW to work

Post by dannybloe » Tuesday 03 April 2018 21:00

There is an encoding issue in the url being used to set the color. Looks like the build isn't using the proper encoding. No idea how that happens or how that can be fixed. It's not a dzVents issue.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.

dannybloe
Posts: 1480
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi
Domoticz version:
Location: Ermelo
Contact:

Re: I can't get RGBW to work

Post by dannybloe » Tuesday 03 April 2018 21:01

And please use code tags when you post something with code.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.

Marque1968
Posts: 12
Joined: Tuesday 03 April 2018 18:41
Target OS: Linux
Domoticz version:
Contact:

Re: I can't get RGBW to work

Post by Marque1968 » Tuesday 03 April 2018 21:06

Ah. Yes. Long time since I used BB's. I'll try to remember to use those code tags again.

So, just wait for the next nightly build, I assume.

EDIT: Updates my posts above with the correct BBcode for the code-blocks
Last edited by Marque1968 on Tuesday 03 April 2018 21:09, edited 1 time in total.

dannybloe
Posts: 1480
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi
Domoticz version:
Location: Ermelo
Contact:

Re: I can't get RGBW to work

Post by dannybloe » Tuesday 03 April 2018 21:07

I don't know.. I'll ask around what could be wrong.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.

Marque1968
Posts: 12
Joined: Tuesday 03 April 2018 18:41
Target OS: Linux
Domoticz version:
Contact:

Re: I can't get RGBW to work

Post by Marque1968 » Tuesday 03 April 2018 21:13

The other question still remains. There are rgb-leds and white-leds on my LED-strip. I would like to activate (in some circumstances) the white leds aswell (thus together with the RGB's).

devros
Posts: 184
Joined: Saturday 29 October 2016 20:55
Target OS: -
Domoticz version:
Contact:

Re: I can't get RGBW to work

Post by devros » Tuesday 03 April 2018 21:32

Hello i have same problems as you

http://www.domoticz.com/forum/viewtopic ... 59&t=22889
are you going to fill bugreport, or should do I ...?
Im also on ubuntu, dunno if others systems have similar problems

dannybloe
Posts: 1480
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi
Domoticz version:
Location: Ermelo
Contact:

Re: I can't get RGBW to work

Post by dannybloe » Tuesday 03 April 2018 21:49

I think I have fixed this in the upcoming 2.4.3. Well, not fixed it but worked around it. Looks like on some systems &param in a url is encoded to ¶m. Will be merged later today.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.

devros
Posts: 184
Joined: Saturday 29 October 2016 20:55
Target OS: -
Domoticz version:
Contact:

Re: I can't get RGBW to work

Post by devros » Tuesday 03 April 2018 22:05

great :) thanks

Marque1968
Posts: 12
Joined: Tuesday 03 April 2018 18:41
Target OS: Linux
Domoticz version:
Contact:

Re: I can't get RGBW to work

Post by Marque1968 » Tuesday 03 April 2018 22:32

I saw that shortning of param aswell. I changed my script accordingly:

Code: Select all

return {
	on = {
		devices = {
			'Piushaven - THB'
		}
	},
	execute = function(domoticz, device)
	    local tempDisplay = domoticz.devices('Piushaven - THB').temperature
	    local tempBlue    = domoticz.devices('Piushaven - THB').temperature
	    local tempRed     = domoticz.devices('Piushaven - THB').temperature
	    if (tempRed < 5) then tempRed = 5 end
	    if (tempRed > 25) then tempRed = 25 end
	    tempRed = tempRed - 5 
	    tempRed = domoticz.utils.round(tempRed * (256/20))
	    
	    if (tempBlue < -5) then tempBlue = -5 end
	    if (tempBlue > 20) then tempBlue = 20 end
	    tempBlue = 0 - (tempBlue - 20)
	    tempBlue = domoticz.utils.round(tempBlue * (256/25))

		domoticz.log('Local temperature now ' .. tempDisplay .. ' degrees. Setting Blue to ' .. tempBlue .. ', and Red to ' .. tempRed, domoticz.LOG_INFO)
	    
	    -- domoticz.devices(89).setRGB(tempRed,0,tempBlue)  
	    domoticz.openURL('http://127.0.0.1:8088/json.htm?type=command&param=setcolbrightnessvalue&idx=130&color={"m":3,"t":0,"r":' .. tempRed .. ',"g":0,"b":' .. tempBlue .. ',"cw":0,"ww":0}&brightness=100');
	    
		domoticz.log('Device ' .. device.name .. ' was changed. ', domoticz.LOG_INFO)
	end
}
And indeed I got the same error.

Code: Select all

2018-04-03 22:24:39.368 dzVents: Info: Handling events for: "Piushaven - THB", value: "12.3;87;3;997;4"
2018-04-03 22:24:39.368 dzVents: Info: ------ Start internal script: KastTempColor: Device: "Piushaven - THB (Weerstation)", Index: 26
2018-04-03 22:24:39.368 dzVents: Info: Local temperature now 12.300000190735 degrees. Setting Blue to 79, and Red to 93
2018-04-03 22:24:39.368 dzVents: Info: Device Piushaven - THB was changed.
2018-04-03 22:24:39.368 dzVents: Info: ------ Finished KastTempColor
2018-04-03 22:24:39.386 EventSystem: Script event triggered: /home/marc/domoticz/dzVents/runtime/dzVents.lua
2018-04-03 22:24:39.424 Error: Error opening url: http://127.0.0.1:8088/json.htm?type=command¶m=setcolbrightnessvalue&idx=130&color={"m":3,"t":0,"r":93,"g":0,"b":79,"cw":0,"ww":0}&brightness=100
(in html &para; gives this character indeed, so I would assume a workaround would be counterproductive as I assume Domoticz will fix it tomorrow, wouldn't you think?)

Marque1968
Posts: 12
Joined: Tuesday 03 April 2018 18:41
Target OS: Linux
Domoticz version:
Contact:

Re: I can't get RGBW to work

Post by Marque1968 » Friday 06 April 2018 1:40

Just to inform you, the update upto now do not yet work. Sending a URL, still get the ¶m, and running the original code shows like a new line. I think you've done the same thing I tried. Send code differently, to avoid the "&para" combination. I went as far as "&amp;param" but even though the log then displays "&param", it still gave an error, whilst copying that url to the browser did execute. The log therefor not identical to what is literally send...

dannybloe
Posts: 1480
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi
Domoticz version:
Location: Ermelo
Contact:

Re: I can't get RGBW to work

Post by dannybloe » Friday 06 April 2018 7:43

Well, we have been diving in this ¶ issue and it turns out that it is only a rendering artefact of the log viewed in the browser. Can you check the log in a terminal?
I suspect that the error message has nothing to do with dzVents. Can you try to open the url that you see in the log directly in the browser (with the proper &param entry of course).
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.

Marque1968
Posts: 12
Joined: Tuesday 03 April 2018 18:41
Target OS: Linux
Domoticz version:
Contact:

Re: I can't get RGBW to work

Post by Marque1968 » Friday 06 April 2018 11:58

Where is the log located? (linux)

dannybloe
Posts: 1480
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi
Domoticz version:
Location: Ermelo
Contact:

Re: I can't get RGBW to work

Post by dannybloe » Friday 06 April 2018 12:03

you can start domoticz on the command-line: ./domoticz
Stop the service first.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests