Tak já si hrál se Zigbee2mqtt, ale jen základ.
Pre zobrazenie URL sa musíte prihlásiť
Nebo koukni na json v lua.
commandArray['OpenURL']=('http://'.. domoticz_ip..'/json.htm?type=command¶m=setcolbrightnessvalue&idx=34&color={"m":3,"t":0,"r":'..red..',"g":'..green..',"b":'..blue..',"cw":0,"ww":0}&brightness='..brightness)
Já mam tak rozsvícení gateway když je pohyb, ale chtěl jsem si nastavit barvu a jas + je to podle východu a západu slunce.
_______________________________________________________________________
-- v2 - on/off based on motion and time + delay
local light = 'Xiaomi RGB Gateway' -- name of the light
local domoticz_ip = '192.168.1.11:8080' -- ip and port domoticz
local motion_sensor ='Xiaomi Motion Sensor'
debug=true
-- default values
local brightness = '1'
local red = '255'
local green = '191'
local blue = '148'
local morning = timeofday['SunriseInMinutes']
local night =timeofday['SunsetInMinutes']
timenow = os.date("*t")
time_now = timenow.min + timenow.hour * 60
commandArray = {}
if (devicechanged[motion_sensor] == 'On') then
if (debug) then print("Pohyb") end
if (otherdevices[light] == 'Off') then
if (time_now < morning or time_now > night) then
if (debug) then print('Je noc') end
commandArray['OpenURL']=('http://'.. domoticz_ip..'/json.htm?type=command¶m=setcolbrightnessvalue&idx=34&color={"m":3,"t":0,"r":'..red..',"g":'..green..',"b":'..blue..',"cw":0,"ww":0}&brightness='..brightness)
print('*** Pohyb -> Rozsvit ***')
else
if (debug) then print('Je den') end
end
end
end
if (otherdevices[light] ~= 'Off' and otherdevices[motion_sensor] == 'Off' ) then
commandArray[light]='Off'
print ('*** Neni pohyb -> Zhasni ***')
end
return commandArray
Odesláno z mého MIX 2S pomocí Tapatalk