Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Setting up the connection data
- FHTE = Net.FHttp("PHP_SERVER_IP")
- -- geting netatmo data
- response = FHTE:GET("/netatmo/welcome.php")
- if response ~= "" then
- -- decoding json string to table
- result = json.decode(response)
- time = result.body.homes[1].events[1].time;
- message = result.body.homes[1].events[1].message;
- time_current = result.body.homes[1].cameras[1].time_server;
- time = (os.date("%x - %X",time))
- time_current = (os.date("%x - %X",time_current))
- message = string.gsub(message, "<b>", "")
- message = string.gsub(message, "</b>", "")
- fibaro:call(705, "setProperty", "ui.time.value", time);
- fibaro:call(705, "setProperty", "ui.message.value", message);
- fibaro:call(705, "setProperty", "ui.timeserver.value", time_current);
- fibaro:setGlobal("Seen", message);
- if fibaro:getGlobalValue("Seen") == "NAME1 seen" then
- fibaro:call(705, "setProperty", "ui.name1.value", time);
- --fibaro:call(705, "setProperty", "currentIcon", 657)
- end
- --if fibaro:getGlobalValue("Seen") == "NAME2 seen" then
- -- fibaro:call(705, "setProperty", "ui.name2.value", time);
- -- --fibaro:call(705, "setProperty", "currentIcon", 658)
- --end
- fibaro:debug(time);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement