[APP][Pro][Cloud] KNMI

That is for the KNMI.

I appreciate your work!

I understand that it is the KNMI side. As you suggest, I made a flow to push the image so you can see yourself if it applies for your province. Pitty it can not be automated more.

1 Like

@B-J_Soecker
There is an alarm, code 1 in the api, and you like to push the image. Which image?
Further, if that alarm stays for more day’s for different region’s? You don’t know that? No updates here.

What you can do is make a variable for the “alarm text”
Then comparing the new “alarm text” with that what is in that variable.
If not equal, then make that variable equal to the new “alarm text” and let you know about that.
It’s a little better but still worse.

Edit
Look to post 188.

Why not using the trigger card alarmtext?

To put that text in a variable you have to use that card.

But why then put the text in a variable? Surely I’ve already created a token with that text in it?

Look post 188

Reference to post 188 is not the answer to my question. Also, looking at your post, putting the text in a separate variable is an unnecessary extra handling. Checking a code in alarm text can also be done directly in the KNMI token. But apart from this, so there is not always a code in the text unfortunately.

image

So I will opt for a flow, when the text changes you will be notified via a message with the image.

An tag, the official name by Homey, can only be read while creating a flow.
An variable can always be read quickly to see why something is not working.
Also useable for other places like dashboard if you want.
Therefore it’s not an unnecessary extra handling for me.

That’s is exactly what I do al the time but then for filtering the colour code.
The “Info Waarschuwingen URL” is not a tag that you can used for an image

https://www.knmi.nl/nederland-nu/weer/waarschuwingen/nederland

Hi, I like the new KNMI 2.0 App but miss the Insights. Is it possible to get them working?

Good afternoon, first of all thank you for this great App!

Would it be possible to add ‘Zonkracht’ as a value? I can see this value on Weerlive.nl but not in the app.
image

No is not in the API. only this parameters Weer API KNMI live en verwachtingen | Het Weer in Nederland - Weerlive.nl

Too bad. Thank you for looking into this.

1 Like

Major app news! :sun_behind_rain_cloud:

@martijnpoppen joins as app developer. I am very happy about this. This because of the fact that we now have an official partnership with Weerlive.nl (Meteoserver) and so we will also make the app available for Homey Cloud Platform.

Weerlive has specially developed an api for us with which all color codes are now available. In addition, we now also receive more sun information in terms of power etc.

In the near future we will be busy migrating the entire app to the new api. Soon no one will need an api key for the app, but we will make it available through our own server.

Please be patient as this will be a large migration, which we will perform in our own spare time next to our busy jobs.

Donations are of course welcome, as the server and cloud platform will involve costs that we will bear ourselves.

We are going for a 1000% stable app for you as users!


:rotating_light: Disclaimer :rotating_light:

This app is a labor of love, provided on a best-effort basis. No rights can be derived from its use. Data made possible by weerlive.nl

knmi_partner


Contributions

If you appreciate this app, fuel future development with a PayPal contribution, buy a round on Ko-Fi or Bunq.me, or become a true supporter on Patreon . Your support keeps the magic alive! :sparkles::rocket:

data from new api

I now get this from the api. it takes a while, though entire app has to be converted

