Page 1 of 1
Help needed with testing of updated color dimmer support
Posted: Thursday 22 March 2018 19:09
by emontnemery
Updated WW / RGB/ RGBW / RGBWW support, as discussed on github:
https://github.com/domoticz/domoticz/issues/2078
https://github.com/domoticz/domoticz/pull/2229
Summary:
- Color picker for dimmer updated with adjustable color temperature
- Possible to set colors other than fully saturated from Web UI / JSON Web API and MQTT
- Set color of device is stored in database and available through JSON Web API and MQTT
- Full color data used internally by Domoticz instead of hue + white level
- Hue stored in existing scenes and timers is translated during database upgrade
- All Domoticz hardware drivers updated to support new color format
API changes:
- Field "Color" added to "devices" JSON Web API
- Field "Color" added to MQTT status update from Domoticz
- Web API command "setcolbrightnessvalue" now accepts JSON formatted color data as well as hue
- Web API commands to set/get timers and set/get scene devices now accepts JSON formatted color data instead of hue
- JSON formatted color data passed to Python plugins instead of Hue
Please try the build linked at top of
https://github.com/domoticz/domoticz/pull/2229 with your hardware and report what works and what does not, either here or (preferably) on github.
Please include in test report:
- Which commit did you test
- What worked
- What did not work, including screenshot and log
Re: Help needed with testing of updated color dimmer support
Posted: Wednesday 25 April 2018 19:52
by Nautilus
emontnemery wrote: ↑Thursday 22 March 2018 19:09
[*] Web API command "setcolbrightnessvalue" now accepts JSON formatted color data as well as hue
Maybe I should open a new thread but at least the question relates to this...
In many of my lua scripts where I need a fast reaction, I've used os.execute follower by API call with curl. This has worked well until now, but the new syntax with special characters proved to be a challenge. I'm not sure how I should escape the special characters in Lua and even though there is all kinds of documentation available, none of the things I've tried have proven successful. I got it working on the command line with:
Code: Select all
curl 'http://127.0.0.1:30/json.htm?type=command¶m=setcolbrightnessvalue&idx=123&color=\{"m":1,"t":0,"r":0,"g":0,"b":0,"cw":255,"ww":255\}&brightness=50'
or if I need to refer to variable it must be
Code: Select all
curl "http://127.0.0.1:30/json.htm?type=command¶m=setcolbrightnessvalue&idx="'..variable..'"&color=\{\"m\":1,\"t\":0,\"r\":0,\"g\":0,\"b\":0,\"cw\":255,\"ww\":255\}&brightness=100"
But when I take this inside os.execute in a lua script I cannot find any working combination. Any help would be appreciated...

