Openweathermap with GPS

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

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

Did you read the openweather 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.

Hello.

I try this.

[{"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]

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

[{"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":[]}]
1 Like

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

1 Like

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