Page 1 of 1

RGBWW bulb issue

Posted: Monday 13 March 2023 5:15
by lshield
I bought a Yeelight RGBWW lamp. It works in Domoticz when using the slider and color picker of the GUI. I was hoping to make a wakeup lamp that can change the RGB values as it progresses through the brightness. I already have that working with other regular dimmer switches so that's not the issue.
I can't get DzVents to change the RGB value of the Yeelight lamp or a dummy RGBWW dimmer switch. DzVents will turn the light on or off just fine. The issue is when I use any of the specific "setColor" or ''setRGB" or Hue or whatever commands.
I always get something that says the following (the port number is correct when I see it):

Code: Select all

Error: Error opening url: http://127.0.0.1:XXXX/json.htm?type=command&param=setcolbrightnessvalue&idx=724&brightness=45&color={"m":3,"t":0,"cw":0,"ww":0,"r":255,"g":100,"b":150}
That was when trying to use the command:

Code: Select all

setColor(255,100,150,45)
At this point I don't have any ideas as I can't understand why it can't even change the RGBWW dummy switch.

Re: RGBWW bulb issue

Posted: Monday 13 March 2023 8:23
by manjh
I had a similar issue with an Ikea Trädfri lamp, with the Zigbee-for-Domoticz plugin. After a lot of fiddling, I found out the it works fine when the lamp is in a Zigbee group.
So the individual lamp work like you describe, but in the group it is OK.
So I used a workaround: even a single lamp now is in a group, and that group is what I control...

Re: RGBWW bulb issue

Posted: Monday 13 March 2023 13:56
by lshield
Are you using a Zigbee light? I don't use them so I don't have any of the Zigbee plugin installed. The bulb is a Yeelight bulb which mostly worked just with what is built in to the system.

Re: RGBWW bulb issue

Posted: Monday 13 March 2023 15:00
by waltervl
Can you do the url manually in a browser? What kind of response do you get back?
Did you set the security correct for API calls over http (see settings, tab security)?
Did you set trusted networks correctly (see settings, tab security)?

Re: RGBWW bulb issue

Posted: Monday 13 March 2023 16:12
by lshield
I currently have port forwarding set up so that I can access this outside my network. I can do the url manually in a browser but only if I use my external IP address even though I'm on the same network. It works fine doing it through the browser. I have all the trusted network things and the security set up properly, I think. I can access the main domoticz page from the local IP address but for whatever reason, I can't get the json url to work even with the username/password.

Re: RGBWW bulb issue

Posted: Monday 13 March 2023 16:30
by lshield
I also was able to log in to my raspberrypi and test all of this. I'm able to use the 127.0.0.1 address on the pi in a browser. It works fine to use the following:

Code: Select all

/json.htm?type=command&param=setcolbrightnessvalue&idx=723&brightness=45&color={"m":3,"t":0,"cw":0,"r":255,"g":100,"b":150}

Re: RGBWW bulb issue

Posted: Monday 13 March 2023 19:00
by waltervl
Then it should also work from Dzvents.

Re: RGBWW bulb issue

Posted: Monday 13 March 2023 20:20
by lshield
waltervl wrote: Monday 13 March 2023 19:00 Then it should also work from Dzvents.
RIght, it should. But it still doesn't. Here is the minimal dzvents thing I made to test it:

Code: Select all

return {
	active = true,
	on = {
		devices = {
			708,
		}
	},
	execute = function(domoticz, device)
		local light = domoticz.devices(723)
		light.setColor(255,134,110,32)
	end
}
Here is the output in the log:

Code: Select all

2023-03-13 14:14:34.591 Error: Error opening url: http://127.0.0.1:XXXX/json.htm?type=command&param=setcolbrightnessvalue&idx=723&brightness=32&color={"m":3,"t":0,"cw":0,"ww":0,"r":255,"g":134,"b":110}
If I just use the "switchOn()" command instead of the "setColor", then it works fine. Only when I try to do anything with the rgb do I get the error.
This happens both with a real Yeelight lamp and a dummy RGBWW Dimmer switch. Both give the same error.

Re: RGBWW bulb issue

Posted: Monday 13 March 2023 22:54
by waltervl
Is the port XXXX the internal port or the external port?
And does the URL work when you put it exactly (including the port and iP) as mentioned by the error when executed from the RPi?

Re: RGBWW bulb issue

Posted: Monday 13 March 2023 23:26
by lshield
The port number is my http port so it's the external port.
If I take the error url and put it in a browser on the rpi it works with the device listed updating.

Code: Select all

{
	"status" : "OK",
	"title" : "SetColBrightnessValue"
}
Also, when I first started I had to put the user:password in for the 127 address to work. I had forgotten about that. I cleared my cache and just tried it again and now I'm getting the "401 Unauthorized" when I'm not adding the user:password. The "127.0.0.*" is definitely listed under the "trusted networks".

Re: RGBWW bulb issue

Posted: Monday 13 March 2023 23:31
by lshield
Actually, I might have just fixed it. I removed my "192.168..." IP under trusted networks and just left the 127. Now it's working fine. Maybe there was a comma in between the two addresses instead of a semicolon.

Re: RGBWW bulb issue

Posted: Wednesday 15 March 2023 8:38
by Kouki31
hello i dont know if its same with me but i have to add 127.0.0.1 to Trusted Networks (no username/password):
and now its work againe
its next to 2023.1 update with password..

Re: RGBWW bulb issue

Posted: Thursday 16 March 2023 20:37
by manjh
lshield wrote: Monday 13 March 2023 13:56 Are you using a Zigbee light? I don't use them so I don't have any of the Zigbee plugin installed. The bulb is a Yeelight bulb which mostly worked just with what is built in to the system.
Correct, this is a ZIgbee (Ikea) lamp. But what struck me is the fact that the behaviour is the same...

Re: RGBWW bulb issue

Posted: Thursday 16 March 2023 20:38
by manjh
lshield wrote: Monday 13 March 2023 23:31 Actually, I might have just fixed it. I removed my "192.168..." IP under trusted networks and just left the 127. Now it's working fine. Maybe there was a comma in between the two addresses instead of a semicolon.
I had a similar experience with two trusted IP ranges. I had a semicolon AND a space between the two. After I removed the space it worked OK.

Re: RGBWW bulb issue

Posted: Thursday 16 March 2023 22:25
by waltervl
manjh wrote: Thursday 16 March 2023 20:37
lshield wrote: Monday 13 March 2023 13:56 Are you using a Zigbee light? I don't use them so I don't have any of the Zigbee plugin installed. The bulb is a Yeelight bulb which mostly worked just with what is built in to the system.
Correct, this is a ZIgbee (Ikea) lamp. But what struck me is the fact that the behaviour is the same...
Dzvents uses http api for some functions like set color so that is why all rgbww devices have this issue with dzVents in 2023.1 if the security settings are not correct.