Code: Select all
time = os.date("*t")
mins = time.min + time.hour * 60
commandArray = {}
libs = require("libs")
-- Coop Temp OSD
Coop = otherdevices_temperature['Coop Temp']*9/5+32
Coop = libs.round(Coop,0)
if (Coop ~= tonumber(uservariables["Coop"])) then
commandArray["Variable:Coop"]=tostring(Coop)
commandArray['OpenURL'] = uservariables['camlogin'] .. '@192.168.1.55/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].CustomTitle[1].Text=' .. tostring(Coop) .. '°F'
print('Updating Coop Temp OSD')
end
-- Run Temp OSD
Run = otherdevices_temperature['Coop Temp']*9/5+32
Run = libs.round(Run,0)
if (Run ~= tonumber(uservariables["Run"])) then
commandArray["Variable:Run"]=tostring(Run)
commandArray['OpenURL'] = uservariables['camlogin'] .. '@192.168.1.56/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].CustomTitle[1].Text=' .. tostring(Run) .. '°F'
print('Updating Run Temp OSD')
end
-- Day/Night Video Profile Switching
if (mins >= timeofday['SunsetInMinutes']) and (tonumber(uservariables["ODCam-Profile"]) ~= 1) then
print("Switching Outdoor Cameras to Night Profile.")
commandArray[1]={ ['OpenURL'] = uservariables['camlogin'] .. '@192.168.1.52/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].NightOptions.SwitchMode=3' }
commandArray[2]={ ['OpenURL'] = uservariables['camlogin'] .. '@192.168.1.53/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].NightOptions.SwitchMode=3' }
commandArray[3]={ ['OpenURL'] = uservariables['camlogin'] .. '@192.168.1.54/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].NightOptions.SwitchMode=3' }
commandArray[4]={ ['OpenURL'] = uservariables['camlogin'] .. '@192.168.1.55/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].NightOptions.SwitchMode=3' }
commandArray[5]={ ['OpenURL'] = uservariables['camlogin'] .. '@192.168.1.56/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].NightOptions.SwitchMode=3' }
commandArray[6]={ ["Variable:ODCam-Profile"] = "1" }
elseif (mins >= timeofday['SunriseInMinutes']) and (tonumber(uservariables["ODCam-Profile"]) ~= 0) and (mins < timeofday['SunsetInMinutes']) then
print("Switching Outdoor Cameras to Day Profile.")
commandArray[1]={ ['OpenURL'] = uservariables['camlogin'] .. '@192.168.1.52/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].NightOptions.SwitchMode=0' }
commandArray[2]={ ['OpenURL'] = uservariables['camlogin'] .. '@192.168.1.53/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].NightOptions.SwitchMode=0' }
commandArray[3]={ ['OpenURL'] = uservariables['camlogin'] .. '@192.168.1.54/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].NightOptions.SwitchMode=0' }
commandArray[4]={ ['OpenURL'] = uservariables['camlogin'] .. '@192.168.1.55/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].NightOptions.SwitchMode=0' }
commandArray[5]={ ['OpenURL'] = uservariables['camlogin'] .. '@192.168.1.56/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].NightOptions.SwitchMode=0' }
commandArray[6]={ ["Variable:ODCam-Profile"] = "0" }
end
return commandArray
Everything works great, except the only text overlay command that works is whatever is Second. If I comment out either one, the other one works just fine. If I swap positions, the second one works, so I know the actual code is good.
Any ideas as to how I can get both temperature commands to run? This particular issue only affects the temp commands. The profile switching works no matter what, even though it's last in line.
Thanks