Live Weer Data:
{
  plaats: 'Apeldoorn',
  timestamp: 1707929883,
  time: '14-02-2024 17:58:03',
  temp: 11.7,
  gtemp: 8.5,
  samenv: 'Lichte regen',
  lv: 97,
  windr: 'ZW',
  windrgr: 224.9,
  windms: 5.05,
  windbft: 3,
  windknp: 9.8,
  windkmh: 18.2,
  luchtd: 1014.78,
  ldmmhg: 761,
  dauwp: 11.3,
  zicht: 3670,
  gr: 0,
  verw: 'Bewolkt en perioden met regen. Morgen in de middag droog en zeer zacht',
  sup: '07:52',
  sunder: '17:48',
  image: 'regen',
  alarm: 0,
  lkop: 'Er zijn geen waarschuwingen',
  ltekst: 'Er zijn momenteel geen waarschuwingen van kracht.',
  wrschklr: 'groen'
}
Dagverwachtingen Data:
[
  {
    dag: '14-02-2024',
    image: 'bewolkt',
    max_temp: 11,
    min_temp: 11,
    windbft: 4,
    windkmh: 21,
    windknp: 12,
    windms: 6,
    windrgr: 225,
    windr: 'ZW',
    neersl_perc_dag: 0,
    zond_perc_dag: 1
  },
  {
    dag: '15-02-2024',
    image: 'bewolkt',
    max_temp: 14,
    min_temp: 10,
    windbft: 3,
    windkmh: 18,
    windknp: 10,
    windms: 5,
    windrgr: 189,
    windr: 'Z',
    neersl_perc_dag: 10,
    zond_perc_dag: 12
  },
  {
    dag: '16-02-2024',
    image: 'bewolkt',
    max_temp: 14,
    min_temp: 9,
    windbft: 3,
    windkmh: 18,
    windknp: 10,
    windms: 5,
    windrgr: 201,
    windr: 'Z',
    neersl_perc_dag: 10,
    zond_perc_dag: 13
  },
  {
    dag: '17-02-2024',
    image: 'buien_zon_wolken',
    max_temp: 10,
    min_temp: 5,
    windbft: 3,
    windkmh: 18,
    windknp: 10,
    windms: 5,
    windrgr: 228,
    windr: 'ZW',
    neersl_perc_dag: 30,
    zond_perc_dag: 38
  },
  {
    dag: '18-02-2024',
    image: 'bewolkt',
    max_temp: 11,
    min_temp: 6,
    windbft: 3,
    windkmh: 18,
    windknp: 10,
    windms: 5,
    windrgr: 214,
    windr: 'ZW',
    neersl_perc_dag: 0,
    zond_perc_dag: 4
  }
]
Uurverwachting Data:
[
  {
    uur: '14-02-2024 18:00',
    timestamp: 1707930000,
    image: 'regen',
    temp: 11,
    windbft: 4,
    windkmh: 21,
    windknp: 12,
    windms: 6,
    windrgr: 243,
    windr: 'ZW',
    neersl: 0.1,
    gr: 0
  },
  {
    uur: '14-02-2024 19:00',
    timestamp: 1707933600,
    image: 'regen',
    temp: 11,
    windbft: 4,
    windkmh: 21,
    windknp: 12,
    windms: 6,
    windrgr: 240,
    windr: 'ZW',
    neersl: 0.1,
    gr: 0
  },
  {
    uur: '14-02-2024 20:00',
    timestamp: 1707937200,
    image: 'regen',
    temp: 11,
    windbft: 4,
    windkmh: 21,
    windknp: 12,
    windms: 6,
    windrgr: 240,
    windr: 'ZW',
    neersl: 0.2,
    gr: 0
  },
  {
    uur: '14-02-2024 21:00',
    timestamp: 1707940800,
    image: 'bewolkt',
    temp: 11,
    windbft: 4,
    windkmh: 21,
    windknp: 12,
    windms: 6,
    windrgr: 240,
    windr: 'ZW',
    neersl: 0,
    gr: 0
  },
  {
    uur: '14-02-2024 22:00',
    timestamp: 1707944400,
    image: 'bewolkt',
    temp: 11,
    windbft: 3,
    windkmh: 18,
    windknp: 10,
    windms: 5,
    windrgr: 236,
    windr: 'ZW',
    neersl: 0,
    gr: 0
  },
  {
    uur: '14-02-2024 23:00',
    timestamp: 1707948000,
    image: 'bewolkt',
    temp: 11,
    windbft: 3,
    windkmh: 18,
    windknp: 10,
    windms: 5,
    windrgr: 234,
    windr: 'ZW',
    neersl: 0,
    gr: 0
  },
  {
    uur: '15-02-2024 00:00',
    timestamp: 1707951600,
    image: 'bewolkt',
    temp: 11,
    windbft: 3,
    windkmh: 18,
    windknp: 10,
    windms: 5,
    windrgr: 230,
    windr: 'ZW',
    neersl: 0,
    gr: 0
  },
  {
    uur: '15-02-2024 01:00',
    timestamp: 1707955200,
    image: 'regen',
    temp: 11,
    windbft: 3,
    windkmh: 14,
    windknp: 8,
    windms: 4,
    windrgr: 226,
    windr: 'ZW',
    neersl: 0.1,
    gr: 0
  },
  {
    uur: '15-02-2024 02:00',
    timestamp: 1707958800,
    image: 'bewolkt',
    temp: 11,
    windbft: 3,
    windkmh: 14,
    windknp: 8,
    windms: 4,
    windrgr: 227,
    windr: 'ZW',
    neersl: 0,
    gr: 0
  },
  {
    uur: '15-02-2024 03:00',
    timestamp: 1707962400,
    image: 'bewolkt',
    temp: 11,
    windbft: 3,
    windkmh: 14,
    windknp: 8,
    windms: 4,
    windrgr: 221,
    windr: 'ZW',
    neersl: 0,
    gr: 0
  },
  {
    uur: '15-02-2024 04:00',
    timestamp: 1707966000,
    image: 'bewolkt',
    temp: 11,
    windbft: 3,
    windkmh: 14,
    windknp: 8,
    windms: 4,
    windrgr: 214,
    windr: 'ZW',
    neersl: 0,
    gr: 0
  },
  {
    uur: '15-02-2024 05:00',
    timestamp: 1707969600,
    image: 'bewolkt',
    temp: 11,
    windbft: 2,
    windkmh: 10,
    windknp: 6,
    windms: 3,
    windrgr: 210,
    windr: 'Z',
    neersl: 0,
    gr: 0
  },
  {
    uur: '15-02-2024 06:00',
    timestamp: 1707973200,
    image: 'bewolkt',
    temp: 11,
    windbft: 3,
    windkmh: 14,
    windknp: 8,
    windms: 4,
    windrgr: 204,
    windr: 'Z',
    neersl: 0,
    gr: 0
  },
  {
    uur: '15-02-2024 07:00',
    timestamp: 1707976800,
    image: 'regen',
    temp: 11,
    windbft: 3,
    windkmh: 14,
    windknp: 8,
    windms: 4,
    windrgr: 201,
    windr: 'Z',
    neersl: 0.2,
    gr: 0
  },
  {
    uur: '15-02-2024 08:00',
    timestamp: 1707980400,
    image: 'regen',
    temp: 11,
    windbft: 3,
    windkmh: 14,
    windknp: 8,
    windms: 4,
    windrgr: 201,
    windr: 'Z',
    neersl: 0.1,
    gr: 0
  },
  {
    uur: '15-02-2024 09:00',
    timestamp: 1707984000,
    image: 'regen',
    temp: 11,
    windbft: 3,
    windkmh: 14,
    windknp: 8,
    windms: 4,
    windrgr: 202,
    windr: 'Z',
    neersl: 0.1,
    gr: 0
  },
  {
    uur: '15-02-2024 10:00',
    timestamp: 1707987600,
    image: 'regen',
    temp: 11,
    windbft: 3,
    windkmh: 18,
    windknp: 10,
    windms: 5,
    windrgr: 202,
    windr: 'Z',
    neersl: 0.2,
    gr: 6
  },
  {
    uur: '15-02-2024 11:00',
    timestamp: 1707991200,
    image: 'bewolkt',
    temp: 11,
    windbft: 3,
    windkmh: 14,
    windknp: 8,
    windms: 4,
    windrgr: 204,
    windr: 'Z',
    neersl: 0,
    gr: 14
  },
  {
    uur: '15-02-2024 12:00',
    timestamp: 1707994800,
    image: 'bewolkt',
    temp: 11,
    windbft: 3,
    windkmh: 14,
    windknp: 8,
    windms: 4,
    windrgr: 210,
    windr: 'Z',
    neersl: 0,
    gr: 78
  },
  {
    uur: '15-02-2024 13:00',
    timestamp: 1707998400,
    image: 'regen',
    temp: 11,
    windbft: 2,
    windkmh: 10,
    windknp: 6,
    windms: 3,
    windrgr: 190,
    windr: 'Z',
    neersl: 0.1,
    gr: 19
  },
  {
    uur: '15-02-2024 14:00',
    timestamp: 1708002000,
    image: 'bewolkt',
    temp: 12,
    windbft: 3,
    windkmh: 14,
    windknp: 8,
    windms: 4,
    windrgr: 193,
    windr: 'Z',
    neersl: 0,
    gr: 194
  },
  {
    uur: '15-02-2024 15:00',
    timestamp: 1708005600,
    image: 'bewolkt',
    temp: 13,
    windbft: 3,
    windkmh: 14,
    windknp: 8,
    windms: 4,
    windrgr: 189,
    windr: 'Z',
    neersl: 0,
    gr: 199
  },
  {
    uur: '15-02-2024 16:00',
    timestamp: 1708009200,
    image: 'bewolkt',
    temp: 13,
    windbft: 2,
    windkmh: 10,
    windknp: 6,
    windms: 3,
    windrgr: 174,
    windr: 'Z',
    neersl: 0,
    gr: 119
  },
  {
    uur: '15-02-2024 17:00',
    timestamp: 1708012800,
    image: 'bewolkt',
    temp: 13,
    windbft: 2,
    windkmh: 10,
    windknp: 6,
    windms: 3,
    windrgr: 157,
    windr: 'ZO',
    neersl: 0,
    gr: 55
  }
]
2 Likes

