# Openweathermap with GPS

**URL:** <https://discourse.nodered.org/t/openweathermap-with-gps/44410>\
**Category:** General\
**Created:** [19 April 2021 15:39 UTC](https://discourse.nodered.org/t/openweathermap-with-gps/44410 "2021-04-19T15:39:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roadrunny](https://avatars.discourse-cdn.com/v4/letter/r/73ab20/32.png) [@Roadrunny](https://discourse.nodered.org/u/Roadrunny)\
**Post date:** [19 April 2021 15:39 UTC](https://discourse.nodered.org/t/openweathermap-with-gps/44410/1 "2021-04-19T15:39:08Z")

</div>

Hello.  
I want to use my GPS data for latitude and longitude, because its a RV installation. Could someone help me please?

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [19 April 2021 17:39 UTC](https://discourse.nodered.org/t/openweathermap-with-gps/44410/2 "2021-04-19T17:39:29Z")

</div>

More information is required. Where is node-red running? What are you using to get current GPS?

---

<div class="post-metadata">

**Author:** ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)\
**Post date:** [19 April 2021 18:13 UTC](https://discourse.nodered.org/t/openweathermap-with-gps/44410/3 "2021-04-19T18:13:39Z")

</div>

Did you read the [openweather](https://flows.nodered.org/node/node-red-node-openweathermap) node page?  
You can feed the gps location with the help of **msg.location.lat** and **msg.location.lon** to the weather map node.  
Where is your gps data coming from? Do you have a sample msg.

---

<div class="post-metadata">

**Author:** ![Roadrunny](https://avatars.discourse-cdn.com/v4/letter/r/73ab20/32.png) [@Roadrunny](https://discourse.nodered.org/u/Roadrunny)\
**Post date:** [19 April 2021 18:44 UTC](https://discourse.nodered.org/t/openweathermap-with-gps/44410/4 "2021-04-19T18:44:14Z")

</div>

Hello.

I try this.

```auto
[{"id":"eb5ce843.efc7d8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"f438eb7d.9101e8","type":"change","z":"eb5ce843.efc7d8","name":"","rules":[{"t":"set","p":"lon","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":380,"wires":[["3e1180f7.7e18e"]]},{"id":"a51a875d.210db8","type":"victron-input-gps","z":"eb5ce843.efc7d8","service":"com.victronenergy.gps.ve_ttyACM0","path":"/Position/Latitude","serviceObj":{"service":"com.victronenergy.gps.ve_ttyACM0","name":"NMEA-0183 GPS (ACM0)","paths":[{"path":"/Altitude","type":"float","name":"Altitude (m)"},{"path":"/Course","type":"float","name":"Course (Deg)"},{"path":"/Fix","type":"integer","name":"Fix"},{"path":"/NrOfSatellites","type":"integer","name":"Number of satellites"},{"path":"/Position/Latitude","type":"float","name":"Latitude (LAT)"},{"path":"/Position/Longitude","type":"float","name":"Longitude (LNG)"},{"path":"/Speed","type":"float","name":"Speed (m/s)"}]},"pathObj":{"path":"/Position/Latitude","type":"float","name":"Latitude (LAT)"},"name":"msg.location.lat","x":160,"y":320,"wires":[["d42a2c2f.3810b"]],"outputLabels":["location.lat"]},{"id":"e9af3b71.315098","type":"victron-input-gps","z":"eb5ce843.efc7d8","service":"com.victronenergy.gps.ve_ttyACM0","path":"/Position/Longitude","serviceObj":{"service":"com.victronenergy.gps.ve_ttyACM0","name":"NMEA-0183 GPS (ACM0)","paths":[{"path":"/Altitude","type":"float","name":"Altitude (m)"},{"path":"/Course","type":"float","name":"Course (Deg)"},{"path":"/Fix","type":"integer","name":"Fix"},{"path":"/NrOfSatellites","type":"integer","name":"Number of satellites"},{"path":"/Position/Latitude","type":"float","name":"Latitude (LAT)"},{"path":"/Position/Longitude","type":"float","name":"Longitude (LNG)"},{"path":"/Speed","type":"float","name":"Speed (m/s)"}]},"pathObj":{"path":"/Position/Longitude","type":"float","name":"Longitude (LNG)"},"name":"msg.location.lon","x":160,"y":380,"wires":[["f438eb7d.9101e8"]],"outputLabels":["location.lat"],"info":"[]()"},{"id":"d8673083.4d483","type":"http request","z":"eb5ce843.efc7d8","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://api.openweathermap.org/data/2.5/weather?lat={{{msg.payload}}}&lon={{{msg.payload2}}}&appid=e0485e8b5da1e71bf2c06227cb1669d1","tls":"","persist":false,"proxy":"","authType":"","x":850,"y":340,"wires":[["1f8c4703.d5f8a9"]]},{"id":"1f8c4703.d5f8a9","type":"debug","z":"eb5ce843.efc7d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1050,"y":340,"wires":[]},{"id":"ba7809ae.1eae68","type":"debug","z":"eb5ce843.efc7d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":830,"y":280,"wires":[]},{"id":"d42a2c2f.3810b","type":"change","z":"eb5ce843.efc7d8","name":"","rules":[{"t":"set","p":"lat","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":320,"wires":[["7fb8d5b9.c2d40c"]]},{"id":"53668a86.01cd14","type":"debug","z":"eb5ce843.efc7d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload2","targetType":"msg","statusVal":"","statusType":"auto","x":840,"y":400,"wires":[]},{"id":"7fb8d5b9.c2d40c","type":"function","z":"eb5ce843.efc7d8","name":"","func":"\nreturn {payload:(flow.get('lat'))};","outputs":1,"noerr":0,"initialize":"","finalize":"","x":580,"y":320,"wires":[["d8673083.4d483","ba7809ae.1eae68"]]},{"id":"3e1180f7.7e18e","type":"function","z":"eb5ce843.efc7d8","name":"","func":"\nreturn {payload2:(flow.get('lon'))};","outputs":1,"noerr":0,"initialize":"","finalize":"","x":580,"y":380,"wires":[["d8673083.4d483","53668a86.01cd14"]]}]

```

[edited to add ``` before and after the paste to make it importable]

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [19 April 2021 19:38 UTC](https://discourse.nodered.org/t/openweathermap-with-gps/44410/5 "2021-04-19T19:38:42Z")

</div>

Try this example, I do not have Victron GPS installed so added some injects to simulate. Hope it helps

```auto
[{"id":"af6ff1f0.eba958","type":"inject","z":"eb5ce843.efc7d8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"lat","payload":"52.345","payloadType":"num","x":130,"y":260,"wires":[["8a66ced3.808b4"]]},{"id":"8a66ced3.808b4","type":"join","z":"eb5ce843.efc7d8","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":290,"y":300,"wires":[["b4f01eb9.07fd38"]]},{"id":"42170af1.eff4fc","type":"inject","z":"eb5ce843.efc7d8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"lon","payload":"2.343","payloadType":"num","x":120,"y":340,"wires":[["8a66ced3.808b4"]]},{"id":"b4f01eb9.07fd38","type":"change","z":"eb5ce843.efc7d8","name":"","rules":[{"t":"set","p":"payload.appid","pt":"msg","to":"e0485e8b5da1e71bf2c06227cb1669d1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":320,"wires":[["ba7809ae.1eae68","d8673083.4d483"]]},{"id":"ba7809ae.1eae68","type":"debug","z":"eb5ce843.efc7d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":830,"y":280,"wires":[]},{"id":"d8673083.4d483","type":"http request","z":"eb5ce843.efc7d8","name":"","method":"GET","ret":"txt","paytoqs":"query","url":"http://api.openweathermap.org/data/2.5/weather","tls":"","persist":false,"proxy":"","authType":"","x":850,"y":340,"wires":[["1f8c4703.d5f8a9"]]},{"id":"1f8c4703.d5f8a9","type":"debug","z":"eb5ce843.efc7d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1050,"y":340,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![Roadrunny](https://avatars.discourse-cdn.com/v4/letter/r/73ab20/32.png) [@Roadrunny](https://discourse.nodered.org/u/Roadrunny)\
**Post date:** [20 April 2021 07:08 UTC](https://discourse.nodered.org/t/openweathermap-with-gps/44410/6 "2021-04-20T07:08:08Z")

</div>

It works. I have to change the topic from my Victron source. Now it works. Thank you very very much.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [4 May 2021 07:08 UTC](https://discourse.nodered.org/t/openweathermap-with-gps/44410/7 "2021-05-04T07:08:12Z")

</div>

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