Control RGB Leds via JSON command

Moderator: leecollings

Post Reply
Swifty
Posts: 76
Joined: Saturday 31 December 2016 21:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Control RGB Leds via JSON command

Post 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
Swifty
Posts: 76
Joined: Saturday 31 December 2016 21:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Control RGB Leds via JSON command

Post 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.
Evelen
Posts: 234
Joined: Thursday 09 July 2015 12:03
Target OS: Linux
Domoticz version: 2.4538
Location: Norway
Contact:

Re: Control RGB Leds via JSON command

Post 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
NietGiftig
Posts: 121
Joined: Sunday 11 October 2015 8:50
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.6224
Location: Holland
Contact:

Re: Control RGB Leds via JSON command

Post 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.
RPI-2 + SSD / ESPEasy Sensors & Switches / Sonoff / RFLink / Action Switches / TP-Link switch / Node-Red / Reacticz
mrohner
Posts: 6
Joined: Saturday 29 April 2017 9:16
Target OS: NAS (Synology & others)
Domoticz version: 2020-2
Location: Switzerland
Contact:

Re: Control RGB Leds via JSON command

Post by mrohner »

boydde3de
Posts: 2
Joined: Friday 09 February 2018 18:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Control RGB Leds via JSON command

Post 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.
emontnemery
Posts: 38
Joined: Sunday 08 October 2017 13:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Control RGB Leds via JSON command

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests