Problem io.popen after domoticz update Topic is solved

Post Reply
franzelare
Posts: 145
Joined: Thursday 19 February 2015 22:48
Target OS: Raspberry Pi
Domoticz version:
Contact:

Problem io.popen after domoticz update

Post by franzelare » Friday 30 March 2018 17:41

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
Posts: 2066
Joined: Friday 12 July 2013 21:24
Target OS: Linux
Domoticz version: V3.9651
Location: The Netherlands
Contact:

Re: Problem io.popen after domoticz update

Post by SweetPants » Friday 30 March 2018 20:33

Do you get the right answer when running from command line?
Ubuntu 16.04.3 LTS, Intel NUC, MySensors 2.3.0-alpha, Pro Mini 3.3/8M RFM69(HW), ESP8266 (SDK2.2.0), Sonoff, RFLink, RFXcom, MQTT, NodeRed, Domoticz Beta (source)

franzelare
Posts: 145
Joined: Thursday 19 February 2015 22:48
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Problem io.popen after domoticz update

Post by franzelare » Sunday 01 April 2018 10:30

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

Who is online

Users browsing this forum: No registered users and 4 guests