Hello,
Im very new to all this Domoticz, Im looking for getting a HUE bulb showing a specific color in dzVents
From the domoticz Log i get a setcolbrightnessvalue, when I set the color I want under Switches:
Status: setcolbrightnessvalue: ID: 1de, bri: 100, color: '{m: 2, RGB: 000000, CWWW: 6b94, CT: 148}'
I found this under:
API/JSONURL
Specify Domoticz JSON color object and brightness
Example: Specify color mode with a dim blue color
/json.htm?type=command¶m=setcolbrightnessvalue&idx=130&color={"m":3,"t":0,"r":0,"g":0,"b":50,"cw":0,"ww":0}&brightness=100
SO:
m should be set to: 2
r+g+b: 0?
How to replicate that color?
HUE/JSON Color
Moderator: leecollings
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: HUE/JSON Color
What about according to the dzVents wiki ?
Code: Select all
light = domoticz.devices("your RGBW devicename")
light.setRGB( red, green, blue )
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
-
- Posts: 7
- Joined: Tuesday 31 May 2016 12:41
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: HUE/JSON Color
But is it possible to make the setcolbrightnessvalue as I wrote with RGB?
I guess it only works with color and not white ambiance??
I guess it only works with color and not white ambiance??
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: HUE/JSON Color
I am not 100% sure but I don't think this is already implemented as a native dzVents method for the RGBWW devices. @dannybloe ?
If not yet implemented, you can use this.
If not yet implemented, you can use this.
Code: Select all
return {
on = { devices = { "triggerDevice" }},
logging = { level = domoticz.LOG_DEBUG,
marker = "setcolbrightnessvalue" },
execute = function(dz)
local colorTable = {} -- define and populate the colorTable
colorTable.m = 2 -- ColorMode [0 .. 4]
colorTable.t = 0 -- Color temperature [0 .. 255]
colorTable.r = 0 -- red level [0 .. 255]
colorTable.g = 0 -- greenlevel [0 .. 255]
colorTable.b = 0 -- blue level [0 .. 255]
colorTable.cw = 0 -- Cold white level [0 .. 255]
colorTable.ww = 0 -- Warm white level [0 .. 255]
local brightness = 97 -- Brightness [0 .. 100]
local deviceIDX = 157 -- your RGBWW device IDX
local colorString = "{" -- transform table contents into formatted string
for k,v in pairs(colorTable) do
colorString = colorString .. '"' .. k .. '":' .. v .. ","
end
colorString = colorString:sub(1, -2) .. "}" -- Remove last , and add }
local url = dz.settings["Domoticz url"] .. -- prepare url
"/json.htm?type=command¶m=setcolbrightnessvalue&idx=" .. deviceIDX ..
"&color=" .. colorString ..
"&brightness=" .. brightness
dz.log("colorTable: ".. colorString,dz.LOG_DEBUG)
dz.openURL(url)
end
}
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