
Thanks!
Moderator: leecollings
Code: Select all
local sceneCmd = 'curl -s -i -H "Accept: application/json" "http://192.168.1.4:8084/json.htm?type=command¶m=setcolbrightnessvalue&idx=20&hue=236&brightness=1&iswhite=false"'
os.execute(sceneCmd)
Code: Select all
return {
on = {
devices = {
'myDevice'
}
},
execute = function(domoticz, device)
domoticz.log('Device ' .. device.name .. ' was changed', domoticz.LOG_INFO)
end
}
Code: Select all
local sceneCmd = 'curl -s -i -H "Accept: application/json" "http://192.168.178.55:9898/json.htm?type=command¶m=setcolbrightnessvalue&idx=1&hue=236&brightness=100&iswhite=false"'
exec_success = os.execute(sceneCmd)
Code: Select all
Red = 0xFF0000 --(255,0,0)
GatewayColour = Red
local sceneCmd = 'curl -s -i -H "Accept: application/json" "http://192.168.10.1:8080/json.htm?type=command¶m=setcolbrightnessvalue&idx=1&hex=0x'..string.format("%x", GatewayColour)..'&brightness=100&iswhite=false"'
os.execute(sceneCmd)
Code: Select all
---------------------------------------------------------------------------------------------------
-- Gateway Colour
commandArray['Xiaomi_RGB_Gateway']='Set Level:'..tostring(GatewayBrightness) -- set brightness LED light from Gateway
-- change colour of gateway
local sceneCmd = 'curl -s -i -H "Accept: application/json" "http://192.168.178.62:8083/json.htm?
type=command¶m=setcolbrightnessvalue&idx=1&hex=0x'..string.format("%x", GatewayColour)..'&brightness=100&iswhite=false"'
os.execute(sceneCmd)
Users browsing this forum: No registered users and 0 guests