Hey folks,
Does anyone know how to set a RGBWW Domoticz virtual device via Lua script?
Eg: commandArray['LED'] = 'On' & Colortemp= 180 & Brightness = 80
or
Eg: commandArray['LED'] = 'On' & R=180 B=80 G=221 & Brightness = 80
Thanks
How to set device RGBWW via Lua script?
Moderator: leecollings
-
- Posts: 543
- Joined: Saturday 02 July 2016 5:17
- Target OS: Linux
- Domoticz version: Beta
- Contact:
How to set device RGBWW via Lua script?
Unless otherwise stated, all my code is released under GPL 3 license: https://www.gnu.org/licenses/gpl-3.0.en.html
-
- Posts: 722
- Joined: Friday 02 October 2015 12:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Finland
- Contact:
Re: How to set device RGBWW via Lua script?
You can use these examples as a reference: https://www.domoticz.com/wiki/Domoticz_ ... emperature
Also, a nice way to see the exact API call is to open developer console in a browser (e.g. in Chrome you can do it by right-click -> inspect), select network tab and then perform the action you want to script in the GUI.
Also, a nice way to see the exact API call is to open developer console in a browser (e.g. in Chrome you can do it by right-click -> inspect), select network tab and then perform the action you want to script in the GUI.
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: How to set device RGBWW via Lua script?
I don't think it can be done with a "native" commandArray command yet.ben53252642 wrote: ↑Thursday 20 September 2018 21:28 Does anyone know how to set a RGBWW Domoticz virtual device via Lua script?
In the domoticz database the field Color in table deviceStatus for RGBWW devices is like {"b":129,"cw":0,"g":211,"m":3,"r":254,"t":0,"ww":0}
If I peek in the dzVents device-adapter for RGBWW devices, the setRGB command is coded as a JSON call like
Code: Select all
url = domoticz.settings['Domoticz url'] ..
'/json.htm?param=setcolbrightnessvalue&type=command&idx=' .. device.id ..
'&hue=' .. tostring(h) ..
'&brightness=' .. tostring(b) ..
'&iswhite=' .. tostring(isWhite)
- Spoiler: show
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Who is online
Users browsing this forum: No registered users and 1 guest