but in domoticz log i have this error (one for brightness and second for rgb (looks like in path is wrong character "¶"
im using latest beta domoticz version
Code: Select all
2018-02-19 22:02:23.438 Error: Error opening url: http://127.0.0.1:8050/json.htm?type=command¶m=brightnessdown&idx=385
2018-02-19 22:02:28.849 Error: Error opening url: http://127.0.0.1:8050/json.htm?type=command¶m=setcolbrightnessvalue&idx=385&hue=0&brightness=100&iswhite=false
Code: Select all
return {
active = true,
on = {
devices = {
'XiaomSwitch2'
}
},
execute = function(domoticz, switch)
if (switch.state == 'Click' and domoticz.devices('Xiaomi RGB').state == 'Off') then
domoticz.log('light Xiaomi RGB')
domoticz.devices('Xiaomi RGB').switchOn()
elseif (switch.state == 'Click' and domoticz.devices('Xiaomi RGB').state == 'On') then
domoticz.log('dark Xiaomi RGB')
domoticz.devices('Xiaomi RGB').switchOff()
elseif (switch.state == 'Shake' and domoticz.devices('Xiaomi RGB').state == 'On') then
domoticz.log('test')
-- domoticz.devices('Xiaomi RGB').decreaseBrightness()
domoticz.devices('Xiaomi RGB').setRGB(255, 0, 0)
end
end
}