Forecast API/Software?

Sorry, not yet. It’s rising slowly to the top of the list though.

If someone else wants to help, I’m trying to get the forecast data from the Tempest API to Home Assistant weather entity & sensors. The latter part already easily works with the shared APIs but the former isn’t documented.

I have been able to get about 10 day daily forecast from this API endpoint:
GET https://swd.weatherflow.com/swd/rest/better_forecast?station_id={}&api_key={}&lat={}&lon={}

The DEV API key seems to work, if you don’t have lat/lon for the station you can use the existing API to query it.

For Home Assistant, I’m hoping to fork this and change the weather component data source from DarkSky (which is on death watch) to using the Tempest’s forecast using API above or whatever the final one is: https://github.com/briis/smartweather (fyi @briis)

Hi Max and welcome to the forum! We’d love to help you with your HomeAssistant integration, but we’re not quite ready.

The standard forecast API will NOT work the way you are using it. Access will be based on access token (personal or Oauth based) rather than (or in addition to) API key. And the forecast provided will be based on station_id rather than lat/long. An update to the documentation is coming soon, which will include more details on the access token concept as well as details on the forecast side of the API.

To get you started, check out this post: Oauth2 Access Token - #6 by dsj

Sure, I mean given this is undocumented at this time I fully expect that some changes might happen but I mean this is working right now :slight_smile: In my case my tempest is public so there isn’t a lot of access control needed. I’m assuming many will be in a similar situation as we have been previously trading public station data to wunderground in exchange for being able to use their API. Whenever you guys finalize this we can do the code updates for access.

Either way, I can get both daily and hourly forecast data now and get ahead on integrating with home assistant.

Alright well the first beta works now. If anyone wants to try it I put the code on a PR for the smartweather component: https://github.com/briis/smartweather/pull/36

It works now, creating a Home Assistant .weather object showing the next few days of forecast as defined by the Tempest. Aspiring meteorologists comments or improvements welcome!

Any news on the better_forecast endpoint? Looking for documentation. My app just needs to pull the forecast for the next 24 hours. When I make this call

https://swd.weatherflow.com/swd/rest/better_forecast?api_key=xxxx8&station_id=25682&lat=39.15&lon=-90.31

I get 112.98KB of data with 10 days of forecast details. The forecast.daily object is all I need. I can parse through all this, not a problem just thought I would check and see if time_start and time_end parameters exist for this endpoint.

I would be happy to help if I can. I’m working with the WallGauge.com platform to make a weather gauge to display data from a Tempest weather station. I will be happy to share my code (node.js) once I have everything working.

2 Likes

The better_forecast API endpoint has still not officially been released, hence the lack of documentation. I have never tried using the time_start and time_end parameters, but I’d imagine that if they don’t work then they are not supported. WeatherFlow have already made it clear that the format of this endpoint is very likely to change, so do be aware of this when developing you code. (the WallGauge looks very cool btw!).

1 Like

Hi @jhrucker. The wall gauge looks very cool and we’d love to help you with the integration if we can. We don’t have time_start/time_end params for the better_forecast endpoint, yet, but it’s a good idea for the sake of efficiency & performance.

We’re getting closer to documentation for the public facing forecast API. Thanks for your patience!

2 Likes

I just received my Tempest this week and wish to thank the WF team for creating this great system!
I started working on the integration for Loxone + Loxberry plugin Weather4Lox. For this purpose, I would appreciate receiving more information when the forecast API becomes publicly available. Could I use the API better_forecast API as starting point, or should I better wait for the officially documented API?

Hi and welcome to the forum! Also, sorry for the slow reply. We are ever-so-close to releasing the forecast API documentation. You can definitely start with better_forecast endpoint… I will also add you to a “beta test” thread we have going with some important upcoming changes.

1 Like

I am very interested in testing the forecast API.
I develop / enhance the PWS_Dashboard which already more then a year fully supports WeatherFlow/Tempest stations.
Demo of 2019-LTS release at https://pwsdashboard.com/pwsWD/

I would like to have the Tempest forecast available for every station-owners dashboard.

Wim
P.S. more information at https://pwsdashboard.com/

1 Like

I can also agree, would be great to get the better_forecast API :slight_smile: would give a huge open field in the widget programming as well.

1 Like

The forecast is available and very useful.
It contains a 10 day daily forecast, 240 hourly forecast AND the current station conditions. https://weatherflow.github.io/Tempest/api/swagger/
Very handy.

Sadly my Tempest station died after 6 weeks here near Brussels Belgium , same latitude as London UK

