Location-based flows/nodes

1,183 views
Skip to first unread message

Zoltán Balogh

unread,
Oct 29, 2014, 7:43:55 AM10/29/14
to node...@googlegroups.com
Hi everyone,

We have been investigating the extension of nodes to encompass location information (latitude, longitute) alongside payloads. For example I modified the Instagram node (available under node-red-web-nodes, https://github.com/node-red/node-red-web-nodes )  so that it now sends msg.lat (latitude), msg.lon (longitude) and msg.time (photo capture time) in addition to the usual photo payload. You can see my changes under my pull request: https://github.com/node-red/node-red-web-nodes/pull/44 .

With location, we could do cool things such as: tweeting "I'm Hungry" with location information embedded enabled in it. Node-RED could pick this message up, check the weather report/forecast for my area and either recommend home delivery/takeaways or restaurants, depending on the weather.

An example flow that I assembled is now available on the wiki ("Extract my location from my Instagram photo then check weather for my location"):


We would now like to identify all the existing nodes that could benefit from sending location information alongside their usual payloads. I tried to assemble a list of useful nodes to start with:

twitter in (time and location of tweet)
Google Calendar (if we add an input node then the location of appointments)
Swarm (Foursquare) (checkins)
Dropbox (especially for input nodes, example a photo has been uploaded with EXIF data storing location)
Openweathermap (lat, lon of a particular place the weather is reported for)
dweet.io (the device would need to dweet its location)
Heatmiser (we'd need to provide configurable device location alonside measurement timestamps)
email (only date/time available so not sure if it's useful)
fitbit (not sure how relevant the workout times or the user's default location are)

Is there anything I'm missing? If you're using any particular node where location could be useful to you, please let us know. Additionally example flows and ideas are also welcome, maybe the wiki page above could be extended with examples? These examples could be added to the flow library when finalised.

Thanks,

Zoltan

Ben Hardill

unread,
Oct 29, 2014, 6:44:28 PM10/29/14
to node...@googlegroups.com
OwnTracks (used to be mqttitude) - http://owntracks.org/

Would be good to doing geo fencing type scripts.

Nicholas O'Leary

unread,
Oct 29, 2014, 6:54:30 PM10/29/14
to node...@googlegroups.com

On the Dropbox example you mention, it would be more useful to have an EXIF node that can extract all of the tags from an image (including location if set) rather than require every node that deals with file services (file-in, Dropbox, box, s3,...) to have code in them that tries to guess a file is an image and then parse out the details.

Nick

--
http://nodered.org
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

George Hahn

unread,
Oct 29, 2014, 7:08:21 PM10/29/14
to node...@googlegroups.com
I second OwnTracks for user-location dependent flows. It runs off of GPS and iBeacons (for iOS) or AltBeacons (for Android; iBeacon parsing available via user preferences). I contributed the AltBeacon code and have been running it for almost a month now; It's pretty awesome for getting granular (~1m) location information. (NB The AltBeacon code isn't live on the Play Store just yet.)

Dave C-J

unread,
Oct 29, 2014, 7:19:01 PM10/29/14
to node...@googlegroups.com
I have a very simple exif node using the exif npm, though it was taking in an image as payload and just returning the data (in my case the image carried on via another route) - happy to contribute that as a basis and have it changed to suit if necessary.

Zoltán Balogh

unread,
Oct 30, 2014, 11:54:54 AM10/30/14
to node...@googlegroups.com
Dave, it would be great if you could contribute your exif node to the project. I personally don't see any problem in it reading in data from an image. Is your exif node expecting to receive the image as a buffer payload? The Instagram node I created sends a buffer (or a URL) so I personally believe an exif node that takes a buffer is probably the best solution. (We need to standardise what is the most likely representation of certain data types inside flows!)

Even if your exif node is half-baked or doesn't read in buffers, I'm happy to take a look at it and take over the work on it!

Thanks

Zoltán Balogh

unread,
Oct 30, 2014, 11:56:46 AM10/30/14
to node...@googlegroups.com
OK, I'll take a look at OwnTracks and will consider writing an OwnTracks node. Sounds like a very useful feature indeed! Thanks! I'll come back very soon with a proposed node-design that will be a new open issue on GitHub against node-red-web-nodes!

Zoltán Balogh

unread,
Oct 31, 2014, 12:05:05 PM10/31/14
to node...@googlegroups.com
Hi everyone,

I played around with OwnTracks today. I took a look at its architecture (Smartphone client => any MQTT broker => Optional Backend). I think as a possible simplest use case for Node-RED, we could simply hook up a node to the MQTT broker ourselves. That is sufficient as the data provided is such as:

{"_type": "location", "lat": "51.0260224", "lon": "-1.3970194", "tst": "1414771115", "acc": "24.14"}

What do you guys think? Would it be more "cool" or easier to sell a standalone OwnTracks node?

I personally believe that using OwnTracks doesn't justify creating a separate node, maybe just only the creation of an example flow would be enough. (People using OwnTracks will have at least basic understanding of what a broker is and they are likely to be running their own broker already so they wouldn't find it difficult to configure an MQTT node alongside maybe a function node that then converts the location into a format most of our location-based nodes would be able to consume.)

Thoughts?

George Hahn

unread,
Oct 31, 2014, 1:12:16 PM10/31/14
to node...@googlegroups.com
While it's perfectly straightforward to get OwnTracks information out of a MQTT node, it'd be really convenient to have a dedicated OwnTracks node that would split out all of the OwnTracks messages to different outputs. Being able to get parsed location, waypoints, and beacons data directly would certainly help clean up flows, as it is currently necessary to use no fewer than two nodes to accomplish this (1 MQTT + 1 function).

Ben Hardill

unread,
Nov 7, 2014, 4:28:38 AM11/7/14
to node...@googlegroups.com
Also been thinking that a geo-fence node would be useful

Basically a filter that only lets messages through that fall with in a given box or circle.

I'm thinking 2 modes to start with:

1) give 2 sets of coordinates that describe a box
2) a point and a radius to describe a circle

