Page 1 of 1

Control RGB Leds via JSON command

Posted: Thursday 12 January 2017 13:31
by Swifty
Hi all,

I've recently switched to Domoticz from Openhab, so still early days finding my way around the interface etc.
I'm currently trying to add my RGB lights into Domoticz, these lights are WS2801 hooked up to Hyperion software on some Pi Zero's - I can set the lights to any color via sending a JSON message to the relevant light;

{"color":[36,34,96],"command":"color","priority":100}

What I'm trying to figure out is how I tie this to the Domoticz GUI - can anyone provide some clues as to how I get an RGB 'picker' device into the 'Switches' section of the web gui, and then pass the 'picked' RGB (or on/off status) to a script which can do the JSON post?

I can probably figure out the script part, it's just how I get the picker and the values from it! :)

Thanks

Re: Control RGB Leds via JSON command

Posted: Wednesday 25 January 2017 19:45
by Swifty
Is this not possible? - I'd have thought interacting with devices like this would have been easy, but can't figure out how i get the domoticz gui values to a script.

Re: Control RGB Leds via JSON command

Posted: Wednesday 25 January 2017 19:48
by Evelen
I'm not sure what you mean, but this is how you change color

Code: Select all

json.htm?type=command&param=setcolbrightnessvalue&idx=YYY&hue=XXX&brightness=ZZZ&iswhite=false
XXX=color
YYY=IDX
ZZZ=Dim

Re: Control RGB Leds via JSON command

Posted: Wednesday 25 January 2017 21:30
by NietGiftig
Swifty wrote: What I'm trying to figure out is how I tie this to the Domoticz GUI - can anyone provide some clues as to how I get an RGB 'picker' device into the 'Switches' section of the web gui, and then pass the 'picked' RGB (or on/off status) to a script which can do the JSON post?

I can probably figure out the script part, it's just how I get the picker and the values from it! :)
You are not the only one.
Many people are searching for a "virtual Color picker" with output to the database and/or json/mqtt.
With fields like RGB(W) (#FF00FF) / hue / Brightnes.
I have tried many virtual devices, but they lack output to json/mqtt.
The colorpicker is available in Domoticz but only for some specific hardware.
Just waiting for a dev who is able and has the time to make it happen.

Re: Control RGB Leds via JSON command

Posted: Monday 29 May 2017 15:29
by mrohner

Re: Control RGB Leds via JSON command

Posted: Friday 16 February 2018 14:06
by boydde3de
Did anyone ever find a solution for this?
I started to learn LUA to use domoticz better. I would like to use a dummy switch to send the rgbw values to my rgbw lights.

Re: Control RGB Leds via JSON command

Posted: Thursday 22 March 2018 18:58
by emontnemery
Please help test the build linked from here: https://github.com/domoticz/domoticz/issues/2078.
With it, it should be possible to create a "Dummy" RGB/RGBW/RGBWW device, and picked color will be stored in database and accessible through JSON Web API and announced oevr MQTT.