Not enough sun although is was placed above any obstacle and gets all available light 24/7. But support told me, that there was not enough light in the 6 weeks. Need 4 times as much to charge the device. The voltage dropped gradually over all 6 weeks. They seem to know for sure that it can not be a faulty unit. Either they have had more complaints. Or I have to prove that a brand new unit which does not charge its batteries over a 6 week period is faulty.
I have to wait for a sunny day to prove that it is not charged then either.

So for now i am fed up with Tempest, put the batteries back in the WeatherFlow. which Batteries need replacement once / year. But can now use a lower pole also.

If my tempest returns to live I will further develop the forecast script.
For now R.I.P. with all WeatherFlow and Tempest scripts and templates.

Luckily I gave always the same answer to local Dutch inquiries.
“Should I buy” was answered with wait and let me test.

To confirm, the forecast endpoint documented here is officially live and in production.

Sounds like you are a candidate for the power booster, which will be available soon.

1 Like

This Forecast API is great. I love that it adjusts on the fly when my Tempest reports a temp that differs from the expected hourly forecast.

I’m having one issue though with sunrise and sunset. As of when I’m posting it looks like the sunrise and sunset are off by 2 days. For example for today, 1/19/2021, it’s showing sunrise and sunset dates/times for 1/17/2021.

This is how I’m using the hourly forecast and sunrise/sunset data (work in progress):

1 Like

To what are you comparing? Keep in mind there can be small differences in the times depending on the algorithm/equations used. Here’s a quick comparison of a few sources for a location near me:

sunrise sunset
Tempest NOAA TimeAndDate Tempest NOAA TimeAndDate
1/19/2021 7:18 7:18 7:18 17:51 17:52 17:52
1/20/2021 7:17 7:18 7:18 17:52 17:53 17:52
1/21/2021 7:17 7:18 7:17 17:53 17:54 17:53
1/22/2021 7:17 7:17 7:17 17:54 17:55 17:54
1/23/2021 7:16 7:17 7:17 17:55 17:55 17:55
1/24/2021 7:16 7:17 7:16 17:56 17:56 17:56
1/25/2021 7:16 7:16 7:16 17:57 17:57 17:57
1/26/2021 7:15 7:16 7:16 17:57 17:58 17:58

I’m just going by the sunrise/sunset times and the date/time stamps given by the new forecast API for my Tempest (Center Hill, FL):

forecast":{“daily”:[{“day_start_local”:1611032400,“day_num”:19,“month_num”:1,“conditions”:“Clear”,“icon”:“clear-day”,“sunrise”:1610886084,“sunset”:1610924108,“air_temp_high”:68.0,“air_temp_low”:32.0,“precip_probability”:10,“precip_icon”:“chance-rain”,“precip_type”:“rain”},{“day_start_local”:1611118800,“day_num”:20,“month_num”:1,“conditions”:“Clear”,“icon”:“clear-day”,“sunrise”:1610972472,“sunset”:1611010558,“air_temp_high”:70.0,“air_temp_low”:41.0,“precip_probability”:10,“precip_icon”:“chance-rain”,“precip_type”:“rain”},{“day_start_local”:1611205200,“day_num”:21,“month_num”:1,“conditions”:“Partly Cloudy”,“icon”:“partly-cloudy-day”,“sunrise”:1611058859,“sunset”:1611097009,“air_temp_high”:72.0,“air_temp_low”:45.0,“precip_probability”:10,“precip_icon”:“chance-rain”,“precip_type”:“rain”},{“day_start_local”:1611291600,“day_num”:22,“month_num”:1,“conditions”:“Partly Cloudy”,“icon”:“partly-cloudy-day”,“sunrise”:1611145244,“sunset”:1611183460,“air_temp_high”:75.0,“air_temp_low”:54.0,“precip_probability”:10,“precip_icon”:“chance-rain”,“precip_type”:“rain”},

… trimmed …

For the first forecast day (today):
1611032400 would be 1/19 12:00 am (correct)
1610886084 would be sunrise 1/17 7:21 am (2 days prior)
1610924108 would be sunset 1/17 5:55 pm (2 days prior)

But if you look ahead 2 forecast days for 1/21 the sunrise/sunset times are for 1/19

Ah, I see! That’s certainly a bug - probably related to caching somehow. Thanks for reporting it - we’ll check it out soon.

Is this the same issue as reported here: Sunrise/sunset time anomaly?

2 Likes

Hope so! My (replacement) Sky with (replacement) Solar Panel finally gave up an hour ago due to low power from lack of light. Its done well this winter. They always die just as the weather gets interesting!

1 Like