after i updated domoticz to the last revision they io.popen is not respoinding anymore
time_HeyuDimmerRead: [string "commandArray = {}..."]:85: attempt to compare number with nil
any clue what to change to get the readout working again?
Code: Select all
-- Badkamer dimmer code
if (otherdevices['Badkamer'] ~= 'Off') and (otherdevices['BadkamerManual'] == 'Off') then
local f = io.popen("/usr/local/bin/heyu rawlevel g8")
local Dimstand = f:read()
local Dimnumber = tonumber(Dimstand);
if (Dimnumber>1) then
commandArray['Variable:BadkamerDim'] = tostring(Dimstand)
if PRINT_MODE == true then
print("Badkamer Dimmer staat aan:")
print("Badkamer RAWlevel ontvangen:" .. Dimstand)
DimPrecentage=math.ceil(Dimstand*1.613)
print("Badkamer level percentage calculated:" .. DimPrecentage)
end
end
if (Dimnumber==0) then
commandArray['Badkamer'] = 'Off'
end
end
if (otherdevices['Badkamer'] == 'Off') then
if PRINT_MODE == true then
print("Badkamer dimmer is Off")
end
end