Control RGB Leds via JSON command

Post Reply
Swifty
Posts: 81
Joined: Saturday 31 December 2016 22:03
Target OS: Raspberry Pi
Domoticz version:
Contact:

Control RGB Leds via JSON command

Post by Swifty » Thursday 12 January 2017 14:31

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: 81
Joined: Saturday 31 December 2016 22:03
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Control RGB Leds via JSON command

Post by Swifty » Wednesday 25 January 2017 20:45

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: 282
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 » Wednesday 25 January 2017 20:48

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

Re: Control RGB Leds via JSON command

Post by NietGiftig » Wednesday 25 January 2017 22:30

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: 3
Joined: Saturday 29 April 2017 9:16
Target OS: Windows
Domoticz version:
Contact:

Re: Control RGB Leds via JSON command

Post by mrohner » Monday 29 May 2017 15:29


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

Re: Control RGB Leds via JSON command

Post by boydde3de » Friday 16 February 2018 15:06

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: 74
Joined: Sunday 08 October 2017 13:50
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Control RGB Leds via JSON command

Post by emontnemery » Thursday 22 March 2018 19:58

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 1 guest