Page 1 of 1

Problem io.popen after domoticz update

Posted: Friday 30 March 2018 17:41
by franzelare
I run a script to ready my X10 dimmers using Heyu for a long time.
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

Re: Problem io.popen after domoticz update

Posted: Friday 30 March 2018 20:33
by SweetPants
Do you get the right answer when running from command line?

Re: Problem io.popen after domoticz update

Posted: Sunday 01 April 2018 10:30
by franzelare
found the issue, state engine did work from the command line but domoticz could not do request because of write access in the folder of the state engine