How to get weather forecast for 2 days from now?

I am using home assistant to control valves for irrigation of my trees and using external factors to control valve start time and duration. For best irrigation, it is extremely helpful to know (or estimate) the temperature, humidity, and wind speed in the next 2 days. I tried to use Weather Underground, but it only supplies current data or a general description (like rainy, sunny) for the forecast. I have looked at the other weather components, and they don’t seem to supply a forecast of this data either. Has anyone tried to do this?

I did see that Weather Underground’s api will supply a json file with the forecast having the information I need, but it looks like I would need to create a custom component. I was hoping that perhaps there was something more readily available, as I am relatively new to Home Assistant (been using it for 2 months).

Thanks!

There was a pull request for this but it died on the vine, so to speak.

https://github.com/home-assistant/home-assistant/pull/4455

I have a pull request in for a 7 day forecast in for Darksky

https://github.com/home-assistant/home-assistant/pull/5264

I’m a git noob though and the documentation pull is a mess. I haven’t gotten back to it yet.

If you don’t want to wait, just pull down the darksky.py file from my branch and add this to your configuration

forecast:
  - 1
  - 2
monitored_conditions:
  - temperature_max
  - temperature_min
  - wind_speed
  - humidity
1 Like

I really wanted to get WU as I send my WX Station data there so I like to get my hyperlocal weather.

I’ve been using the minutely, hourly, daily attributes of the current darksky.py like this:

-  platform: darksky
   api_key: !secret forecast_io_api_key
   monitored_conditions:
     - minutely_summary
     - hourly_summary
     - daily_summary

I’ll have to try out your PR - I never liked the daily summary anyway.

Sorry I didn’t mention your PR as I was aware of it; I just saw the reference to Weather Underground and answered based on that.

Okay, that worked great. I now have forecast going. Below is the forecast using a small modification your configuration, with only for 2 day (and not 1 day). I included today’s weather picture from WU.

So 2 questions:

  1. For days in the future, is there a particular time that it takes its wind and humidity, e.g. is it 24 x n hours in the future or is it 12 am of the day in question?
  2. How do I refer to one of the values? For example, if I want to put the wind speed in 2 days into a group, and I give the darksky sensor an entity ID of DS, would I refer to it with “sensor.DS.forecast.2.wind_speed”?

Thanks so much for this. Extremely helpful, and I wasn’t looking forward to building a component just yet.

If you click the “Developer Tools” “States” page you’ll see all of the dark sky sensors. They should be named something like sensor.dark_sky_wind_speed & sensor.dark_sky_wind_speed_2 for the wind speed. If you want the wind speed for 2 days in the future you would reference sensor.dark_sky_wind_speed_2.state

As for when they are taken, I don’t really know. I just know that they have an API and it returns those values for “daily”. I have to imagine it is the same information they use for the daily overview they show on their web page. Some fields have times and there is an overall “time” field, but those aren’t currently being returned as a sensor.

Since I only really care about high/low temperature for the day I never cared when the rest of the fields were taken from.

Does this use the forecast api or the time machine api?

Forecast API. I didn’t make additional API calls as the sensor already does ~600 calls/day. I just extracted more information from what was already returned.

1 Like

I wouldn’t know where to start (platform: Noob) but I wonder if windyty API would be of use?