Openweathermap one call api

Openweathermap has a "new" (don't know actually how new that is) API that provides data more similar to dark sky.

https://openweathermap.org/api/one-call-api

  • Current weather
  • Minute forecast for 1 hour (did not work for me in Europe)
  • Hourly forecast for 48 hours
  • Daily forecast for 7 days

I think the output of the daily forecast is more useable than the 5*8 output of the old forceast API.

Maybe node-red-node-openweathermap could be updated to also use this API, but doing a http request is easy enough.

Pull requests are welcome... but obviously the output format should remain the same as the old to be compatible. - or we accept a major version bump. Don't mind

or just a new option in addition to the already available options?
The only thing that is a bit annoying is that this new API apparently does not support city names, only lat and long.

made a PR

@cinhcet Thanks for mentioning the new API.
I have just started checking out openweathermap after realising the demise of Dark Sky. First thought was to see if a Node existed for it. I too noticed the one call API - it appears that this may offer more detailed information? I think this is my next project.

I am using this one-call API for a while now and I have to say that sometimes the predictions are a bit weird, for example the hourly predictions never say rain for a particular day, but the daily prediction does predict rain on a that day.

But still, I think it is quite usable.

If you want to try it, install from here https://github.com/cinhcet/node-red-web-nodes, since the only commits that are different to the master branch are the additions to the openweathermap node.
The Node-RED chiefs seem busy with 1.1, so no idea when this PR will be reviewed.
I think I should also change https to http in the api call before that can be merged.

Ah thanks for that info. I was hoping that I could get notified when it was about to start raining but maybe that is a big ask.
Good work on updating the code. I will challenge myself and see if I can install your version tomorrow.

I am not saying that the hourly predictions do never predict rain, they actually do and are more accurate than the daily ones. I just saw that there sometimes are inconsistencies between the hourly and daily predictions, which is kind of weird :slight_smile:

If you have trouble installing, let me know

Not sure if I have messed up?

I created ~/.node-red/node_modules/openweathermap (raspberry pi)
I copied in the openweathermap files from github
I ran npm install

Output was
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm notice created a lockfile as package-lock.json. You should commit this file.
added 47 packages from 58 contributors and audited 47 packages in 12.172s

1 package is looking for funding
run npm fund for details

found 0 vulnerabilities

What 47 packages have I installed ? I don't have openweathermap listed in node red pallet manager.

Edit: Ok I can see it has created /home/pi/.node-red/node_modules/openweathermap/node_modules and there are a load of packages in there. Oddly there is no openweathermap?

I have merged your PR... so should be in flows now.
(as you said it got missed in the general 1.1 beta noise)

Thanks :slight_smile:

Have you seen my comment about httpS vs http?
I am uncertain whether the onecall api should also use http as the others, not that this might cause some certificate issues?

since it is now on npm you can install via npm install node-red-node-openweathermap

missed that - guess we'll find out soon enough :slight_smile:

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.