This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

KNMI Weather Data Netherlands
#1
Dears,

i made a script that i am using in resident mode to poll the data but instead of 60sec i want 600sec polling time as the weatherdata of the KNMI (Dutch meteo agency) is also refreshed from the official weather stations every 10 minutes. So there is no need to poll more.

With the free service of weerlive.nl you are limited to 300 polls a day which is no problem when you do 6x24= 144 updates they only publish. How can i extend the polling time over 60 seconds for a resident script?

https://weerlive.nl/delen.php
http://weerlive.nl/api/json-data-10min.p...=Amsterdam
Reply
#2
Use Scheduled script and put */10 in minute.
------------------------------
Ctrl+F5
Reply
#3
(07.12.2020, 16:11)Daniel. Wrote: Use Scheduled script and put */10 in minute.
Thanks a lot!
Reply
#4
ps. the script is attached in the first post if somebody wants to use it. More info on the website https://weerlive.nl/delen.php how to use it
Reply
#5
Tip: Change grp.write() into grp.checkwrite() to avoid writing to +50 objects each run (probably only a few points are changed in the whole set) and cleanup your code, there are +50 vars filled with data and not used.
Reply
#6
Don't know what you mean with "there are +50 vars filled with data and not used."
Reply
#7
You have variables assigned but not used anywhere.
Code:
plaats = data.plaats
...
grp.write('32/2/1', data.plaats)
Reply
#8
(09.12.2020, 12:45)admin Wrote: You have variables assigned but not used anywhere.
Code:
plaats = data.plaats
...
grp.write('32/2/1', data.plaats)

sorry i am a noob to scripting so i am trying to understand. If i didn't use the plaats = data.plaats i got no data.

i tried first: grp.write('32/2/1', plaats) but no data came in. After adding plaats = data.plaats it started working.
Reply
#9
That does not make sense (: and never seen an issue that looks like that..

The script is running top to bottom and when plaats = data.plaats works you can use the var plaats or data.plaats, but if it fails then neither work as plaats is dependent of data.plaats

Your code grp.checkwrite('x/x/x', data.plaats) is enough and there is no need to assign it to a var first..

What you say can be right if you use grp.write('x/x/x', plaats) without plaats = data.plaats, but your command is grp.write('x/x/x', data.plaats) and is using the parsed json data directly..
Reply
#10
Updated and tested it, and you where right it works so i attached it for others that want to use it.

The main reason i use it is for the feel temperature as a temperature compensated for windspeed and humidity to control a weather dependent setpoint for a heating buffer. 

Besides that you can use it for a free 2 day in advance weather forecast in the visualization

Attached Files
.json   NL_Weerlive.json (Size: 2.83 KB / Downloads: 29)
Reply


Forum Jump: