I ran into problem when trying to get setColor to work with my Philips Hue (idx = 767).
Everything works from GUI but when trying to set color temperature using dzVent I get an error in the log.
This is the script
Code: Select all
return {
on = {
devices = {
'Testswitch'
}
},
execute = function(domoticz, device)
domoticz.log('Device ' .. device.name .. ' was changed', domoticz.LOG_INFO)
domoticz.devices(767).setColor(0, 0, 0, domoticz.devices(767).level, 0, 0, 2, 4000)
end
}
When triggered this is the log.
Code: Select all
2021-01-02 19:32:18.628 Status: User: Admin (IP: 192.168.0.221) initiated a switch command (318/Testswitch/Set Level)
2021-01-02 19:32:18.790 Status: dzVents: Info: Handling events for: "Testswitch", value: "On"
2021-01-02 19:32:18.790 Status: dzVents: Info: ------ Start internal script: Färgtemperatur: Device: "Testswitch (DummyInterface)", Index: 318
2021-01-02 19:32:18.790 Status: dzVents: Info: Device Testswitch was changed
2021-01-02 19:32:18.792 Status: dzVents: Info: ------ Finished Färgtemperatur
2021-01-02 19:32:18.794 Status: EventSystem: Script event triggered: /home/richard/domoticz/dzVents/runtime/dzVents.lua
2021-01-02 19:32:18.792 Error: dzVents: Error: (3.0.19) Error parsing json to LUA table: (invalid json string)
2021-01-02 19:32:18.837 Error: Error opening url: http://127.0.0.1:/json.htm?type=command¶m=setcolbrightnessvalue&idx=767&brightness=99&color={"m":2,"t":4000,"cw":0,"ww":0,"r":0,"g":0,"b":0}
If I modify the URL and run it from my server it works fine.