Bah moi en tout cas ça merde avec ce code :
local status = ""
local ipx_entree_capteur = "4"
local ipx_ip = fibaro:get(fibaro:getSelfId(),"IPAddress")
HC2 = Net.FHttp(ipx_ip)
HC2:setBasicAuthentication("login", "pass")
response = HC2:GET("/api/xdevices.json?cmd=10")
string.gsub(response, "IN"..ipx_entree_capteur.."\":(%d+)", function(d) status = status .. d end)
if (status == "1") then
--fibaro:log("Porte ouverte")
fibaro:call(fibaro:getSelfId(), "setProperty", "currentIcon", "1032")
else
--fibaro:log("Porte fermée")
fibaro:call(fibaro:getSelfId(), "setProperty", "currentIcon", "1030")
end