In my v1.0 version of MMM-MyDutchWeather there I was using the v1.0 API.
I executed this URL Weerlive API 1.0 and got the next results:
{
"liveweer": [
{
"plaats": "Amsterdam",
"timestamp": "1731422596",
"time": "12-11-2024 15:43",
"temp": "9.7",
"gtemp": "6.8",
"samenv": "Licht bewolkt",
"lv": "76",
"windr": "NO",
"windrgr": "44",
"windms": "6",
"winds": "4",
"windk": "11.7",
"windkmh": "21.6",
"luchtd": "1033.9",
"ldmmhg": "775",
"dauwp": "6",
"zicht": "16",
"verw": "Hier en daar zon en overwegend droog",
"sup": "07:55",
"sunder": "16:54",
"image": "lichtbewolkt",
"d0weer": "bewolkt",
"d0tmax": "11",
"d0tmin": "7",
"d0windk": "2",
"d0windknp": "6",
"d0windms": "3",
"d0windkmh": "11",
"d0windr": "NO",
"d0windrgr": "44",
"d0neerslag": "0",
"d0zon": "10",
"d1weer": "bewolkt",
"d1tmax": "12",
"d1tmin": "4",
"d1windk": "2",
"d1windknp": "4",
"d1windms": "2",
"d1windkmh": "7",
"d1windr": "NW",
"d1windrgr": "315",
"d1neerslag": "30",
"d1zon": "10",
"d2weer": "bewolkt",
"d2tmax": "12",
"d2tmin": "6",
"d2windk": "2",
"d2windknp": "6",
"d2windms": "3",
"d2windkmh": "11",
"d2windr": "N",
"d2windrgr": "0",
"d2neerslag": "20",
"d2zon": "10",
"alarm": "0"
}
]
}
In the node_helper.js I used
getMWB: function(url) {
// Make a GET request using the Fetch API
fetch(url)
.then(response => {
if (!response.ok) {
console.error('MMM-MyDutchWeather: Network response was not ok');
}
return response.json();
})
.then(result => {
// Process the retrieved user data
console.log(result.liveweer['0']); // Remove trailing slashes to display data in Console for testing
// console.log(result.wk_verw['0']);
this.sendSocketNotification('MWB_RESULT', result.liveweer['0']);
})
.catch(error => {
console.error('Error:', error);
});
},
With the new v2.0 API Weerlive API 2.0 I become the next results
{
"liveweer": [
{
"plaats": "Amsterdam",
"timestamp": 1731423484,
"time": "12-11-2024 15:58:04",
"temp": 9.6,
"gtemp": 7.3,
"samenv": "Licht bewolkt",
"lv": 79,
"windr": "ONO",
"windrgr": 44.5,
"windms": 4.33,
"windbft": 3,
"windknp": 8.4,
"windkmh": 15.6,
"luchtd": 1033.89,
"ldmmhg": 775,
"dauwp": 6.2,
"zicht": 19400,
"gr": 97,
"verw": "Hier en daar zon en overwegend droog",
"sup": "07:55",
"sunder": "16:54",
"image": "lichtbewolkt",
"alarm": 0,
"lkop": "Er zijn geen waarschuwingen",
"ltekst": " Er zijn momenteel geen waarschuwingen van kracht.",
"wrschklr": "groen",
"wrsch_g": "-",
"wrsch_gts": 0,
"wrsch_gc": "-"
}
],
"wk_verw": [
{
"dag": "12-11-2024",
"image": "halfbewolkt",
"max_temp": 11,
"min_temp": 7,
"windbft": 2,
"windkmh": 10,
"windknp": 6,
"windms": 3,
"windrgr": 48,
"windr": "NO",
"neersl_perc_dag": 0,
"zond_perc_dag": 27
},
{
"dag": "13-11-2024",
"image": "bewolkt",
"max_temp": 12,
"min_temp": 7,
"windbft": 2,
"windkmh": 10,
"windknp": 6,
"windms": 3,
"windrgr": 205,
"windr": "Z",
"neersl_perc_dag": 0,
"zond_perc_dag": 12
},
{
"dag": "14-11-2024",
"image": "halfbewolkt",
"max_temp": 12,
"min_temp": 10,
"windbft": 2,
"windkmh": 10,
"windknp": 6,
"windms": 3,
"windrgr": 258,
"windr": "W",
"neersl_perc_dag": 0,
"zond_perc_dag": 28
},
{
"dag": "15-11-2024",
"image": "halfbewolkt",
"max_temp": 13,
"min_temp": 8,
"windbft": 2,
"windkmh": 10,
"windknp": 6,
"windms": 3,
"windrgr": 265,
"windr": "W",
"neersl_perc_dag": 0,
"zond_perc_dag": 24
},
{
"dag": "16-11-2024",
"image": "halfbewolkt",
"max_temp": 12,
"min_temp": 7,
"windbft": 2,
"windkmh": 10,
"windknp": 6,
"windms": 3,
"windrgr": 257,
"windr": "ZW",
"neersl_perc_dag": 0,
"zond_perc_dag": 24
}
],
"uur_verw": [
{
"uur": "12-11-2024 16:00",
"timestamp": 1731423600,
"image": "zonnig",
"temp": 10,
"windbft": 3,
"windkmh": 14,
"windknp": 8,
"windms": 4,
"windrgr": 50,
"windr": "NO",
"neersl": 0,
"gr": 28
},
{
"uur": "12-11-2024 17:00",
"timestamp": 1731427200,
"image": "nachtbewolkt",
"temp": 10,
"windbft": 2,
"windkmh": 10,
"windknp": 6,
"windms": 3,
"windrgr": 36,
"windr": "NO",
"neersl": 0,
"gr": 0
},
{
"uur": "12-11-2024 18:00",
"timestamp": 1731430800,
"image": "bewolkt",
"temp": 9,
"windbft": 3,
"windkmh": 14,
"windknp": 8,
"windms": 4,
"windrgr": 37,
"windr": "NO",
"neersl": 0,
"gr": 0
},
{
"uur": "12-11-2024 19:00",
"timestamp": 1731434400,
"image": "bewolkt",
"temp": 9,
"windbft": 2,
"windkmh": 10,
"windknp": 6,
"windms": 3,
"windrgr": 35,
"windr": "NO",
"neersl": 0,
"gr": 0
},
{
"uur": "12-11-2024 20:00",
"timestamp": 1731438000,
"image": "bewolkt",
"temp": 9,
"windbft": 2,
"windkmh": 10,
"windknp": 6,
"windms": 3,
"windrgr": 33,
"windr": "NO",
"neersl": 0,
"gr": 0
},
{
"uur": "12-11-2024 21:00",
"timestamp": 1731441600,
"image": "bewolkt",
"temp": 9,
"windbft": 2,
"windkmh": 10,
"windknp": 6,
"windms": 3,
"windrgr": 40,
"windr": "NO",
"neersl": 0,
"gr": 0
},
{
"uur": "12-11-2024 22:00",
"timestamp": 1731445200,
"image": "bewolkt",
"temp": 9,
"windbft": 2,
"windkmh": 10,
"windknp": 6,
"windms": 3,
"windrgr": 43,
"windr": "NO",
"neersl": 0,
"gr": 0
},
{
"uur": "12-11-2024 23:00",
"timestamp": 1731448800,
"image": "bewolkt",
"temp": 9,
"windbft": 2,
"windkmh": 7,
"windknp": 4,
"windms": 2,
"windrgr": 37,
"windr": "NO",
"neersl": 0,
"gr": 0
},
{
"uur": "13-11-2024 00:00",
"timestamp": 1731452400,
"image": "bewolkt",
"temp": 9,
"windbft": 2,
"windkmh": 7,
"windknp": 4,
"windms": 2,
"windrgr": 355,
"windr": "N",
"neersl": 0,
"gr": 0
},
{
"uur": "13-11-2024 01:00",
"timestamp": 1731456000,
"image": "bewolkt",
"temp": 9,
"windbft": 1,
"windkmh": 3,
"windknp": 2,
"windms": 1,
"windrgr": 347,
"windr": "NW",
"neersl": 0,
"gr": 0
},
{
"uur": "13-11-2024 02:00",
"timestamp": 1731459600,
"image": "bewolkt",
"temp": 9,
"windbft": 2,
"windkmh": 7,
"windknp": 4,
"windms": 2,
"windrgr": 24,
"windr": "NO",
"neersl": 0,
"gr": 0
},
{
"uur": "13-11-2024 03:00",
"timestamp": 1731463200,
"image": "bewolkt",
"temp": 9,
"windbft": 2,
"windkmh": 7,
"windknp": 4,
"windms": 2,
"windrgr": 354,
"windr": "N",
"neersl": 0,
"gr": 0
},
{
"uur": "13-11-2024 04:00",
"timestamp": 1731466800,
"image": "bewolkt",
"temp": 9,
"windbft": 2,
"windkmh": 7,
"windknp": 4,
"windms": 2,
"windrgr": 346,
"windr": "NW",
"neersl": 0,
"gr": 0
},
{
"uur": "13-11-2024 05:00",
"timestamp": 1731470400,
"image": "bewolkt",
"temp": 9,
"windbft": 2,
"windkmh": 7,
"windknp": 4,
"windms": 2,
"windrgr": 4,
"windr": "N",
"neersl": 0,
"gr": 0
},
{
"uur": "13-11-2024 06:00",
"timestamp": 1731474000,
"image": "bewolkt",
"temp": 10,
"windbft": 2,
"windkmh": 7,
"windknp": 4,
"windms": 2,
"windrgr": 349,
"windr": "N",
"neersl": 0,
"gr": 0
},
{
"uur": "13-11-2024 07:00",
"timestamp": 1731477600,
"image": "bewolkt",
"temp": 10,
"windbft": 2,
"windkmh": 7,
"windknp": 4,
"windms": 2,
"windrgr": 323,
"windr": "NW",
"neersl": 0,
"gr": 0
},
{
"uur": "13-11-2024 08:00",
"timestamp": 1731481200,
"image": "bewolkt",
"temp": 10,
"windbft": 2,
"windkmh": 7,
"windknp": 4,
"windms": 2,
"windrgr": 294,
"windr": "W",
"neersl": 0,
"gr": 19
},
{
"uur": "13-11-2024 09:00",
"timestamp": 1731484800,
"image": "bewolkt",
"temp": 11,
"windbft": 2,
"windkmh": 7,
"windknp": 4,
"windms": 2,
"windrgr": 311,
"windr": "NW",
"neersl": 0,
"gr": 69
},
{
"uur": "13-11-2024 10:00",
"timestamp": 1731488400,
"image": "bewolkt",
"temp": 11,
"windbft": 2,
"windkmh": 10,
"windknp": 6,
"windms": 3,
"windrgr": 16,
"windr": "NO",
"neersl": 0,
"gr": 61
},
{
"uur": "13-11-2024 11:00",
"timestamp": 1731492000,
"image": "halfbewolkt",
"temp": 12,
"windbft": 2,
"windkmh": 7,
"windknp": 4,
"windms": 2,
"windrgr": 41,
"windr": "NO",
"neersl": 0,
"gr": 208
},
{
"uur": "13-11-2024 12:00",
"timestamp": 1731495600,
"image": "halfbewolkt",
"temp": 13,
"windbft": 2,
"windkmh": 7,
"windknp": 4,
"windms": 2,
"windrgr": 330,
"windr": "NW",
"neersl": 0,
"gr": 299
},
{
"uur": "13-11-2024 13:00",
"timestamp": 1731499200,
"image": "bewolkt",
"temp": 13,
"windbft": 3,
"windkmh": 14,
"windknp": 8,
"windms": 4,
"windrgr": 347,
"windr": "NW",
"neersl": 0,
"gr": 175
},
{
"uur": "13-11-2024 14:00",
"timestamp": 1731502800,
"image": "bewolkt",
"temp": 13,
"windbft": 2,
"windkmh": 10,
"windknp": 6,
"windms": 3,
"windrgr": 343,
"windr": "NW",
"neersl": 0,
"gr": 108
},
{
"uur": "13-11-2024 15:00",
"timestamp": 1731506400,
"image": "bewolkt",
"temp": 13,
"windbft": 2,
"windkmh": 10,
"windknp": 6,
"windms": 3,
"windrgr": 347,
"windr": "NW",
"neersl": 0,
"gr": 25
}
],
"api": [
{
"bron": "Bron: Weerdata KNMI/NOAA via Weerlive.nl",
"max_verz": 300,
"rest_verz": 0
}
]
}
Now I’m wondering how do I get this in my Array to use?
I’ve been trying but I don’t have any results. Can someone help me?
I’m doing this for a hobby ;-)