Problem io.popen after domoticz update Topic is solved

Moderator: leecollings

Post Reply
franzelare
Posts: 146
Joined: Thursday 19 February 2015 21:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Problem io.popen after domoticz update

Post 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
SweetPants

Re: Problem io.popen after domoticz update

Post by SweetPants »

Do you get the right answer when running from command line?
franzelare
Posts: 146
Joined: Thursday 19 February 2015 21:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Problem io.popen after domoticz update

Post 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
Post Reply