Buienradar json problem
Posted: Thursday 01 August 2019 15:01
Hello,
The following script to check the "buienradar" json has been working without problems until some weeks ago.
Now it gives the following error, it seems the json coming back is not recognized as a json anymore. When I enter https://data.buienradar.nl/2.0/feed/json in a browser it shows a good looking json.
Any ideas?
The following script to check the "buienradar" json has been working without problems until some weeks ago.
Code: Select all
return {
on = {
httpResponses = {
'Weather_Callback'
},
timer = {'every minute'},
},
logging = { level = domoticz.LOG_DEBUG,
marker = "Buienradar" },
execute = function(domoticz, item)
if (item.isTimer) then
domoticz.log('Timer event')
domoticz.openURL({
url = 'https://data.buienradar.nl/2.0/feed/json',
method = 'GET',
callback = 'Weather_Callback',
})
end
if (item.isHTTPResponse) then
domoticz.log('HTTP reponse was ok')
if (item.statusCode == 200) and (item.isJSON) then
domoticz.log('JSON was detected')
domoticz.log(item)
local Temperature = item.json['actual']['stationmeasurements'][10]['temperature']
local Name = item.json['actual']['stationmeasurements'][10]['airpressure']
local gevoelsTemp = item.json['actual']['stationmeasurements'][10]['feeltemperature']
local Gust = item.json['actual']['stationmeasurements'][10]['windgusts']
local Speed = item.json['actual']['stationmeasurements'][10]['windspeed']
local SpeedBft = item.json['actual']['stationmeasurements'][10]['windspeedBft']
local Sun = item.json['actual']['stationmeasurements'][10]['sunpower']
local Rain24h = item.json['actual']['stationmeasurements'][10]['rainFallLast24Hour']
local Rain1h = item.json['actual']['stationmeasurements'][10]['rainFallLastHour']
local winddirection = item.json['actual']['stationmeasurements'][10]['winddirectiondegrees']
local winddirectionstr = item.json['actual']['stationmeasurements'][10]['winddirection']
local Humidity = item.json['actual']['stationmeasurements'][10]['humidity']
local airpressure = item.json['actual']['stationmeasurements'][10]['airpressure']
local sunpower = item.json['actual']['stationmeasurements'][10]['sunpower']
local Rain = item.json['actual']['stationmeasurements'][10]['precipitation']
local Zicht = item.json['actual']['stationmeasurements'][10]['visibility']
else
domoticz.log('There was a problem handling the request', domoticz.LOG_ERROR)
domoticz.log(item, domoticz.LOG_ERROR)
end
end
end
}
Any ideas?
- Spoiler: show