We have been moving to a different house with a KNX-based smarthome installation lately. I have spent quite some time coming up with my own visualisation and automation, mainly using a Python implementation relying on the KNXD (a fork of the well-known EIBD) software for Linux.
When I read about the new Telegram API for Bots, I got excited about the idea of creating a bot for my home automation installation. Using simple commands, I wanted to switch on/off lights, control the temperature, get status messages …
Using the Telegram documentation and my PI-based main KNX controller, it was quite easy to come a with a first prototype, which I can use to switch on and off devices. The screenshot is in German, but you can basically see how I use it to switch on my lights and some outlets. More advanced commands will follow soon. Since I have a smart watch (LG Urbane) which I can use to send Telegram messages via voice input, I can even use it as a voice-to-KNX interface without developing a special (watch) app, just relying on existing technology. (Unfortunately, I am cannot start a new chat with my bot for now, but this is a problem of the watch’s OS.)
I am quite happy with this first version and can’t wait to enhance it. Also, I am considering using this “human to machine interface technology” in enterprise/business apps. What do you think?
Hi!!!
Extremely interesting, but as far as I’m not pretty familiar with telegram bot api, cannot go pretty much ahead.
Can you share more clues on how doing this?
Again, very interesting.
Julio
Hi Julio,
on this page:
https://github.com/python-telegram-bot/python-telegram-bot/wiki/Code-snippets
you will find a simple example, how to connect to Telegram using a bot and how to handle incoming messages. Use this as a starting point, but do not forget to implement safety measures. Next thing you’ll have to do is parse the (input) messages. I use a simple keyword based approach. For my “output” (KNX), I use an existing knxd library.
Please don’t hesitate to ask if you need further input.
Michael