Status update migration to API v2! :sun_behind_rain_cloud:

Almost there!
With KNMI v3.0.0 you don’t to have any api-key anymore :slight_smile:

Migration to Api v2 To-do

App name from KNMI 2.0 to KNMI
Api to apiv2
Embed Api Key in app
Platform Cloud added everywhere
New trigger cards
New capabilities
Update alarm condition card to alarm colour code
Update app settings
More source entries
@martijnpoppen added as dev
New pairing screen and device settings
Api-key in device settings
Place in device settings
Device name in settings
Api-key and place from config to device settings
Auto update/add capabilities
Change pairing screen title
Placeholders pairing screen
Adjust api url in moniting (Better stack)
Update documentation

GMP_Q29tcHJlc3NHSDAx_3


Changelog


:rotating_light: Disclaimer :rotating_light:

This app is a labor of love, provided on a best-effort basis. No rights can be derived from its use. Data made possible by weerlive.nl

knmi_partner


Contributions

If you appreciate this app, fuel future development with a PayPal contribution, buy a round on Ko-Fi or Bunq.me, or become a true supporter on Patreon . Your support keeps the magic alive! :sparkles::rocket:

:sun_behind_rain_cloud: Update 3.0.6

New Live version!


Exciting News! Official Collaboration with weerlive.nl

