Domoticz: RGB/W Switch information missing on LUA and JSON

Created on 13 Sep 2017  路  17Comments  路  Source: domoticz/domoticz

Hi,

Even we can use the bellow JSON command to set a RGB switch color
/json.htm?type=command&param=setcolbrightnessvalue&idx=395&hex=RRGGBB

or for hue and bright

/json.htm?type=command&param=setcolbrightnessvalue&idx=395&hue=128&brightness=42&is

this settings are not being passed to LUA or can be read by json (/json.htm?type=devices&rid=395) when device change (color picker wheel on the dashboard)

Only Level, LevelInt and MaxDimLevel are returned by JSON query.

It's not only virtual RGB/W switches but all of them.

It will be nice to have the hex, hue and brightness available on LUA (as svalue) and JSON

Thanks
Miguel

Most helpful comment

Looks like this will likely be resolved by work being undertaken in https://github.com/domoticz/domoticz/issues/2078

All 17 comments

Also for me it would be great to be able to read the color through API! :+1:

maybe there is a way to send rgbw device dummy switch values to a action link that will filled and then run after the action?

Not that I know.
I look for someone who knows more than me :)

One more for proper RGB control I have been trying to control magichome LED controller with espurna firmware as it states Domoticz compatible but all it will do is turn it on and off, any change to colour or dim level will normally result in a switch off. As everyone else stated the widget has RGB picker but that does not seem to be sent out on MQTT. On a colour change it sends 2 messages one to nvalue 10 and one to nvalue 15 with seemingly random numbers although nvalue 15 seems to correspond to the dim level. Changing the colour always seems to affect the dim level also. Following json was from selecting a random colour of #7b1e87
`{
"Battery": 255,
"RSSI": 12,
"description": "",
"dtype": "Lighting Limitless/Applamp",
"id": "00082084",
"idx": 84,
"name": "LED",
"nvalue": 10,
"stype": "RGB",
"svalue1": "208",
"switchType": "Dimmer",
"unit": 1
},

{
"Battery": 255,
"RSSI": 12,
"description": "",
"dtype": "Lighting Limitless/Applamp",
"id": "00082084",
"idx": 84,
"name": "LED",
"nvalue": 15,
"stype": "RGB",
"svalue1": "53",
"switchType": "Dimmer",
"unit": 1
}`

With MiLight also send an off/on on colour change, but domoticz never store the last set colour. Right?

last set color will stored inside de milight itself

But how can I retrieve the colour?
I've same problem with hue or Yeelight bulbs/stripes.. :/

Best thing would be for domoticz to memorize the last set color and make it available via API :+1:

I've had another look at this and the numbers being sent are sort of correct for hue the problem is there are only 2 variables being sent and you need 3 to make sense of it hue, saturation and level. 10 is hue and I think 15 is level but it's no use without saturation.

Right :+1:
Can anyone of the domoticz's developers "illuminate" us? :)

+1 for this - i would love the current hue/rgbw to be retrievable via the JSON device query

Looks like this will likely be resolved by work being undertaken in https://github.com/domoticz/domoticz/issues/2078

Another +1 for this - I have some rgb lights (espurna) that use mqtt as their setting, and I can only turn them on or off because the mqtt message doesn't contain any info about the rgb value :( Even if it were in some weird format I could do an mqtt transform but without that data somewhere I can't even poll a json endpoint to do that.

+1 same problem here with MagicLed + Tasmota. Only on off work on mqtt. No color. No dim.
Suggestions?

2078 has been included, can we close this issue ?

I can confirm that the latest linuxserver/domoticz docker image has these fixes in, and I am now happily controlling my espurna RGBW devices with domoticz (with a sprinkling of node-red because the devices haven't been updated yet).

Thanks so much to all involved for pushing this and getting it implemented.

HI

I do confirm the RGB values are now available on the JSON reply so it can be incorporated on scripting.

Thanks again for the great support

The RGB values are available, but they do not match the color picker if you look carefully.
Pick a color, look at the RGB values, now change the level/brightness slider, the RGB values do not change.
If you use a RGBW switch, then you can see the Level change, but again the RGB do not. And with the information available there is no way to transpose the level % against the RGB.

Was this page helpful?
0 / 5 - 0 ratings