function dump(o)
   if type(o) == 'table' then
      local s = '{ '
      for k,v in pairs(o) do
         if type(k) ~= 'number' then k = '"'..k..'"' end
         s = s .. '['..k..'] = ' .. dump(v) .. ','
      end
      return s .. '} '
   else
      return tostring(o)
   end
end

function dumpKey(o, to_print)
   if type(o) == 'table' then
      for k,v in pairs(o) do
	  dumpKey(v, to_print..' '..k) 
      end
   else
      print(to_print..' '..tostring(o))
   end
end

json = (loadfile "/home/souti/domoticz/scripts/lua/JSON.lua")()

  local f = assert(io.open("/tmp/Devices.txt","r"))
  local livebox = f:read('*all')
  f:close()
  --Décodage ud fichier
  local jsonLivebox = json:decode(livebox)
  --print(dumpKey(jsonLivebox, ''))
devices = jsonLivebox["status"]
--print(dump(devices))
for k,status in pairs(devices) do
	print("---"..k.."-------"..status["Name"].."--"..tostring(status["Active"]))
	print(dumpKey(status, ''))
      --print("Name : "..status['name']) --.." IP : "..status['ipAddress'].." "..tostring(status['active']))
end
