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}]
admin-lm

Flow Info

created 4 months, 2 weeks ago

Node Types

Core
  • http request (x1)
  • inject (x1)
Other
  • Slack Bot Out (x1)
  • rbe (x1)
  • ui_group (x1)
  • ui_tab (x1)
  • ui_text (x1)

Tags

  • Slack
  • IP
  • IP-Address
  • Public
  • Bot
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option