Talk to HaBOT with telegram

Hi there,
Would it be hard to connect those 2 so that I can talk to the bot using telegram and, internally, it would communicate to the engine of/behind HABot … which sends a reply that is eventually sent by telegram back to me?

1 Like

That’s a good idea for imperative voice commands, but it can become tricky for things that HABot supports via a visual feedback (ie. a card), like getting a status or showing a chart.

If you have HABot installed and make a HTTP request to /rest/habot/chat with the natural language query in the body, it is the equivalent of what the official client does, and it will eventually perform things, or not, and give you a natural language answer; but will also include a JSON representation of a card that, depending on the circonstances, you would have to interpret in order to present it to you client (in your case, Telegram), which is also made even more difficult by the fact that cards can be modified by the user.

Good, that is already a start. I was expecting that it is not something already working out of the box, but now I think it sounds possible. If we would have some sort of middleware that would render that card“s Json into a picture …:slight_smile:

I have also contemplated this idea and would be thrilled if you come up with something :smiley:
Fact of the matter, I experimented with a lot of things wrt. speech & natural language processing, and eventually the best I could come up with was “try to interpret simple queries but do not try too much, especially if you’re on a limited environment” (…obviously?)

Can you give and example of the HTTP request? Thanks!

EDIT: I found it, and it is like this: Rhasspy to HABot

1 Like