RGB LED strip and json Topic is solved

Moderator: leecollings

Post Reply
franzelare
Posts: 139
Joined: Thursday 19 February 2015 21:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: RGB LED strip and json

Post by franzelare »

did you already figure out how to do this?
User avatar
gizmocuz
Posts: 2394
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: RGB LED strip and json

Post by gizmocuz »

Something like

[url]http://IPADDRESS:PORT/json.htm?type=command&param=setcolbrightnessvalue&idx=224&hex=FF00FF&brightness=100&iswhite=false[/url]
Quality outlives Quantity!
User avatar
gizmocuz
Posts: 2394
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: RGB LED strip and json

Post by gizmocuz »

Quality outlives Quantity!
franzelare
Posts: 139
Joined: Thursday 19 February 2015 21:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: RGB LED strip and json

Post 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
franzelare
Posts: 139
Joined: Thursday 19 February 2015 21:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: RGB LED strip and json

Post by franzelare »

you can also add &saturation= to complete the command set
franzelare
Posts: 139
Joined: Thursday 19 February 2015 21:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: RGB LED strip and json

Post 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..
User avatar
gizmocuz
Posts: 2394
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: RGB LED strip and json

Post 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...
Quality outlives Quantity!
franzelare
Posts: 139
Joined: Thursday 19 February 2015 21:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: RGB LED strip and json

Post 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)
Inso80
Posts: 12
Joined: Thursday 17 May 2018 13:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: RGB LED strip and json

Post 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 -.-
kimot
Posts: 104
Joined: Saturday 25 November 2017 17:18
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.8153
Location: Czech Rep.
Contact:

Re: RGB LED strip and json

Post by kimot »

One question.
How you send this "http" call from MySensors for example radionode ???
RPi2 Domoticz v 4.10717
10 x Sonoff Basic - ESPeasy
1 x Wemos D1 - ESPeasy
1 x Shelly Plus Plug S
1 x Sonoff S26 - ESPeasy
1 x Shelly 1
1 x MySensors HC-SR04
1 x MySenosrs wifi gateway
1 x RFLink
4x Cam IPC-T240H
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests