Using Dark Sky temperature data?

20 views
Skip to first unread message

Mick Wall

unread,
Sep 25, 2018, 8:45:04 AM9/25/18
to measureit
PVoutput used to use Weather Underground api to get local weather station info for its graphs.  But that appears to be closing down now and is not open to new api requests.

I'm wondering if I could inject something like temperatures from Dark Sky api (https://darksky.net/dev) at the measureit stage?
At the moment my temps on PVoutput come from the Envir display unit which aren't much use.
I'd much prefer getting a reliable external temperature.

Any thoughts on how I could amend the python code to use the darksky temperature instead?

This code gets the temp ok from Dark Sky.


import requests

response = requests.get("https://api.darksky.net/forecast/"api-key"f/53.402540,-1.521180")
json_res = response.json()
celsius = round((((json_res['currently']['temperature']) - 32) * 5.0/9.0),1)
print (celsius)


My only worry is that there is a 1000 call limit on the api in a 24 hour period, so it would have to be every 2 mins (720 calls total), so it may need some work in the code to make that happen.
Whereas the the py script reads off the clamps every 6 seconds or something like that?   That would be too frequent to keep calling Dark Sky.

Anyone any thoughts?

Cheers, Mick
Reply all
Reply to author
Forward
0 new messages