10.10.2023, 18:47
I would like to return the value provided by the meteomatics api to 33/1/2 but I'm confused on the data type i guess.
--script
require('json')
https = require('ssl.https')
escape = require('socket.url').escape
res= https.request("https://api.meteomatics.com/2023-10-10T19:45:00.000+02:00/t_2m:C/51.0248817,4.6908515/json")
data = json.pdecode(res)
grp.write('33/1/2', dates[value])
--url entry in browser
--https://api.meteomatics.com/2023-10-10T19:45:00.000+02:00/t_2m:C/51.0248817,4.6908515/json
--Api returns json
--{"version":"3.0",
-- "user":"xtend_docx_kris",
-- "dateGenerated":"2023-10-10T17:49:11Z",
-- "status":"OK",
-- "data":
-- [{"parameter":"t_2m:C",
-- "coordinates":[{"lat":51.024882,
-- "lon":4.690852,
-- "dates":[{"date":"2023-10-10T17:45:00Z",
-- "value":20.3}]}]}]}
--script
require('json')
https = require('ssl.https')
escape = require('socket.url').escape
res= https.request("https://api.meteomatics.com/2023-10-10T19:45:00.000+02:00/t_2m:C/51.0248817,4.6908515/json")
data = json.pdecode(res)
grp.write('33/1/2', dates[value])
--url entry in browser
--https://api.meteomatics.com/2023-10-10T19:45:00.000+02:00/t_2m:C/51.0248817,4.6908515/json
--Api returns json
--{"version":"3.0",
-- "user":"xtend_docx_kris",
-- "dateGenerated":"2023-10-10T17:49:11Z",
-- "status":"OK",
-- "data":
-- [{"parameter":"t_2m:C",
-- "coordinates":[{"lat":51.024882,
-- "lon":4.690852,
-- "dates":[{"date":"2023-10-10T17:45:00Z",
-- "value":20.3}]}]}]}