Telegram Universal Smart Remote

Hey Guys i made an Simple but Realy Powerfull Smart Remote with the Telegram Bot and the Keyboard/Inline Keyboard
It ist Basicly Possible to Control everything that uses Home Assistant / Node Red.

Edit :

i made a small Example for Node Red in the Service Call Nodes in “target” you need to change the “xxxx” with your Chat id from your Telegram Bot, then it should work, Just type Back1 to Start the first Remote.

[{"id":"67217c7b.340b74","type":"api-call-service","z":"4016378a.be2518","name":"","server":"424f9bae.3ec364","version":1,"debugenabled":false,"service_domain":"telegram_bot","service":"send_message","entityId":"","data":"{\"message\": \"Button1\",\t\"title\": \"Living Room\",\t\"target\": 'xxxx',\t\"keyboard\": \t  [\"Back1\",\"Button1,Button2\",\"Button3,Button4\",\" ExtraButton\"]}\t","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1360,"y":160,"wires":[[]]},{"id":"7057e41f.cb2b5c","type":"server-events","z":"4016378a.be2518","name":"","server":"424f9bae.3ec364","event_type":"telegram_text","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"x":400,"y":180,"wires":[["6228823.a21537c","4e36b140.1b462"]]},{"id":"6228823.a21537c","type":"change","z":"4016378a.be2518","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"msg.payload.event.text","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":200,"wires":[["818d9df0.70083","92629f3a.e007d"]]},{"id":"818d9df0.70083","type":"switch","z":"4016378a.be2518","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Test1","vt":"str"},{"t":"eq","v":"Back1","vt":"str"},{"t":"eq","v":"Test2","vt":"str"},{"t":"eq","v":"ExtraButton","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1030,"y":240,"wires":[["67217c7b.340b74"],["92a97a2a.79aea8"],["90ef7b08.063b68"],["f7249a56.ea9018"]]},{"id":"92a97a2a.79aea8","type":"api-call-service","z":"4016378a.be2518","name":"","server":"424f9bae.3ec364","version":1,"debugenabled":false,"service_domain":"telegram_bot","service":"send_message","entityId":"","data":"{\"message\": \"Main\",\t\"title\": \"Living Room\",\t\"target\": 'xxxx',\t\"keyboard\": \t  [\"Test1,Test2\"]}\t","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1360,"y":220,"wires":[[]]},{"id":"90ef7b08.063b68","type":"api-call-service","z":"4016378a.be2518","name":"","server":"424f9bae.3ec364","version":1,"debugenabled":false,"service_domain":"telegram_bot","service":"send_message","entityId":"","data":"{\"message\": \"Button2\",\t\"title\": \"Living Room\",\t\"target\": 'xxxx',\t\"keyboard\": \t  [\"Back1\",\"Button 5,Button6\"]}\t","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1360,"y":280,"wires":[[]]},{"id":"416d1c87.14cc34","type":"server-events","z":"4016378a.be2518","name":"","server":"424f9bae.3ec364","event_type":"telegram_callback","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"x":410,"y":240,"wires":[["4e36b140.1b462","6228823.a21537c"]]},{"id":"4e36b140.1b462","type":"change","z":"4016378a.be2518","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"msg.payload.event.data","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":240,"wires":[["818d9df0.70083","92629f3a.e007d"]]},{"id":"92629f3a.e007d","type":"switch","z":"4016378a.be2518","name":"Trigger","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Button1","vt":"str"},{"t":"eq","v":"Button2","vt":"str"},{"t":"eq","v":"Button3","vt":"str"},{"t":"eq","v":"Button4","vt":"str"},{"t":"eq","v":"Button5","vt":"str"},{"t":"eq","v":"Button6","vt":"str"},{"t":"eq","v":"-ExtraButton1","vt":"str"},{"t":"eq","v":"-ExtraButton2","vt":"str"}],"checkall":"true","repair":false,"outputs":8,"x":1040,"y":380,"wires":[[],[],[],[],[],[],[],[]]},{"id":"f7249a56.ea9018","type":"api-call-service","z":"4016378a.be2518","name":"","server":"424f9bae.3ec364","version":1,"debugenabled":false,"service_domain":"telegram_bot","service":"send_message","entityId":"","data":"{\"message\": \"Switches\",\t\"title\": \"Living Room\",\t\"target\": 'xxxx',\t\"inline_keyboard\": \t  [\"-ExtraButton1,-ExtraButton2\"]}\t\t","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1360,"y":340,"wires":[[]]},{"id":"424f9bae.3ec364","type":"server","z":"","name":"test","legacy":false,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
5 Likes

Cool, share the node red flow :slight_smile:

Added a small Node Red example.