This is a snip from a standard LUA script file that I use for the longest time within Domoticz:
Code: Select all
-- function to get information from receiver
function onkyo_status(command)
local result = {}
local output = io.popen ('onkyo '..command)
for line in output:lines() do
table.insert(result, line)
end
output:close()
return result
end
-- function to change settings receiver
function onkyo_change(command)
os.execute('/usr/local/bin/onkyo --host '..onkyohostip..' --port '..onkyohostport..' '..command)
end