EV Charging / Solar / Demand Shaper / Agile

I had a go at importing historic and forecast data from the darksky api yesterday, the intention was to get a precipitation forecast to forecast the output of a local micro hydro generator, but I also pulled in all the other observations and forecast values, here’s an example of UV index and cloud cover:

Their api is nice and easy to work with e.g

$data = json_decode(file_get_contents("https://api.darksky.net/forecast/$key/$lat,$long,$time?units=si&exclude=currently,minutely,daily,alerts,flags"));

foreach ($data->hourly->data as $hour) {
    print $hour->time." ".$hour->precipProbability." ".$hour->precipIntensity." ".$hour->humidity."\n";
}

See their documentation for more info: