Owntracks Geofence Notifications via Pushover

By subscribing to an mqtt topic on a broker where http://owntracks.org/ clients publish messages the message is then routed to pushover.net (see here for the additional node https://github.com/christoface/node-red-nodes/tree/master/social)

The flow includes testing inject nodes and debug nodes.

edit: Slightly updated to respect the changes introduced in recent Owntracks releases. ( >= 0.5.20 on Android )

[{"id":"30afc067.303e28","type":"mqtt-broker","broker":"127.0.0.1","port":"1883","clientid":""},{"id":"b17e1b76.093ff8","type":"mqtt in","name":"owntracks geofence","topic":"owntracks/#","broker":"30afc067.303e28","x":218,"y":156,"z":"6d79c438.ff5b3c","wires":[["3e40c2f6.e4e116","8d0129e.5d6a9d8"]]},{"id":"3e40c2f6.e4e116","type":"debug","name":"","active":false,"complete":false,"x":568,"y":155,"z":"6d79c438.ff5b3c","wires":[]},{"id":"995e2233.e7338","type":"pushover","name":"","title":"Node-Red Message","message":"","priority":"-1","x":604,"y":434,"z":"6d79c438.ff5b3c","wires":[]},{"id":"8d0129e.5d6a9d8","type":"function","name":"","func":"var message = \"\";\ndata = JSON.parse(msg.payload);\n\n// added _type \"transition\" used in newer Owntracks versions\nif ( ((data._type == \"location\") || (data._type == \"transition\")) && (data.event !== undefined ) ) {\n\t\n\t\tif ( data.event == \"enter\" ) {\t\t\t\n\t\t\tmessage = \"Entering Location: \";\n\t\t} else {\n\t\t\tmessage = \"Leaving Location: \";\n\t\t}\n\t\t\n\t\tif ( data.desc !== undefined ) {\n\t\t\t// Shared waypoint, comes with a description:\n\t\t\t\tmessage += data.desc;\n \t\t} else {\n \t\t\t// No description is set, non shared \"private\" waypoint\n \t\t\t\tmessage += data.lat + \",\" + data.lon;\n \t\t}\n }\n\nmsg.payload = message;\n\nreturn msg;","outputs":1,"noerr":0,"x":409,"y":280,"z":"6d79c438.ff5b3c","wires":[["18a7b075.87f27","fb062140.fd3d58"]]},{"id":"18a7b075.87f27","type":"switch","name":"","property":"payload","rules":[{"t":"cont","v":"Location"}],"checkall":"true","outputs":1,"x":570,"y":280,"z":"6d79c438.ff5b3c","wires":[["995e2233.e7338"]]},{"id":"fb062140.fd3d58","type":"debug","name":"","active":true,"complete":false,"x":569,"y":208,"z":"6d79c438.ff5b3c","wires":[]},{"id":"e2caf513.9d4fd8","type":"inject","name":"Test Shared Waypoint","topic":"","payload":"{\"_type\": \"transition\", \"lat\": 0.123, \"lon\": 5.678, \"tst\": \"1391715492\", \"acc\": \"500.0\", \"batt\": \"48\", \"desc\": \"Shared Test Waypoint\", \"event\": \"enter\"}","payloadType":"string","repeat":"","crontab":"","once":false,"x":214,"y":280,"z":"6d79c438.ff5b3c","wires":[["8d0129e.5d6a9d8"]]},{"id":"440af7bc.d17ed","type":"inject","name":"Test Private Waypoint","topic":"","payload":"{\"_type\": \"transition\", \"lat\": 1.234 , \"lon\": 6.789, \"tst\": \"1391715492\", \"acc\": \"500.0\", \"batt\": \"48\", \"event\": \"enter\"}","payloadType":"string","repeat":"","crontab":"","once":false,"x":213,"y":345,"z":"6d79c438.ff5b3c","wires":[["8d0129e.5d6a9d8"]]}]

Flow Info

Created 11 years ago
Updated 9 years ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • debug (x2)
  • function (x1)
  • inject (x2)
  • mqtt in (x1)
  • mqtt-broker (x1)
  • switch (x1)
Other

Tags

  • mqtt
  • owntracks
  • pushover
  • mqttitude
  • notifications
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option