https://services.swpc.noaa.gov/products ... speed.json
https://services.swpc.noaa.gov/products ... field.json
There you will find these dates:
{"WindSpeed":"318","TimeStamp":"2018-11-19 20:02:00.000"}
{"Bt":"5","Bz":"-1","TimeStamp":"2018-11-19 20:01:00.000"}
For this I had created the following script:
Code: Select all
(loadfile "C:\\Program Files (x86)\\Domoticz\\scripts\\lua\\lib.lua")()
JSON = assert(loadfile "C:\\Program Files (x86)\\Domoticz\\scripts\\lua\\JSON.lua")()
local connection
local contt
local connection = assert(io.popen("C:\\curl\\curl https://services.swpc.noaa.gov/products/summary/solar-wind-mag-field.json"), 'unable to download noaa field data')
local raw_json_text = connection:read('*all')
connection:close()
local lua_value = JSON:decode(raw_json_text)
local lua_value =(raw_json_text)
updateSValue(53, lua_value.Bz)
updateSValue(71, lua_value.Bt)
local connection = assert(io.popen("C:\\curl\\curl https://services.swpc.noaa.gov/products/summary/solar-wind-speed.json"), 'unable to download noaa speed data')
local content = connection:read('*all')
connection:close()
local data1 =(content)
updateSValue(52, data1.WindSpeed)
return commandArray
Where am I doing something wrong?
Works with domoticz version V4.9700 under Windows10
Waling