Skip to content

Instantly share code, notes, and snippets.

@admin-lm
Last active February 13, 2017 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save admin-lm/1214182c856f978e9675eb683c406d3a to your computer and use it in GitHub Desktop.
Save admin-lm/1214182c856f978e9675eb683c406d3a to your computer and use it in GitHub Desktop.
Slack Notification on Public IP Change

Flow requests every hour the public IP-Address, if it changes, flow sends a notification to slack channel and updates dashboard text.

1: npm install node-red-contrib-slack

2: Create Slack team at: https://slack.com

3: Create slack bot at: https://my.slack.com/services/new/bot

4: Add slack bot to your channel

5: Import flow

6: Copy API Key to Slack Bot Out Node

[{"id":"bb6e0eec.efb4a","type":"inject","z":"ea85601f.c546c","name":"Repeater 1h","topic":"","payload":"","payloadType":"date","repeat":"3600","crontab":"","once":false,"x":140,"y":60,"wires":[["fab5c866.c50468"]]},{"id":"fab5c866.c50468","type":"http request","z":"ea85601f.c546c","name":"Get Public IP","method":"GET","ret":"txt","url":"https://api.ipify.org","tls":"","x":350,"y":60,"wires":[["91b1de0.d2d53a"]]},{"id":"91b1de0.d2d53a","type":"rbe","z":"ea85601f.c546c","name":"Change Blocker","func":"rbe","gap":"","start":"","inout":"out","x":560,"y":60,"wires":[["e8dc61b7.ad4ad8","c037f9ac.e63c48"]]},{"id":"e8dc61b7.ad4ad8","type":"Slack Bot Out","z":"ea85601f.c546c","name":"Slack Notifiaction","apiToken":"","channel":"general","x":810,"y":60,"wires":[]},{"id":"c037f9ac.e63c48","type":"ui_text","z":"ea85601f.c546c","group":"42f8f6e6.576c38","order":3,"width":0,"height":0,"name":"Public IP","label":"IP-Adresse","format":"{{msg.payload}}","layout":"row-spread","x":780,"y":120,"wires":[]},{"id":"42f8f6e6.576c38","type":"ui_group","z":"","name":"Devices","tab":"f39a553a.48d3d8","order":1,"disp":true,"width":"6"},{"id":"f39a553a.48d3d8","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order":1}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment