Hi, I’m having a very bad time trying to get the Openweathermap integration to do what I need.
I have tried every example I could find to get the condition forecast info so that I can pass it on to esphome, but nothing works. (even the code posted as an example)
The integration is working 100%, but I cannot seem to extract the forecast information.
Any help would be appreciated.
I believe the Integration has changed recently and no longer provides forecast data. Either June or July update is when the change happened, but don’t quote me on that one, I was using the forecast data to make weather announcements and noticed one day they stopped working as expected.
I missed that. I have changed the code now to use an automation to get the info and store in in a text “variable”, but still I get no data. Here is the new code:
HA decided to remove the forecast sensor recently, which was through the 6 months grace period for its deprecation.
It might be that event you are think of.
Today you need to make a service call to get the forecast, which OP looks like he is doing.
Ahh, I found what Maximo might be referring to.
OpenWeatherMap has changed API to V3.0 and the old V2.5 was closed in June.
If your API is not set up recently, then you might still be connecting to the old V2.5 API which does not work anymore.
Hi, I have changed it to V3.0. I even uninstalled the integration, upgraded my Openweathermap account, got a new API key, re-installed the integration, and tested it to ensure it works.
All the other sensors created by the integration works correctly and I can view the forecast when I view the “info” for the weather.openweathermap sensor, but I cannot retrieve the info to use it.
Ok, so I have modified my automation, restarted Homeassistant, and triggered the automation twice just to be sure, but still no result in input_text.12_hr_forecast.
I did a “trace” on the automation and it is getting a result from the service call. It is just not stored in the input_text.12_hr_forecast entity.
I’m not sure why not.
its because your forecast is stored in a response variable called daily, but you are using that variable anywhere in your service call to set the input text helper.
Check the link for weather again and look at the two examples in the bottom.
Ok, I eventually got it to work.
While troubleshooting my code I somehow changed the helper name from input_text.12_hr_forecast to input_text.12_hour_forecast, so even though the code was eventually correct the helper was not updated because it did not exist.
Here is the working automation, maybe it can help somebody else:
In your first post you put hourly where it should have read daily. I gave you the answer in the post #2 immediately below. Then you changed a lot of other things, and eventually got a more complex solution. If you want to do without the input helper, you can simply fix the response variable.
The problem is that even changing hourly to daily did not work.
I’m not sure if it was because I was using it in an automation or maybe a typo, but it did not work.
The YAML editor won’t even let me save the code as per the first post:
It was because you changed multiple things at once. Fix the response variable, add a flawed input helper. But we could not know the input helper was entered the wrong way. I don’t really mind, except for the fact that the solution tag is now on a solution that requires an extra input helper that shouldn’t be needed. So for those coming here for the solution, it should be clear the first attempt was almost right.
The logs would probably have shown the mistake by the way.