The Domoticz Gui works (although the setting of color temp cannot be saved) The command from the gui in the domoticz log is:
Code: Select all
Status: setcolbrightnessvalue: ID: 333, bri: 50, color: '{m: 2, RGB: 000000, CWWW: 7788, CT: 136}'
Moderator: leecollings
Code: Select all
Status: setcolbrightnessvalue: ID: 333, bri: 50, color: '{m: 2, RGB: 000000, CWWW: 7788, CT: 136}'
In dzVents 2.4.16 a couple of new methods for RGBW devices were introduced. Please experiment a bit with the new setHex, setHue and /or setColor methods (see the wiki)EddyG wrote: ↑Monday 01 April 2019 9:40 I have a Xioami zigbee lamp, which can be set by color temp and brightness.
The Domoticz Gui works (although the setting of color temp cannot be saved)
2019-04-01_09-42-04.png
The command from the gui in the domoticz log is:How do I accomplice this in DzVents? I am using domoticz 4.10580 with dzVents 2.4.16Code: Select all
Status: setcolbrightnessvalue: ID: 333, bri: 50, color: '{m: 2, RGB: 000000, CWWW: 7788, CT: 136}'
[Edit] You found it already !
Code: Select all
local light = dz.devices(333)
light.setColor(0,0,0, 50, 119, 136, 2, 136) -- setColor(r, g, b, br, cw, ww, m, t)
Code: Select all
2019-04-01 10:26:38.368 Status: dzVents: Error (2.4.16): An error occured when calling event handler slave overloop
2019-04-01 10:26:38.368 Status: dzVents: Error (2.4.16): ...domoticz/dzVents/runtime/device-adapters/rgbw_device.lua:176: attempt to index local 'ct' (a nil value)
That should nog happen. I assume the color field is not set.EddyG wrote: ↑Monday 01 April 2019 10:27 I tried a getColor() for this device,but that give an error:Code: Select all
2019-04-01 10:26:38.368 Status: dzVents: Error (2.4.16): An error occured when calling event handler slave overloop 2019-04-01 10:26:38.368 Status: dzVents: Error (2.4.16): ...domoticz/dzVents/runtime/device-adapters/rgbw_device.lua:176: attempt to index local 'ct' (a nil value)
Code: Select all
ID|HardwareID|DeviceID|Unit|Name|Used|Type|SubType|SwitchType|Favorite|SignalLevel|BatteryLevel|nValue|sValue|LastUpdate|Order|AddjValue|AddjMulti|AddjValue2|AddjMulti2|StrParam1|StrParam2|LastLevel|Protected|CustomImage|Description|Options|Color
819|33|0x00158d0002b7d689_light|46|Overloop lamp|1|241|8|7|0|4|255|0|80|2019-04-01 11:45:09|64|0.0|1.0|0.0|1.0|||80|0|0|||
Code: Select all
2019-04-05 13:32:01.866 Status: dzVents: Error (2.4.17): Color field not set for this device
Yes. In recent Beta's you will get a message that the color field is not set.
My understanding of setting color temperature for these type of devices is by /json.htm?param=setkelvinlevel&type=command&idx=nnnn&kelvin=[0-100]
waaren wrote: ↑Sunday 14 April 2019 13:41 Can you show me the output of http://domoticz_IP:domoticz_port/json.htm?type=devices&rid=nnnn
and the output of
sqlite> select * from devicestatus where id = nnnn;
after http://domoticz_IP:domoticz_port/json.htm?param=setkelvinlevel&type=command&idx=nnnn &kelvin=1
, http://domoticz_IP:domoticz_port/json.htm?param=setkelvinlevel&type=command&idx=nnnn &kelvin=66
and http://domoticz_IP:domoticz_port/json.htm?param=setkelvinlevel&type=command&idx=nnnn &kelvin=100
Thanks !
Code: Select all
{
"ActTime": 1555243812,
"AstrTwilightEnd": "22:42",
"AstrTwilightStart": "04:34",
"CivTwilightEnd": "21:08",
"CivTwilightStart": "06:08",
"DayLength": "13:49",
"NautTwilightEnd": "21:53",
"NautTwilightStart": "05:24",
"ServerTime": "2019-04-14 14:10:12",
"SunAtSouth": "13:05",
"Sunrise": "06:44",
"Sunset": "20:33",
"app_version": "4.10602",
"result": [
{
"AddjMulti": 1.0,
"AddjMulti2": 1.0,
"AddjValue": 0.0,
"AddjValue2": 0.0,
"BatteryLevel": 255,
"Color": "",
"CustomImage": 0,
"Data": "Off",
"Description": "",
"DimmerType": "abs",
"Favorite": 0,
"HardwareID": 33,
"HardwareName": "Zigbee",
"HardwareType": "Zigbee2MQTT",
"HardwareTypeVal": 94,
"HaveDimmer": true,
"HaveGroupCmd": false,
"HaveTimeout": false,
"ID": "0x00158d0002b7d689_light",
"Image": "Light",
"IsSubDevice": false,
"LastUpdate": "2019-04-14 14:09:08",
"Level": 49,
"LevelInt": 49,
"MaxDimLevel": 100,
"Name": "Overloop lamp",
"Notifications": "false",
"PlanID": "5",
"PlanIDs": [
5,
6
],
"Protected": false,
"ShowNotifications": true,
"SignalLevel": 3,
"Status": "Off",
"StrParam1": "",
"StrParam2": "",
"SubType": "WW",
"SwitchType": "Dimmer",
"SwitchTypeVal": 7,
"Timers": "false",
"Type": "Color Switch",
"TypeImg": "dimmer",
"Unit": 46,
"Used": 1,
"UsedByCamera": false,
"XOffset": "0",
"YOffset": "0",
"idx": "819"
}
],
"status": "OK",
"title": "Devices"
}
Code: Select all
819|33|0x00158d0002b7d689_light|46|Overloop lamp|1|241|8|7|0|3|255|0|49|2019-04-14 14:09:08|64|0.0|1.0|0.0|1.0|||49|0|0|||
Thx for having a look. Maybe the developer of Zigbee2MQTT can help here ?EddyG wrote: ↑Sunday 14 April 2019 14:23The data in the database is for all the kelvin settings the same, so it seems that that setting is not saved in the database. I think it should be saved in the last column 'Color' but it is not.Code: Select all
{ "result": [ { "Color": "", "HardwareType": "Zigbee2MQTT", } ], "status": "OK", "title": "Devices" }
Have a look at the dzVents wiki on how to create a script triggered by the dummy switch. In that script you can set the Ikea Tradfri LED bulb(RGB) to any color you like.
Code: Select all
return {
on = { devices = { "name of your custom button" }},
execute = function(dz, item)
Ikea = dz.devices(idx of your Ikea bulb)
if item.active then
Ikea.setRGB(255,0,0)
else
Ikea.switchOff()
end
end
}
Thanks, exactly what I needed!
The script is dzVents code and you saved it as a Lua script
Users browsing this forum: No registered users and 1 guest