Might want to add polly-line areas in the future, but that might make things too complicated.


On Wednesday, 29 October 2014 11:43:55 UTC, Zoltán Balogh wrote:

chris mobberley

unread,
Nov 7, 2014, 4:36:08 AM11/7/14
to node...@googlegroups.com
I currently use owntracks for tweeting the weather in my location and also tracking my journeys using simple mqtt node: http://prntscr.com/53v2ww


There's a lot you can do with owntracks already, you can add a geofence in if you want to and it will push a payload to say whether you have entered or exited the area.

Final point, you could easily produce via owntracks a more smart central heating system that heats up when you hit a geofenced location and turns off as you leave. I bought a tado thermostat which works on this exact principle. I'v managed to get the data out of that app already as shown below, but It would be awesome to see someone produce the same with owntracks + IOT'd home thermo for a fraction of the price.


Nicholas O'Leary

unread,
Nov 7, 2014, 4:56:25 AM11/7/14
to node...@googlegroups.com
A geo-fencing node was been on my long-term todo list since early on... but I doubt I'm going to get near it any time soon.

To make it easy for the user, I can picture a map view in its edit dialog that lets you draw the fences you are interested in. (as well as allowing entry of raw coordinates in either a box or point-and-radius mode).

N

Mark Setrem

unread,
Nov 7, 2014, 6:46:40 AM11/7/14
to node...@googlegroups.com
I'm also using Owntracks, which is great.

George missed out one of the MQTT outputs from Owntracks which on the iPhone is "_type":"steps" where you can poll your Phone to get the number of steps taken, floors climbed/descended in that day.

The geofence node sounds like a fantastic idea.  I'm also using Owntracks for geolocation, which I'm using for location (and direction) sensitive travel information.
e.g if I travel through Reading and then within 40mins travel through Slough I'm probably going to London so wait 10 mins then message me the current Underground Line status from Paddington.  

For geofences, Owntracks (at least on the iPhone) just acts as a conduit to the underlying iOS functionality. This has a number of limitations,  iOS can only track a maximum of 20 geofences also the iOS functionality can't cope with you popping up in the middle of a geofenced area.  So for example if you arrive at a rail-terminus on the underground the geofence covering the station won't trigger as the first signal sent is within the zone.  

I imagine any Geofence node would be triggered by first message within the fence so would be great adjunct to the capabilities Owntracks enables.


 


Matteo Pratosmart

unread,
Nov 12, 2014, 8:15:04 AM11/12/14
to node...@googlegroups.com
Nice argument,

One thing concerning data georeferencing:

- Is possible to "send" georeferenced data to OpernStreetMap in a web dashboard?

Wich is the best solution in your opinion?

Thanks!
Matteo
Reply all
Reply to author
Forward
0 new messages