Page 1 of 1

Re: RGB LED strip and json

Posted: Sunday 13 March 2016 13:15
by franzelare
did you already figure out how to do this?

Re: RGB LED strip and json

Posted: Sunday 13 March 2016 13:33
by gizmocuz
Something like

[url]http://IPADDRESS:PORT/json.htm?type=command&param=setcolbrightnessvalue&idx=224&hex=FF00FF&brightness=100&iswhite=false[/url]

Re: RGB LED strip and json

Posted: Sunday 13 March 2016 13:34
by gizmocuz

Re: RGB LED strip and json

Posted: Monday 14 March 2016 15:08
by franzelare
The hex value didn't work, I get an error back
I checked the topic and tested a bit, only had to convert the values from HUE lights before I could feed them back in to domoticz, but now I can set the led strip using json commands and a bash script.

only on a synology I get a timeout when I try to directly execute the command
so I have a work around now by calling a bash script from the lua script to change the led strip

Re: RGB LED strip and json

Posted: Monday 14 March 2016 15:43
by franzelare
you can also add &saturation= to complete the command set

Re: RGB LED strip and json

Posted: Tuesday 15 March 2016 22:48
by franzelare
hmmm, when looking into detail, I don't get the same color on the LED strip when I put in the hue/sat/bri as when I use the rgb values in domoticz
but when I send the same values to the hue lamp, the colors stay the same, so there is no color conversion mistake before i put the data in
and the hex command doesn't seem to work
gizmocuz: is the hex command supported in all versions? since my nas is still running an older version..

Re: RGB LED strip and json

Posted: Wednesday 16 March 2016 8:18
by gizmocuz
I think it is supported in the last 300 versions.... for sure from the latest stable version
Maybe i got the command wrong.. do you get an error when you enter the json url in the browser ?
It should work, it converts internally the hex to hue again...

Re: RGB LED strip and json

Posted: Wednesday 16 March 2016 11:11
by franzelare
Ah, that's the trick, from a new release that I run on a Pi I can send hex code
but there is a mistake in the hex string send

when I send FF00FF in the hex string, the string recieved by the device is FF00FBrsion
String hexstring = message.getString();
Serial.println(hexstring);

so Blue is not correct al the time due to the string send
like FF000F will end up as FF0011rsion

now I also see why I get the wrong values when I send hue sat and bri to the RGB strip
(this is now in release 3.4834)

Re: RGB LED strip and json

Posted: Tuesday 05 June 2018 17:47
by Inso80
As the last post is around two years old, and it seems the "bug" is not fixed - is something else wrong with "setcolbrightnessvalue"?

No matter if send through browser or Domoticz script, f.e.

Code: Select all

http://192.168.178.200:8080/json.htm?type=command&param=setcolbrightnessvalue&idx=51&hex=000000
results in

Code: Select all

TSF:MSG:READ,0-0-1,s=1,c=1,t=40,pt=0,l=6,sg=0:FFFFFF
only FFFFFF is transmitted fine, every other hex value is somehow converted. Also tried brightness and so on, does not seem to make a difference.

EDIT: as it is all about JSON:

Code: Select all

http://192.168.178.200:8080/json.htm?type=command&param=setcolbrightnessvalue&idx=51&color={"m":3,"t":0,"r":0,"g":0,"b":50,"cw":0,"ww":0}&brightness=100
f.e results in status "ERR" - it is an exact copy of the JSON example on the Domotics wiki

EDIT 2 :

Also, choosing a value from the color table in Domoticz results in false hex value received by the node -.-

Re: RGB LED strip and json

Posted: Friday 15 June 2018 10:39
by kimot
One question.
How you send this "http" call from MySensors for example radionode ???