We are thrilled to announce our official collaboration with weerlive.nl, a leading weather data provider. This partnership opens up exciting possibilities for KNMI for Homey users, as we now have the opportunity to bring you even more accurate and reliable weather information.

knmi_partner

Homey Cloud Platform Availability

As a result of this collaboration, KNMI for Homey is now officially available on the Homey Cloud platform. This expansion ensures seamless integration and enhanced performance for our users across different Homey platforms.

Welcoming @martijnpoppen as Developer

We’re delighted to welcome @martijnpoppen as a new developer to the KNMI for Homey team! With their expertise and passion for Homey development, we look forward to delivering even more innovative features and enhancements to our users.

New

:gear: Migration to APIv2: Enhanced data access and reliability with migration to APIv2.

:key: Embed API Key in App: Improved integration security by embedding API key within the app. No need for users to request a API Key first.

:globe_with_meridians: Cloud Platform Integration: Extended support to Homey Cloud for enhanced accessibility.

:rotating_light: New Trigger Cards: Introduced new trigger cards for expanded automation possibilities.

:hammer_and_wrench: New Capabilities: Enriched functionality with the addition of new capabilities.

Improvement

:art: Update Alarm Condition Card: Enhanced visibility with color-coded alarm condition card.

:gear: Update App Settings: Improved user experience with revamped app settings interface.

:bar_chart: Expanded Source Entries: Increased data coverage with additional source entries.

:woman_technologist: New Developer Addition: Welcomed @martijnpoppen as a new developer to the team.

:arrows_counterclockwise: New Pairing Screen and Device Settings: Enhanced setup experience with new pairing screen and device settings.

:label: Device Name Placement in Settings: Improved consistency by moving device name display to settings.

:arrows_counterclockwise: Auto Update/Add Capabilities: Streamlined integration with automatic updating and addition of capabilities.

:arrows_counterclockwise: Change Pairing Screen Title: Enhanced clarity with updated pairing screen title.

:memo: Pairing Screen Placeholders: Improved usability and guidance with added placeholders.

:hammer_and_wrench: API URL Adjustment in Monitoring: Enhanced integration with Better Stack platform through API URL adjustment.

:page_facing_up: Documentation Update: Updated documentation to reflect changes and improvements.


