[quote=“ustredna, post:1, topic:198285”]i need read this some JSON data and store into variable as temperature, status, …
and i need automatically refresh this data each 5 minutes[/quote]
This is very easy if you use a JSON decoder. Fortunately, Vera comes with one these days called dkjson. For example:
local json = require "dkjson"
local j = [[
{"501":"34.1 °C flow","502":"0 % Power","503":"24 °C Shaft","504":"0 kW Power","505":"18.2 kg Hopper","506":"0 Lx Light",
"507":"Error no pellets ","508":"16/01-2018 12:22:30","521":"0 °C Return","522":"0 liter/hour Flow","524":"0 °C External temperature",
"525":"54 °C Temperature DHW","526":"15.7 % Actual oxygen","527":"0 % Target oxygen","528":"850 Gram auger/6 min","530":"10.115 kg Today",
"531":"0 kg/m2 Today","532":"0 °C Smoke temp.","533":"65 °C Target boiler temp.","534":"56 °C Target DHW temp.","542":" ","584":"Nitra ",
"585":"86 % humidity","586":"1005 hPa pressure","587":"6.2 m/s wind speed","588":"http://openweathermap.org/img/w/13d.png ",
"589":"-2 °C air temperature","591":"130 null","592":"0.0 °C T5","alarm":"1"}
]]
local data = json.decode(j)
results in the following Lua data structure:
{
["501"] = "34.1 °C flow",
["502"] = "0 % Power",
["503"] = "24 °C Shaft",
["504"] = "0 kW Power",
["505"] = "18.2 kg Hopper",
["506"] = "0 Lx Light",
["507"] = "Error no pellets ",
["508"] = "16/01-2018 12:22:30",
["521"] = "0 °C Return",
["522"] = "0 liter/hour Flow",
["524"] = "0 °C External temperature",
["525"] = "54 °C Temperature DHW",
["526"] = "15.7 % Actual oxygen",
["527"] = "0 % Target oxygen",
["528"] = "850 Gram auger/6 min",
["530"] = "10.115 kg Today",
["531"] = "0 kg/m2 Today",
["532"] = "0 °C Smoke temp.",
["533"] = "65 °C Target boiler temp.",
["534"] = "56 °C Target DHW temp.",
["542"] = " ",
["584"] = "Nitra ",
["585"] = "86 % humidity",
["586"] = "1005 hPa pressure",
["587"] = "6.2 m/s wind speed",
["588"] = "http://openweathermap.org/img/w/13d.png ",
["589"] = "-2 °C air temperature",
["591"] = "130 null",
["592"] = "0.0 °C T5",
alarm = "1"
}
how can i write easy lua script? is possible run this script automatically each 5 minutes in scenes scheduler?
The easiest way to do this is simply to put your Lua code into a scene and schedule that scene to run every 5 minutes.