Re: Help needed with testing of updated color dimmer support
Posted: Wednesday 25 April 2018 22:28
by emontnemery
I'm not a lua user myself, but can't you just do something like:
Code: Select all
os.execute([[curl 'http://127.0.0.1:30/json.htm?type=command¶m=setcolbrightnessvalue&idx=123&color={"m":1,"t":0,"r":0,"g":0,"b":0,"cw":255,"ww":255}&brightness=50']])
Re: Help needed with testing of updated color dimmer support
Posted: Wednesday 25 April 2018 23:32
by Nautilus
emontnemery wrote: ↑Wednesday 25 April 2018 22:28
I'm not a lua user myself, but can't you just do something like:
Code: Select all
os.execute([[curl 'http://127.0.0.1:30/json.htm?type=command¶m=setcolbrightnessvalue&idx=123&color={"m":1,"t":0,"r":0,"g":0,"b":0,"cw":255,"ww":255}&brightness=50']])
Thanks, unfortunately I don't think this flies as I "need" (I assume) wrap the whole string within os.execute('xxxxx') to single quotes. If [[ ]] works instead, then that is a step forward but still when I refer to variable the syntax to my knowledge is '..variable..' (with single quotes) which poses a conflict in using single quotes around the url...?
edit: did some testing and [[ ]] led to syntax errors (unexpected symbol near char(194)). Still cannot get it to work...
edit2: probably some copy paste issue with the above error. I got rid of that, but even without the error it does not work.
Re: Help needed with testing of updated color dimmer support
Posted: Thursday 26 April 2018 11:07
by nixalsschrott
Using Domoticz Beta 9317 on Synology NAS
Fibaro FGRGBWM441 Zwave Modul
RGBW (CW) Stripe
When trying to adjust brightness with all three pickers, changes are done but jump back to maximum brightness very quickly. In other words - brightness adjustment is not working. Color picking seems to be working. Adjustment with four separated sliders is working too.
Log:
- Spoiler: show
- 2018-04-26 10:47:49.451 User: Admin initiated a switch command (93/Fibaro RGBW/On)
2018-04-26 10:48:07.155 setcolbrightnessvalue: ID: 5d, bri: 100, color: '{m: 3, RGB: 6bf9ff, CWWW: 0000, CT: 0}'
2018-04-26 10:48:11.646 setcolbrightnessvalue: ID: 5d, bri: 78, color: '{m: 3, RGB: 6bf9ff, CWWW: 0000, CT: 0}'
2018-04-26 10:48:17.457 setcolbrightnessvalue: ID: 5d, bri: 54, color: '{m: 3, RGB: 6bf9ff, CWWW: 0000, CT: 0}'
2018-04-26 10:48:19.621 setcolbrightnessvalue: ID: 5d, bri: 22, color: '{m: 3, RGB: 6bf9ff, CWWW: 0000, CT: 0}'
2018-04-26 10:48:23.383 setcolbrightnessvalue: ID: 5d, bri: 10, color: '{m: 3, RGB: 6bf9ff, CWWW: 0000, CT: 0}'
2018-04-26 10:48:27.267 setcolbrightnessvalue: ID: 5d, bri: 93, color: '{m: 3, RGB: 6bf9ff, CWWW: 0000, CT: 0}'
2018-04-26 10:48:31.306 setcolbrightnessvalue: ID: 5d, bri: 54, color: '{m: 3, RGB: 6bf9ff, CWWW: 0000, CT: 0}'
2018-04-26 10:48:35.147 setcolbrightnessvalue: ID: 5d, bri: 20, color: '{m: 3, RGB: 6bf9ff, CWWW: 0000, CT: 0}'
2018-04-26 10:48:41.326 OpenZWave: Received timeout notification from HomeID: 3807092512, NodeID: 18 (0x12)
2018-04-26 10:48:42.333 setcolbrightnessvalue: ID: 5d, bri: 12, color: '{m: 3, RGB: 6bf9ff, CWWW: 0000, CT: 0}'
2018-04-26 10:48:54.071 setcolbrightnessvalue: ID: 5d, bri: 98, color: '{m: 3, RGB: 6bf9ff, CWWW: 0000, CT: 0}'
2018-04-26 10:48:58.812 OpenZWave: Received timeout notification from HomeID: 3807092512, NodeID: 18 (0x12)
2018-04-26 10:49:02.181 setcolbrightnessvalue: ID: 5d, bri: 62, color: '{m: 3, RGB: 6bf9ff, CWWW: 0000, CT: 0}'
2018-04-26 10:49:07.777 setcolbrightnessvalue: ID: 5d, bri: 62, color: '{m: 3, RGB: 6bff28, CWWW: 0000, CT: 0}'
2018-04-26 10:49:08.947 OpenZWave: Received timeout notification from HomeID: 3807092512, NodeID: 18 (0x12)
2018-04-26 10:49:19.996 setcolbrightnessvalue: ID: 5d, bri: 28, color: '{m: 3, RGB: 6bff28, CWWW: 0000, CT: 0}'
2018-04-26 10:49:26.210 setcolbrightnessvalue: ID: 5d, bri: 16, color: '{m: 3, RGB: 6bff28, CWWW: 0000, CT: 0}'
2018-04-26 10:49:39.720 setcolbrightnessvalue: ID: 5d, bri: 55, color: '{m: 3, RGB: 6bff28, CWWW: 0000, CT: 0}'
2018-04-26 10:49:42.706 setcolbrightnessvalue: ID: 5d, bri: 78, color: '{m: 3, RGB: 6bff28, CWWW: 0000, CT: 0}'
2018-04-26 10:49:46.325 setcolbrightnessvalue: ID: 5d, bri: 78, color: '{m: 3, RGB: 8343ff, CWWW: 0000, CT: 0}'
2018-04-26 10:49:53.160 setcolbrightnessvalue: ID: 5d, bri: 78, color: '{m: 3, RGB: ff47de, CWWW: 0000, CT: 0}'
2018-04-26 10:49:58.415 setcolbrightnessvalue: ID: 5d, bri: 44, color: '{m: 3, RGB: ff47de, CWWW: 0000, CT: 0}'
2018-04-26 10:49:58.583 OpenZWave: Received timeout notification from HomeID: 3807092512, NodeID: 18 (0x12)
2018-04-26 10:50:05.814 setcolbrightnessvalue: ID: 5d, bri: 44, color: '{m: 2, RGB: 000000, CWWW: d926, CT: 38}'
2018-04-26 10:50:12.150 setcolbrightnessvalue: ID: 5d, bri: 97, color: '{m: 2, RGB: 000000, CWWW: d926, CT: 38}'
2018-04-26 10:50:16.317 setcolbrightnessvalue: ID: 5d, bri: 17, color: '{m: 2, RGB: 000000, CWWW: d926, CT: 38}'
2018-04-26 10:50:19.976 setcolbrightnessvalue: ID: 5d, bri: 52, color: '{m: 2, RGB: 000000, CWWW: d926, CT: 38}'
2018-04-26 10:50:26.316 setcolbrightnessvalue: ID: 5d, bri: 85, color: '{m: 2, RGB: 000000, CWWW: d926, CT: 38}'
2018-04-26 10:50:30.050 setcolbrightnessvalue: ID: 5d, bri: 85, color: '{m: 2, RGB: 000000, CWWW: 6c93, CT: 147}'
2018-04-26 10:50:35.440 setcolbrightnessvalue: ID: 5d, bri: 85, color: '{m: 2, RGB: 000000, CWWW: 23dc, CT: 220}'
2018-04-26 10:50:40.314 setcolbrightnessvalue: ID: 5d, bri: 85, color: '{m: 2, RGB: 000000, CWWW: 07f8, CT: 248}'
2018-04-26 10:50:42.920 setcolbrightnessvalue: ID: 5d, bri: 42, color: '{m: 2, RGB: 000000, CWWW: 07f8, CT: 248}'
2018-04-26 10:50:49.976 setcolbrightnessvalue: ID: 5d, bri: 42, color: '{m: 4, RGB: eafffa, CWWW: 07f8, CT: 248}'
2018-04-26 10:50:59.130 setcolbrightnessvalue: ID: 5d, bri: 42, color: '{m: 4, RGB: 74ff2b, CWWW: 07f8, CT: 248}'
2018-04-26 10:51:13.492 setcolbrightnessvalue: ID: 5d, bri: 42, color: '{m: 4, RGB: 74ff2b, CWWW: 0358, CT: 248}'
2018-04-26 10:51:18.546 setcolbrightnessvalue: ID: 5d, bri: 42, color: '{m: 4, RGB: 74ff2b, CWWW: 023d, CT: 248}'
2018-04-26 10:51:26.636 setcolbrightnessvalue: ID: 5d, bri: 94, color: '{m: 4, RGB: 74ff2b, CWWW: 023d, CT: 248}'
2018-04-26 10:51:35.042 setcolbrightnessvalue: ID: 5d, bri: 16, color: '{m: 4, RGB: 74ff2b, CWWW: 023d, CT: 248}'
2018-04-26 10:51:38.680 setcolbrightnessvalue: ID: 5d, bri: 16, color: '{m: 4, RGB: 74ff2b, CWWW: 142a, CT: 173}'
2018-04-26 10:51:39.344 setcolbrightnessvalue: ID: 5d, bri: 16, color: '{m: 4, RGB: 74ff2b, CWWW: 241a, CT: 108}'
2018-04-26 10:51:54.285 User: Admin initiated a switch command (95/Fibaro Level Red/Set Level)
2018-04-26 10:51:55.390 User: Admin initiated a switch command (95/Fibaro Level Red/Set Level)
2018-04-26 10:51:58.513 User: Admin initiated a switch command (96/Fibaro Level Green/Set Level)
2018-04-26 10:51:59.410 User: Admin initiated a switch command (96/Fibaro Level Green/Set Level)
2018-04-26 10:52:01.062 User: Admin initiated a switch command (96/Fibaro Level Green/Set Level)
2018-04-26 10:52:03.102 User: Admin initiated a switch command (97/Fibaro Level Blue/Set Level)
2018-04-26 10:52:07.341 User: Admin initiated a switch command (98/Fibaro Level White/Set Level)
2018-04-26 10:52:14.911 User: Admin initiated a switch command (97/Fibaro Level Blue/Set Level)
2018-04-26 10:52:25.482 User: Admin initiated a switch command (97/Fibaro Level Blue/Set Level)
2018-04-26 10:52:27.620 User: Admin initiated a switch command (95/Fibaro Level Red/Set Level)
2018-04-26 10:52:48.730 User: Admin initiated a switch command (93/Fibaro RGBW/Off)
Re: Help needed with testing of updated color dimmer support
Posted: Saturday 28 April 2018 12:55
by emontnemery
<Deleted>
Re: Help needed with testing of updated color dimmer support
Posted: Sunday 13 May 2018 16:05
by emontnemery
nixalsschrott wrote: ↑Thursday 26 April 2018 11:07
Using Domoticz Beta 9317 on Synology NAS
Fibaro FGRGBWM441 Zwave Modul
RGBW (CW) Stripe
When trying to adjust brightness with all three pickers, changes are done but jump back to maximum brightness very quickly. In other words - brightness adjustment is not working. Color picking seems to be working. Adjustment with four separated sliders is working too.
Log:
- Spoiler: show
- 2018-04-26 10:47:49.451 User: Admin initiated a switch command (93/Fibaro RGBW/On)
2018-04-26 10:48:07.155 setcolbrightnessvalue: ID: 5d, bri: 100, color: '{m: 3, RGB: 6bf9ff, CWWW: 0000, CT: 0}'
2018-04-26 10:48:11.646 setcolbrightnessvalue: ID: 5d, bri: 78, color: '{m: 3, RGB: 6bf9ff, CWWW: 0000, CT: 0}'
2018-04-26 10:48:17.457 setcolbrightnessvalue: ID: 5d, bri: 54, color: '{m: 3, RGB: 6bf9ff, CWWW: 0000, CT: 0}'
2018-04-26 10:48:19.621 setcolbrightnessvalue: ID: 5d, bri: 22, color: '{m: 3, RGB: 6bf9ff, CWWW: 0000, CT: 0}'
2018-04-26 10:48:23.383 setcolbrightnessvalue: ID: 5d, bri: 10, color: '{m: 3, RGB: 6bf9ff, CWWW: 0000, CT: 0}'
2018-04-26 10:48:27.267 setcolbrightnessvalue: ID: 5d, bri: 93, color: '{m: 3, RGB: 6bf9ff, CWWW: 0000, CT: 0}'
2018-04-26 10:48:31.306 setcolbrightnessvalue: ID: 5d, bri: 54, color: '{m: 3, RGB: 6bf9ff, CWWW: 0000, CT: 0}'
2018-04-26 10:48:35.147 setcolbrightnessvalue: ID: 5d, bri: 20, color: '{m: 3, RGB: 6bf9ff, CWWW: 0000, CT: 0}'
2018-04-26 10:48:41.326 OpenZWave: Received timeout notification from HomeID: 3807092512, NodeID: 18 (0x12)
2018-04-26 10:48:42.333 setcolbrightnessvalue: ID: 5d, bri: 12, color: '{m: 3, RGB: 6bf9ff, CWWW: 0000, CT: 0}'
2018-04-26 10:48:54.071 setcolbrightnessvalue: ID: 5d, bri: 98, color: '{m: 3, RGB: 6bf9ff, CWWW: 0000, CT: 0}'
2018-04-26 10:48:58.812 OpenZWave: Received timeout notification from HomeID: 3807092512, NodeID: 18 (0x12)
2018-04-26 10:49:02.181 setcolbrightnessvalue: ID: 5d, bri: 62, color: '{m: 3, RGB: 6bf9ff, CWWW: 0000, CT: 0}'
2018-04-26 10:49:07.777 setcolbrightnessvalue: ID: 5d, bri: 62, color: '{m: 3, RGB: 6bff28, CWWW: 0000, CT: 0}'
2018-04-26 10:49:08.947 OpenZWave: Received timeout notification from HomeID: 3807092512, NodeID: 18 (0x12)
2018-04-26 10:49:19.996 setcolbrightnessvalue: ID: 5d, bri: 28, color: '{m: 3, RGB: 6bff28, CWWW: 0000, CT: 0}'
2018-04-26 10:49:26.210 setcolbrightnessvalue: ID: 5d, bri: 16, color: '{m: 3, RGB: 6bff28, CWWW: 0000, CT: 0}'
2018-04-26 10:49:39.720 setcolbrightnessvalue: ID: 5d, bri: 55, color: '{m: 3, RGB: 6bff28, CWWW: 0000, CT: 0}'
2018-04-26 10:49:42.706 setcolbrightnessvalue: ID: 5d, bri: 78, color: '{m: 3, RGB: 6bff28, CWWW: 0000, CT: 0}'
2018-04-26 10:49:46.325 setcolbrightnessvalue: ID: 5d, bri: 78, color: '{m: 3, RGB: 8343ff, CWWW: 0000, CT: 0}'
2018-04-26 10:49:53.160 setcolbrightnessvalue: ID: 5d, bri: 78, color: '{m: 3, RGB: ff47de, CWWW: 0000, CT: 0}'
2018-04-26 10:49:58.415 setcolbrightnessvalue: ID: 5d, bri: 44, color: '{m: 3, RGB: ff47de, CWWW: 0000, CT: 0}'
2018-04-26 10:49:58.583 OpenZWave: Received timeout notification from HomeID: 3807092512, NodeID: 18 (0x12)
2018-04-26 10:50:05.814 setcolbrightnessvalue: ID: 5d, bri: 44, color: '{m: 2, RGB: 000000, CWWW: d926, CT: 38}'
2018-04-26 10:50:12.150 setcolbrightnessvalue: ID: 5d, bri: 97, color: '{m: 2, RGB: 000000, CWWW: d926, CT: 38}'
2018-04-26 10:50:16.317 setcolbrightnessvalue: ID: 5d, bri: 17, color: '{m: 2, RGB: 000000, CWWW: d926, CT: 38}'
2018-04-26 10:50:19.976 setcolbrightnessvalue: ID: 5d, bri: 52, color: '{m: 2, RGB: 000000, CWWW: d926, CT: 38}'
2018-04-26 10:50:26.316 setcolbrightnessvalue: ID: 5d, bri: 85, color: '{m: 2, RGB: 000000, CWWW: d926, CT: 38}'
2018-04-26 10:50:30.050 setcolbrightnessvalue: ID: 5d, bri: 85, color: '{m: 2, RGB: 000000, CWWW: 6c93, CT: 147}'
2018-04-26 10:50:35.440 setcolbrightnessvalue: ID: 5d, bri: 85, color: '{m: 2, RGB: 000000, CWWW: 23dc, CT: 220}'
2018-04-26 10:50:40.314 setcolbrightnessvalue: ID: 5d, bri: 85, color: '{m: 2, RGB: 000000, CWWW: 07f8, CT: 248}'
2018-04-26 10:50:42.920 setcolbrightnessvalue: ID: 5d, bri: 42, color: '{m: 2, RGB: 000000, CWWW: 07f8, CT: 248}'
2018-04-26 10:50:49.976 setcolbrightnessvalue: ID: 5d, bri: 42, color: '{m: 4, RGB: eafffa, CWWW: 07f8, CT: 248}'
2018-04-26 10:50:59.130 setcolbrightnessvalue: ID: 5d, bri: 42, color: '{m: 4, RGB: 74ff2b, CWWW: 07f8, CT: 248}'
2018-04-26 10:51:13.492 setcolbrightnessvalue: ID: 5d, bri: 42, color: '{m: 4, RGB: 74ff2b, CWWW: 0358, CT: 248}'
2018-04-26 10:51:18.546 setcolbrightnessvalue: ID: 5d, bri: 42, color: '{m: 4, RGB: 74ff2b, CWWW: 023d, CT: 248}'
2018-04-26 10:51:26.636 setcolbrightnessvalue: ID: 5d, bri: 94, color: '{m: 4, RGB: 74ff2b, CWWW: 023d, CT: 248}'
2018-04-26 10:51:35.042 setcolbrightnessvalue: ID: 5d, bri: 16, color: '{m: 4, RGB: 74ff2b, CWWW: 023d, CT: 248}'
2018-04-26 10:51:38.680 setcolbrightnessvalue: ID: 5d, bri: 16, color: '{m: 4, RGB: 74ff2b, CWWW: 142a, CT: 173}'
2018-04-26 10:51:39.344 setcolbrightnessvalue: ID: 5d, bri: 16, color: '{m: 4, RGB: 74ff2b, CWWW: 241a, CT: 108}'
2018-04-26 10:51:54.285 User: Admin initiated a switch command (95/Fibaro Level Red/Set Level)
2018-04-26 10:51:55.390 User: Admin initiated a switch command (95/Fibaro Level Red/Set Level)
2018-04-26 10:51:58.513 User: Admin initiated a switch command (96/Fibaro Level Green/Set Level)
2018-04-26 10:51:59.410 User: Admin initiated a switch command (96/Fibaro Level Green/Set Level)
2018-04-26 10:52:01.062 User: Admin initiated a switch command (96/Fibaro Level Green/Set Level)
2018-04-26 10:52:03.102 User: Admin initiated a switch command (97/Fibaro Level Blue/Set Level)
2018-04-26 10:52:07.341 User: Admin initiated a switch command (98/Fibaro Level White/Set Level)
2018-04-26 10:52:14.911 User: Admin initiated a switch command (97/Fibaro Level Blue/Set Level)
2018-04-26 10:52:25.482 User: Admin initiated a switch command (97/Fibaro Level Blue/Set Level)
2018-04-26 10:52:27.620 User: Admin initiated a switch command (95/Fibaro Level Red/Set Level)
2018-04-26 10:52:48.730 User: Admin initiated a switch command (93/Fibaro RGBW/Off)
Can you please open an issue on
https://github.com/domoticz/domoticz?
Also, which OS are you on (Windows, Linux x86, Linux Raspberry Pi)?
Re: Help needed with testing of updated color dimmer support
Posted: Monday 18 January 2021 21:55
by darrepac
Nautilus wrote: ↑Wednesday 25 April 2018 19:52
emontnemery wrote: ↑Thursday 22 March 2018 19:09
[*] Web API command "setcolbrightnessvalue" now accepts JSON formatted color data as well as hue
Maybe I should open a new thread but at least the question relates to this...
In many of my lua scripts where I need a fast reaction, I've used os.execute follower by API call with curl. This has worked well until now, but the new syntax with special characters proved to be a challenge. I'm not sure how I should escape the special characters in Lua and even though there is all kinds of documentation available, none of the things I've tried have proven successful. I got it working on the command line with:
Code: Select all
curl 'http://127.0.0.1:30/json.htm?type=command¶m=setcolbrightnessvalue&idx=123&color=\{"m":1,"t":0,"r":0,"g":0,"b":0,"cw":255,"ww":255\}&brightness=50'
or if I need to refer to variable it must be
Code: Select all
curl "http://127.0.0.1:30/json.htm?type=command¶m=setcolbrightnessvalue&idx="'..variable..'"&color=\{\"m\":1,\"t\":0,\"r\":0,\"g\":0,\"b\":0,\"cw\":255,\"ww\":255\}&brightness=100"
But when I take this inside os.execute in a lua script I cannot find any working combination. Any help would be appreciated...
I am fighting with the same issue: finding the right escape caracters... did you find the way?
Re: Help needed with testing of updated color dimmer support
Posted: Monday 18 January 2021 23:15
by Nautilus
darrepac wrote: ↑Monday 18 January 2021 21:55
I am fighting with the same issue: finding the right escape caracters... did you find the way?
I think this syntax proved to be working in the end, using urlencoding instead of escaping special characters:
Code: Select all
os.execute('curl "http://127.0.0.1:30/json.htm?brightness=100&color=%7B%22m%22:1,%22t%22:0,%22r%22:0,%22g%22:0,%22b%22:0,%22cw%22:255,%22ww%22:255%7D&idx=469¶m=setcolbrightnessvalue&type=command
In dzVents one could use:
Code: Select all
domoticz.openURL('http://127.0.0.1:30/json.htm?type=command¶m=setcolbrightnessvalue&idx=168&color={%22m%22:2,%22t%22:215,%22r%22:0,%22g%22:0,%22b%22:0,%22cw%22:40,%22ww%22:215}&brightness=100')
and similar syntax of course in Blockly...
Re: Help needed with testing of updated color dimmer support
Posted: Monday 18 January 2021 23:47
by waaren
Nautilus wrote: ↑Monday 18 January 2021 23:15
In dzVents one could use:
Code: Select all
domoticz.openURL('http://127.0.0.1:30/json.htm?type=command¶m=setcolbrightnessvalue&idx=168&color={%22m%22:2,%22t%22:215,%22r%22:0,%22g%22:0,%22b%22:0,%22cw%22:40,%22ww%22:215}&brightness=100')
In dzVents you can use the method
setColor(r, g, b, br, cw, ww, m, t):
Function.
Sets the light to requested color. r, g, b required, others optional.
Which does all the escape stuff for you and hides the nitty gritty so you can use your time for more interesting work.
Re: Help needed with testing of updated color dimmer support
Posted: Tuesday 19 January 2021 12:49
by darrepac
Nautilus wrote: ↑Monday 18 January 2021 23:15
darrepac wrote: ↑Monday 18 January 2021 21:55
I am fighting with the same issue: finding the right escape caracters... did you find the way?
I think this syntax proved to be working in the end, using urlencoding instead of escaping special characters:
Code: Select all
os.execute('curl "http://127.0.0.1:30/json.htm?brightness=100&color=%7B%22m%22:1,%22t%22:0,%22r%22:0,%22g%22:0,%22b%22:0,%22cw%22:255,%22ww%22:255%7D&idx=469¶m=setcolbrightnessvalue&type=command
In dzVents one could use:
Code: Select all
domoticz.openURL('http://127.0.0.1:30/json.htm?type=command¶m=setcolbrightnessvalue&idx=168&color={%22m%22:2,%22t%22:215,%22r%22:0,%22g%22:0,%22b%22:0,%22cw%22:40,%22ww%22:215}&brightness=100')
and similar syntax of course in Blockly...
On my side I got it working like this in lua:
Code: Select all
url = "'http://192.168.0.19:9090/json.htm?type=command¶m=setcolbrightnessvalue&idx=215&brightness=" .. DimLevel .. "'"
url = url .. " -d " .. 'color=\'{"m":' .. colormode .. ',"t":' .. colortemp .. ',"r":' .. rgbRedValue .. ',"g":' .. rgbGreenValue .. ',"b":' .. rgbBlueValue .. ',"cw":' .. coldwhite .. ',"ww":' .. warmwhite ..'}\''
cmd = "curl " .. url
out = assert(io.popen(cmd))