Odd pressure reading

#1

I have connected to www.openweathermap.org and am receiving weather data in json format. I've managed to split the data to individual items but pressure is making me wonder about units.
I'm getting 1017 for a reading and I'm used to 30.1.
I've set my units to imperial thinking it would be US units but maybe not(?).
My flow:

[{"id":"ee840f58.b446a8","type":"inject","z":"8892c80c.016f8","name":"","topic":"weather","payload":"{\"coord\":{\"lon\":-119.74,\"lat\":39.38},\"weather\":[{\"id\":802,\"main\":\"Clouds\",\"description\":\"scattered clouds\",\"icon\":\"03n\"}],\"base\":\"stations\",\"main\":{\"temp\":88.03,\"pressure\":1017,\"humidity\":9,\"temp_min\":82.4,\"temp_max\":96.8},\"visibility\":16093,\"wind\":{\"speed\":16.11,\"deg\":300},\"clouds\":{\"all\":40},\"dt\":1534035300,\"sys\":{\"type\":1,\"id\":2068,\"message\":0.0037,\"country\":\"US\",\"sunrise\":1534079345,\"sunset\":1534129089},\"id\":420025494,\"name\":\"Reno\",\"cod\":200}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":180,"y":220,"wires":[["c2f8b8bb.fef1f8"]]},{"id":"c2f8b8bb.fef1f8","type":"function","z":"8892c80c.016f8","name":"","func":"var temp = {topic:'temperature',payload: msg.payload.main.temp};\nvar hum = {topic:'humidity',payload: msg.payload.main.humidity};\nvar press = {topic:'pressure',payload: msg.payload.main.pressure};\nvar windd = {topic:'wind direction',payload: msg.payload.wind.deg};\nvar winds = {topic:'wind speed',payload: msg.payload.wind.speed};\n\n\nreturn [temp,hum,press,windd,winds];","outputs":5,"noerr":0,"x":370,"y":220,"wires":[["b8677ad.aca6888"],["a76ae0b3.f84eb8"],["fd4f399f.aa7ca"],["2d31a142.061086"],["e9124df0.50e62"]]},{"id":"a76ae0b3.f84eb8","type":"debug","z":"8892c80c.016f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":710,"y":260,"wires":[]},{"id":"fd4f399f.aa7ca","type":"debug","z":"8892c80c.016f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":710,"y":310,"wires":[]},{"id":"b8677ad.aca6888","type":"debug","z":"8892c80c.016f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","x":710,"y":210,"wires":[]},{"id":"2d31a142.061086","type":"debug","z":"8892c80c.016f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":710,"y":360,"wires":[]},{"id":"e9124df0.50e62","type":"debug","z":"8892c80c.016f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":710,"y":410,"wires":[]}]

Can anyone cast some light on this issue?
I did not include the http request node because it has my key and i'm only allowed one request per 10 minutes or they'll block me. :slight_smile:
If anyone is interested in the setup I'll edit it and post.

0 Likes

#2

The reading you get indicates you are getting it in millibar (mbar or mb)

See the link here

If you don't find how to get it in your desired format, I assume you would like it in Inch of mercury (inHg and ″Hg), you might have to convert it in a javascript/function node

1 inHg = 33.863753 mbar

0 Likes

#3

@Backup, don't forget we have a node for that
https://flows.nodered.org/node/node-red-node-openweathermap

0 Likes

#4

If you go to http://forecast.weather.gov and get the forcast for your area you will see this line:
Barometer 30.01 in (1016.3 mb)
showing that @krambriw is correct so you need to do the math
1017 / 33.863753 = 30.03211133

0 Likes

#5

Which you can do with a Range node if you like.

1 Like

#6

I was so excited about finding a free source for weather I didn't even think about a node specifically for that source. If it would only do the math I'd switch...
The description of the node explains why my wind speed is 16 when it's barely moving the leaves on my trees. Now to convert meters/second to mph.
Thanks for the input. Very helpful as always.

0 Likes

#7

I just checked out openweathermap node and it doesn't accept location by zip code. When I was on the weathermap.org website I used their find my city by city/country and got 5 us cities. By using zip=89511,us the answer is unambiguous. In smaller European countries I would guess there are not many cities with the same name but here, in various locations where I've lived, I've run into as many as 19 cities of the same name. That explains the motivation for our zip codes.
I was unable to find the city id for Reno which is what openweathermap.org recommends.

0 Likes

#8

Can't you use lat and lon?

2 Likes

#9

I tried lat and lon but zipcode was just easier and now it's all setup and working so I'm not in a hurry to change it.
I am trying to feed wind direction into a gauge node set to compass and at 300 degrees the pointer is pointing directly north. (??)
I wonder how hard it is to code a gauge that would have a Compass Rose as a background?

0 Likes

#10

@Backup Two points, slightly off topic.

Duplicate place names are not strictly a big country/Western Hemisphere issue. Germany has at least three cities named Frankfurt, and the UK has at least sixteen places called Weston. Long before zip codes, the Germans had a partial solution: Frankfurt am Main, Frankfurt an der Oder, and I don't know about the one in Bavaria. (Not to mention Weston-super-Mare and Weston in Gordano, only a few miles apart.)

Zip codes (post codes) have the problem that there is no international standard and changes are made all the time. Each country has its own system and one or more official servers for online lookup. (The Universal Postal Union database for Western Europe alone runs to more than 100 MB and is revised every month or two.) As @Colin says, lat/lon makes much more sense.

0 Likes

#11

I can just imagine the argument back when, "We're Frankfurt, No We're Frankfurt. Well,we were here first. Well, we're the biggest..."
In the western US it would have been a fist fight to a draw then an agreement to disagree.
My zip code has been steady for the 20 years I've lived in the area so I think I'm safe, but will switch over when I get other bugs worked out.
Thanks for the fun story. :smile:

0 Likes

#12

@Backup, you're welcome.

Same here. My house hasn't changed its zip code (or lat/lon) in 40 years, except when they added four digits (zip+4). The navigation system on my wife's car rejects an address with a nine-digit code ("invalid address"). According to the developer, this is a "known bug," as in never going to get fixed. Love software.

A friend in England recently moved from Twyford to Thatcham. People still ask: Which one?

0 Likes