08.02.2020, 09:51
There are better api's available using JSON. But first of all i would like to say that for this purpose it's better to meassure at the side where your shutter is installed. Specially if you use it for a professional installation side. Some weather API's can be found here. https://superdevresources.com/weather-fo...ping-apps/
Below an example we use with a Dutch weather API in JSON.
require('ssl.https')
require('json')
city = 'Amsterdam'
data = ssl.https.request('http://weerlive.nl/api/json-10min.php?locatie=' ..city)
datatable = json.pdecode(data)
datatable = datatable['liveweer'][1]
--log(datatable)
temp = datatable.temp --actuele temperatuur
--log('Actuele temperatuur: ' ..temp.. '°C')
windms = datatable.windms --windsnelheid in meter per seconde
--log('Windsnelheid: ' ..windms.. ' m/s')
Below an example we use with a Dutch weather API in JSON.
require('ssl.https')
require('json')
city = 'Amsterdam'
data = ssl.https.request('http://weerlive.nl/api/json-10min.php?locatie=' ..city)
datatable = json.pdecode(data)
datatable = datatable['liveweer'][1]
--log(datatable)
temp = datatable.temp --actuele temperatuur
--log('Actuele temperatuur: ' ..temp.. '°C')
windms = datatable.windms --windsnelheid in meter per seconde
--log('Windsnelheid: ' ..windms.. ' m/s')