Send Raspberry Pi IP address via Telegram

Send the command /ip via telegram to the bot you have set up and it will answer back with the Raspberry Pi's IP address.

[{"id":"35feb884.bd5478","type":"link in","z":"df2398d5.956ea8","name":"","links":["21be9a2f.daf7a6","b9ab70c4.1723c"],"x":675,"y":160,"wires":[["33815a04.cfaf16"]]},{"id":"33815a04.cfaf16","type":"exec","z":"df2398d5.956ea8","command":"hostname -I","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":790,"y":160,"wires":[["af7b3d5c.0a659"],[],[]]},{"id":"3126966f.81c91a","type":"link out","z":"df2398d5.956ea8","name":"fromIPTelegram","links":["ab026bfd.bfdf78","41bbf922.e61fd8"],"x":1055,"y":160,"wires":[]},{"id":"af7b3d5c.0a659","type":"split","z":"df2398d5.956ea8","name":"","splt":"172.","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"key","x":950,"y":140,"wires":[["8d740826.c66418"]]},{"id":"8d740826.c66418","type":"switch","z":"df2398d5.956ea8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":":","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":950,"y":180,"wires":[[],["3126966f.81c91a"]]},{"id":"9433ef6c.e5627","type":"comment","z":"df2398d5.956ea8","name":"IP para Telegram","info":"","x":740,"y":80,"wires":[]},{"id":"a85a9846.f5c598","type":"telegrambot-command","z":"df2398d5.956ea8","name":"/ip","bot":"13325c7e.01d734","command":"/ip","commandType":"str","commandCase":false,"x":150,"y":140,"wires":[["b9ab70c4.1723c"]]},{"id":"b9ab70c4.1723c","type":"link out","z":"df2398d5.956ea8","name":"from /ip","links":["fb8cb6f7.942de8","9e53bfc2.e3329","35feb884.bd5478"],"x":255,"y":140,"wires":[]},{"id":"f618833e.1d211","type":"debug","z":"df2398d5.956ea8","name":"Telegram","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":480,"y":140,"wires":[]},{"id":"26b0ffac.ff896","type":"function","z":"df2398d5.956ea8","name":"Formato para Telegram","func":"//msg._msgid = flow.get(\"_msgid\");\n\nvar text = msg.payload;\n\nmsg.payload='{\\n\"text\": \"'+ text + '\"\\n}'\n\n//',\\n\"parse_mode\": \"Markdown\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":270,"y":180,"wires":[["6a41fc1b.2b5004","f618833e.1d211"]]},{"id":"41bbf922.e61fd8","type":"link in","z":"df2398d5.956ea8","name":"toTelegram","links":["2ee2f44.af4b60c","d6c75b00.d39148","592da6a.2e70a58","9d675fa0.f90c","ec254b84.b17bc8","a3fe156e.ad71d8","73af0803.c282c8","2c8ae8da.bf31f8","dc5307d8.6fd2e8","4905f533.8fc32c","8ec3a41c.f25008","9532c2cf.fc3af","3126966f.81c91a"],"x":115,"y":180,"wires":[["26b0ffac.ff896"]]},{"id":"6a41fc1b.2b5004","type":"telegrambot-payload","z":"df2398d5.956ea8","name":"Send","bot":"13325c7e.01d734","chatId":"","sendMethod":"sendMessage","payload":"","x":470,"y":180,"wires":[[]]},{"id":"6c9a8466.812ebc","type":"comment","z":"df2398d5.956ea8","name":"Parte de Telegram","info":"","x":180,"y":80,"wires":[]},{"id":"13325c7e.01d734","type":"telegrambot-config","botname":"DisErgo0_Bot","usernames":"","chatIds":"","pollInterval":"300"}]

Flow Info

Created 4 years, 2 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • comment (x2)
  • debug (x1)
  • exec (x1)
  • function (x1)
  • link in (x2)
  • link out (x2)
  • split (x1)
  • switch (x1)
Other
  • telegrambot-command (x1)
  • telegrambot-config (x1)
  • telegrambot-payload (x1)

Tags

  • raspberry
  • pi
  • telegram
  • ip
  • telegrambot
  • ipaddress
  • wifi
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option