Skip to content

Instantly share code, notes, and snippets.

@juzam juzam/README.md Secret
Last active Dec 3, 2015

Embed
What would you like to do?
Owntracks Geofence Notifications via Pushover
[{"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"]]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.