[App][Pro] OpenWeather

Hi, seems I forgot to adapt a piece of code. I’ll fix this asap and provide a new version.
Btw. what device did not work? OneCall current weather?

New live version 1.4.4

  • versions 1.4.2 to 1.4.4 are bugfixes (device availability, pair view error)

@DuMees
the pair process is fixed in new live version 1.4.4

I get “enter a valid API Key” error. This appears to be due to the location. I leave the location blank and I get the error…I put in Anchorage (Alaska) and it doesn’t pull up any location. If I use some random location that is available it works fine. Can’t get Anchorage Alaska to work

Is there a way to enter a lat/long instead of a city so that it makes the proper call to OpenWeather?

I can pull this directly and it returns data for America/Anchorage
https://api.openweathermap.org/data/3.0/onecall?lat=61.2181&lon=-149.9003&appid=MYKEYHERE

Hi,
I assume…

  • we are talking about the OneCall-API,
  • you already created an OneCall API key that’s already active (needs some hours)
  • and you are trying to add this device?
    grafik

Insert you key and leave the location empty. Then the device uses your Homey Lan/Lot position (from Homey settings):

grafik

You can change the Lan/Lot in device settings afterwards.

I get the following entries:
grafik

Problem: OWM only returns 5(!) entries as result. If there are more than 5 cities with the same name, only the first 5 are displayed.

Using this search phrase, the autocomplete field doen’t show a result, but going forward in pair view you get a list of canadian cities:

grafik

grafik

I hope it’s shown in this list now :slight_smile:

…I’ll check why the autocomplete list doesn’t show these cities searching for “Anchorage,CA”…

Yes, Exactly that process but Anchorage wasn’t bringing up any locations…now it is and the station is added. The URL call worked so I knew the API was active. Strange…
Anyway…It’s working now.
Thanks

1 Like

New test version 1.5.0:

  • Added new device for historical data (and 4 day forecast) with daily summary.
    Use this device to check amount of rain for the last days.
  • Added instuctions to pair view.

Some hints for daily summary device:

  • It uses OneCall API 3.0. You need a OneCall API key with subscription to use this device.
  • To prevent unneccessary API calls you can change the period in device settings to a larger period (60min). Or you can deactivate auto update in device settings and request new data once a day using the device flow action.
  • The historical data is currently limited in the app to -365 days. If there are needs to request older data, please let me know.
  • Based on the API description also forecasts are allowed (up to 4 days). This should allow to read estimated rain amount (for the whole day) for upcoming days.
  • Some values like rain are daily summations, other values like temperature or wind speed are maximum values.

Please keep in mind, that every added device where you have inserted an API key in pair view or device settings is calling the API in the period defined in device settings.
If you are adding 5 devices for daily summary, every device is calling the API itself. Using a period of 5min this results in 288 calls for every device.
If you are using several devices, increase the period or deactivate auto update and use flow actions for daily updates.

2 Likes

i got a suscribtion, an i generate a new key - but it will not work:
image

Ok, after a restart of the app an delete the old one, i can use this Device.

It can take some hours until a new key gets activated.

1 Like

Is it possible to use 2 different API-Keys? F.e. the OneCall 2.5 for current weather, hourly and daily forecast, and the OneCall 3.0 only for historical weather?
Because I generated a OneCall 3.0 API key and I’m not able to add the “daily summary” device. A info is shown “Please enter a valid API key.”.

Or does it have something to do with that?

Yes, you can. You cal also use a unique key for each device that needs a key.

I also use an old 2.5 OneCall key for the current weather and a new 3.0 for histirical data. If you use separate eMails, then the amount of calls is counted seperately. If you have several keys in your account it’s summated (as far as I read in OWM description).

Have you added your subscription data for the 3.0 key?
If yes, than it seems it needs some time to activate the key.

Now it works with 2 API keys. I guess the key wasn’t activated this morning.

Yes, that’s correct. But isn’t the OneCall 2.5 for free?

Yes, but I don’t know how OWM counts in case of two OneCall keys in one account (2.5 and 3.0). I would assume 2.5 has its own 1000 calls free and then gets rate limited, and the 3.0 has also 1000 calls and gets billed then. But I haven’t tried this combination.

Hi @RonnyW, this “Last 24 hours” insights screenshot shows the rainfall in mm from yesterday:

That the rainfall amount from yesterday is displayed today, is absolutely clear. But why drops the amount from 5.60 mm to 1.74 mm at 4 am?
In my opinion the yesterdays rainfall amount with about 5.60 mm has to be displayed the complete day, so from midnight to midnight.

Yes, you are right. I would expect the same value for 24h.
OWM only uses the date as request parameter, not an UTC timestamp like used in other requests.
I try to log the value and the date to compare these values. The first capability in device details should change at 00:00h and shouldn’t change until the next day.
If that’s the case it seems OWM adjusted the value during the day (like for daily forecast with offset of 0 days).

Then it could be best to deactivate the auto update and do a single update via flow at 01:00 for example.

1 Like

I logged the OWM data updates during the last days and it seems OWM updates the data at 0:00 and 4:00. But I don’t know which data is correct (no rain the last days).

The date for data request is the local date (changes at local tom 0:00). I thought perhaps it’s something with timezone differences, but in this case the difference should be 2h and not 4h. :man_shrugging:

Interesting. In my case the amount of rain between 0:00 - 4:00 should be right, so about 5.6 mm. Because I measured approximately the same amount with my Netatmo Rain Sensor. It was about 5.4 mm (Link).
That means, that the value after 4:00 isn’t correct. The question is: Why?

Yes, the value available from 0:00 to 4:00 is correct.
So best would be to deactivate auto update for this device and update once a day from a flow.

I wonder if it’s caused by DWD data or if it’s general OWM issue.
Means: Is is working right in other countries with different weather provider?

1 Like

At first: Yes, I’ve an API-Key for the “one call Api 3.0” and activated it.

But I’ve an issue with the hourly forecast for some parameters. Temperature, description and some other are running fine. But the value i need, cloudiness, shows the same value for the next 23 hours (shown at the “status indicator”). And that can’t be correct, cause the description is changing.

I tried it by updating with the auto-update / polling active/interval and also / only with a flow. Nothing works.

Any ideas why I’m not able to get the correct values for the hourly forecast? Thanks a lot!

Thanks for reporting. Could be a bug caused by the code cleanup some weeks ago. I will check this and give you a feedback.