# Odd pressure reading

**URL:** <https://discourse.nodered.org/t/odd-pressure-reading/2231>\
**Category:** General\
**Created:** [12 August 2018 04:41 UTC](https://discourse.nodered.org/t/odd-pressure-reading/2231 "2018-08-12T04:41:53Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Backup](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/backup/32/862_2.png) [@Backup](https://discourse.nodered.org/u/Backup)\
**Post date:** [12 August 2018 04:41 UTC](https://discourse.nodered.org/t/odd-pressure-reading/2231/1 "2018-08-12T04:41:53Z")

</div>

I have connected to [www.openweathermap.org](http://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:

```auto
[{"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. 🙂  
If anyone is interested in the setup I'll edit it and post.

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [12 August 2018 05:23 UTC](https://discourse.nodered.org/t/odd-pressure-reading/2231/2 "2018-08-12T05:23:29Z")

</div>

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

See the link here

> **[Bar (unit)](https://en.wikipedia.org/wiki/Bar_(unit))**
>
> The bar is a metric unit of pressure, but is not approved as part of the International System of Units (SI). It is defined as exactly equal to 100,000 Pa, which is slightly less than the current average atmospheric pressure on Earth at sea level.
> The bar and the millibar were introduced by the Norwegian meteorologist Vilhelm Bjerknes, who was a founder of the modern practice of weather forecasting.
> The International Bureau of Weights and Measures (BIPM) lists the bar as one of the "non-SI unit...

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

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [12 August 2018 06:56 UTC](https://discourse.nodered.org/t/odd-pressure-reading/2231/3 "2018-08-12T06:56:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [12 August 2018 08:45 UTC](https://discourse.nodered.org/t/odd-pressure-reading/2231/4 "2018-08-12T08:45:54Z")

</div>

If you go to [http://forecast.weather.gov](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`

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 August 2018 09:18 UTC](https://discourse.nodered.org/t/odd-pressure-reading/2231/5 "2018-08-12T09:18:16Z")

</div>

> [@zenofmud](#):
>
> showing that @krambriw is correct so you need to do the math  
> `1017 / 33.863753 = 30.03211133`

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

---

<div class="post-metadata">

**Author:** ![Backup](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/backup/32/862_2.png) [@Backup](https://discourse.nodered.org/u/Backup)\
**Post date:** [12 August 2018 14:29 UTC](https://discourse.nodered.org/t/odd-pressure-reading/2231/6 "2018-08-12T14:29:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Backup](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/backup/32/862_2.png) [@Backup](https://discourse.nodered.org/u/Backup)\
**Post date:** [12 August 2018 14:57 UTC](https://discourse.nodered.org/t/odd-pressure-reading/2231/7 "2018-08-12T14:57:57Z")

</div>

I just checked out openweathermap node and it doesn't accept location by zip code. When I was on the [weathermap.org](http://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](http://openweathermap.org) recommends.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 August 2018 15:22 UTC](https://discourse.nodered.org/t/odd-pressure-reading/2231/8 "2018-08-12T15:22:47Z")

</div>

Can't you use lat and lon?

---

<div class="post-metadata">

**Author:** ![Backup](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/backup/32/862_2.png) [@Backup](https://discourse.nodered.org/u/Backup)\
**Post date:** [12 August 2018 17:07 UTC](https://discourse.nodered.org/t/odd-pressure-reading/2231/9 "2018-08-12T17:07:46Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [12 August 2018 17:41 UTC](https://discourse.nodered.org/t/odd-pressure-reading/2231/10 "2018-08-12T17:41:58Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![Backup](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/backup/32/862_2.png) [@Backup](https://discourse.nodered.org/u/Backup)\
**Post date:** [12 August 2018 18:32 UTC](https://discourse.nodered.org/t/odd-pressure-reading/2231/11 "2018-08-12T18:32:18Z")

</div>

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. 😄

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [12 August 2018 19:40 UTC](https://discourse.nodered.org/t/odd-pressure-reading/2231/12 "2018-08-12T19:40:12Z")

</div>

@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?