Download the new version in the Homey App Store!

:lock: Enjoy a seamless and stable connection with KNMI Homey app! :sun_behind_rain_cloud:


Encountering any issues? Help us help you by sending a detailed report via the mobile Homey app.

More - apps - KNMI - settings wheel top right - send diagnostic report (include your email and issues in the input field for better assistance)



:rotating_light: Disclaimer :rotating_light:

This app is a labor of love, provided on a best-effort basis. No rights can be derived from its use. Data made possible by weerlive.nl

knmi_partner


Contributions

If you appreciate this app, fuel future development with a PayPal contribution, buy a round on Ko-Fi or Bunq.me, or become a true supporter on Patreon. Your support keeps the magic alive! :sparkles::rocket:

Love this, yesterday finished a script to fetch historical data of the precipitation in the last 3 days from KNMI (see below). Wanted to work on a similar script to derive the predicted precipitation for today and upcoming 3 days (in doubt If I could fetch that from KNMI or WeerLive - now have Weatherunderground). If the total is below 30MM the waterpump knows he needs to start the Irrigation at 06.00 in the morning. Maybe this app can replace this labour… Great initiative

// KNMI API endpoint
var knmiEndpoint = 'https://www.daggegevens.knmi.nl/klimatologie/daggegevens';

// Initialize total RH value and messages
var totalRhValue = 0;
var messages = [];

// Create a promise for each day
var promises = [1, 2, 3].map(day => {
  // Get the date for 'day' days ago
  var date = new Date();
  date.setDate(date.getDate() - day);
  var yyyymmdd = date.toISOString().slice(0,10).replace(/-/g, '');

  // Fetch data from KNMI API for 'day' days ago
  return fetch(knmiEndpoint, {
    method: 'POST',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    body: 'start=' + yyyymmdd + '&end=' + yyyymmdd + '&stns=260&vars=RH'
  })
  .then(response => response.text())
  .then(async text => {
    // Extract the RH value
    var lines = text.trim().split('\n');
    var lastLine = lines[lines.length - 1];
    var rh = lastLine.split(',')[2];
    
    // Convert the RH value to a number and divide by 10
    var rhValue = Number(rh) / 10;

    // If the RH value is 0 or less, set it to 0
    if (rhValue <= 0) {
      rhValue = 0;
    }

    // Add the RH value to the total
    totalRhValue += rhValue;
    
    // Create the tag for the RH value
    try {
      await tag('Regen24u D-' + day, rhValue);
      messages.push('Created tag: Regen24u D-' + day + ', value: ' + rhValue);
    } catch (error) {
      messages.push('Error creating tag: Regen24u D-' + day + ', error: ' + error);
    }
  });
});

// When all promises are resolved, create the total tag
return Promise.all(promises)
.then(async () => {
  try {
    await tag('Regen24u -3d Totaal', totalRhValue);
    messages.push('Created total tag: Regen24u -3d Totaal, value: ' + totalRhValue);
  } catch (error) {
    messages.push('Error creating total tag: Regen24u -3d Totaal, error: ' + error);
  }
  return messages.join('\n');
})
.catch(error => 'Error fetching data from KNMI API: ' + error);

After downloading, curious if I could fetch the MM predicted precipitation, it seems yes… but doubting the values and checked it with the official KNMI values, see screenshot. The values :

And slight favour: can you add also predictions for 3 days in advance (maybe only as tags to use in flows / better logic)

Wanted to have the predicted precipitation for today and upcoming 3 days. If the total is below 20MM the waterpump knows he needs to start the Irrigation at 06.00 in the morning. Great initiative!

After the automatic update to version 3.0.6 my City name field in de app settings was empty and the today’s temperatures where 0.
After filling in again the City it seems oke again.

The weerlive api always shows an unexpected low value for today’s chance of rain: today for Amersfoort it shows: d0neerslag": “0”. A quick look at Buienradar shows an other expected value. I think there no error in the KNMI app, but an error in the Weerlive api.

There are diffrences between data from the Weerlive api using https://weerlive.nl/api/json-data-10min.php and the KNMI app. What is the sync frequency of the app?

Thanks for the feedback. We will look at it.
We are using a new api version 2.

https://weerlive.nl/api/weerlive_api_v2.php?key=demo&locatie=Amsterdam

1 Like