[APP][Pro] Telegram

Effortlessly control your smart home with Telegram

Introducing the Telegram bot for Homey Pro - the ultimate smart home hub companion. With this bot, you can control your smart home devices right from your Telegram chat. The bot supports sending and receiving messages, making it easy to stay connected with your home.

One of the most exciting features of this bot is the question system. With this system, you can use Telegram inline buttons to trigger actions on your smart home hub, such as turning on the lights or adjusting the thermostat. This makes it incredibly easy to control your home from anywhere in the world.

In addition, the Telegram bot for Homey Pro supports multiple users and chats, as well as groups, making it perfect for families or roommates who want to control their smart home together. With this bot, your smart home has never been more accessible or convenient. Install now and experience the convenience of controlling your smart home from Telegram.

How to setup

  1. Install the app on your smart home hub.
  2. Create a Telegram bot by searching for “@Botfather” in the Telegram search bar and selecting the “@Botfather” bot.
  3. Start the “@Botfather” bot by clicking the “Start” button or by sending the /newbot command to create a new bot.
  4. Enter the token provided by Botfather in the app settings.
  5. Look for the option to set a password and configure a secure password of your choice.
  6. Start the bot by sending the /start command in Telegram, and follow the instructions. Each user must also send the bot the /start command. You can share the bot with others by searching for it in Telegram or by sharing the profile link.
  7. Enjoy controlling your smart home from Telegram!

Support over Telegram

Also, for people who don’t like support on this forum, there is a community telegram group!
Feel free to join there and ask for support. Join us here, we’re exited to see you there!

image

Links

Feedback / Bugs

Any requests please post them in the Telegram topic on the Athom Community forum
Please report issues at the issues section on Github otherwise in this topic.

We’re working on supporting all languages that are supported by Homey Pro (except RU).
If you speak one of these languages, please offer feedback on the ChatGTP-generated translations!

Language Link Help needed?
:uk: English Here :ballot_box_with_check: Done by @Twan_Veugelers and me
:de: German Here :ballot_box_with_check: Done by me
:netherlands: Dutch Here :ballot_box_with_check: Done by @Twan_Veugelers and @LRvdLinden
:it: Italian Here :ballot_box_with_check: Done by @ilpaolino and @pippo73
:poland: Polish Here :sos: Yes
:es: Spanish Here :sos: Yes
:denmark: Danish Here :construction: In Progress
:sweden: Swedish Here :sos: Yes
:norway: Norwegian Here :sos: Yes
:fr: French Here :sos: Yes
:ru: Russian Here :ballot_box_with_check: Done by @oleg

You can also find the translations :arrow_right: here :arrow_left:
For reference, the :uk::/:us: translation can be found :arrow_right: here :arrow_left:

Markdown (HTML & MarkdownV2)

Type HTML MarkdownV2
Bold <b>bold</b>
<strong>bold</strong>
*bold*
Italic <i>italic</i>
<em>italic</em>
_italic_
Underline <u>underline</u>
<ins>underline</ins>
__underline__ (2x _)
Strike <s>strike</s>
<strike>strikethrough</strike>
<del>strikethrough</del>
~strike~
Code <code>code</code> `code`
Spoiler <span class="tg-spoiler">spoiler</span>
<tg-spoiler>spoiler</tg-spoiler>
||spoiler||
URL <a href="http://www.example.com/">inline URL</a> [inline URL](http://www.example.com/)
User <a href="tg://user?id=123456789">inline mention of a user</a> [inline mention of a user](tg://user?id=123456789)
Emoji <tg-emoji emoji-id="5368324170671202286">👍</tg-emoji> ![👍](tg://emoji?id=5368324170671202286)
Pre <pre language="c++">code</pre> ```c++
code
```

Would you like to buy me a coffee :coffee: or a beer? :beer:

Feel free to donate to me for my work :slight_smile: It’s highly appreciated!

Check out my other apps

4 Likes

Frequently Asked Questions (FAQs) - Homey Pro Telegram Bot App

Q1: I’m encountering a “Bad Request: can’t parse entities” error with the message, “Character ‘(’ is reserved and must be escaped with the preceding ‘\’”. What should I do?

Answer

A: This error indicates an issue with parsing entities, specifically with characters like ‘(’. To resolve this, make sure you escape non-Markdown characters properly. If your variables or tokens, especially those from Homey Flows, contain special characters, switch to HTML or use the Better Logic Library (BLL) to escape them.

Q2: How can I escape non-Markdown characters in my variables?

Answer

A: If your variables contain special characters like . , * / & % $, and Telegram can’t differentiate them from Markdown special characters, you need to escape them. There are two recommended ways to address this issue:

  • Option 1: Use HTML Markdown: Convert your message to HTML format, where special characters won’t conflict with Markdown. Telegram supports HTML formatting.
  • Option 2: Utilize Better Logic Library (BLL): Implement a custom function for escaping special characters using BLL. Here’s an example function you can use:
function escapeRegex(string) {
   return string.replace(/[/\-\\^$*+?.()|[\]{}]/g, '\\$&');
}

Then, use it in your message like this: {[escapeRegex(variable)]}.

By following either of these options, you can ensure proper handling of special characters in your variables, resolving the parsing issue.

Q3: Why am I getting an error related to special characters in my variables, and how does the Better Logic Library (BLL) help?

Answer

A: The error occurs because Telegram can’t distinguish between Markdown special characters and non-Markdown characters in your variables. Since you are using special characters like . , * / & % $, you need to escape them. BLL provides a solution by offering a custom function, such as the provided escapeRegex function, to escape these characters. By incorporating this function into your flow, you ensure proper handling of variables with special characters, eliminating parsing errors.

Q4: How does markdown work (HTML vs. MarkdownV2)?

Answer

A: For detailed information on how markdown works, particularly the differences between HTML and MarkdownV2 in the context of the Homey Pro Telegram Bot App, please refer to the community discussion thread here.

Q5: How do I set up the Homey Pro Telegram Bot App?

Answer

A: Follow these steps to set up the Homey Pro Telegram Bot App:

  1. Install the app on your smart home hub.
  2. Create a Telegram bot by searching for “@Botfather” in the Telegram search bar and selecting the “@Botfather” bot.
  3. Start the “@Botfather” bot by clicking the “Start” button or by sending the /newbot command to create a new bot.
  4. Enter the token provided by Botfather in the app settings.
  5. Look for the option to set a password and configure a secure password of your choice.
  6. Start the bot by sending the /start command in Telegram, and follow the instructions. Each user must also send the bot the /start command. You can share the bot with others by searching for it in Telegram or by sharing the profile link.
  7. Enjoy controlling your smart home from Telegram!

Q6: How can I support the development of the Homey Pro Telegram Bot App?

Answer

A: There are two ways you can support the app:

  1. Contribute via GitHub: If you have coding skills or want to contribute in other ways, you can visit the GitHub repository at GitHub - spkesDE/com.spkes.telegramNotifications. Feel free to contribute by submitting bug reports, feature requests, or even code improvements.
  2. Make a Donation: If you prefer to support the developer financially, you can send a donation. Visit the community thread here to find information on how to make a donation. Your contributions help in the continuous improvement and maintenance of the Homey Pro Telegram Bot App.

Your support, whether through contributions on GitHub or donations, is highly appreciated and contributes to the ongoing development of the app.

Q7: How can I enable Markdown?

Answer

A: In the app settings is a option to enable MarkdownV2 or HTML Markdown.

1 Like

Hello, what’s the difference/advantage compared tovthe app Telegram Bot?

1 Like

Mostly a more modern app (SDKv3, Telegram API v4). So the more possibility’s. The Telegram bot from Jorden was updated last updated 3 years ago and wasn’t working for me.

1 Like

Ok fair. Is it possible to send messages to telegram groups with your app?

Yes in the upcoming version, private chats, groups and supergroups are supported with version 1.0.3 :slight_smile:

1 Like

Nice, were you also aware of the CallMeBot app?

Yes of course, but I wanted a system where I don’t have to use a 3rd party service to send a message.
Also CallMeBot doesn’t support message receiving :slight_smile:

2 Likes

I was able to follow the instructions from the first post just fine.
Now I want to add users in the app settings in Homey, but I can’t.
What am I missing?

It says: Empty :frowning:

Sure you have additional user accounts present @ your Homey?

Yes, both me, my wife and a guest have been created.

They have also to contact the bot, since it has to know the user id :slight_smile:

Edit: I will edit the instructions to make it more clear. Each User has to write the bot the /start command and register. To find the bot you can enter the bot name into the search of Telegram or share the bot via profile

Yeah, found it out now. I was still working in the botfather.

Somehow the part about starting the bot from the link in the message created by the botfather was not clear to me.

Ah, so it has nothing to do with Homey users (user accounts), but with Telegram users :grimacing:.

And FYI the Test version receiving msgs works fine

Glad to hear, if u have any questions or feedback, let me know!

Thank you for testing :slight_smile: I hope I get the approval from Athom soon for the test version.

1 Like

Would it be possible to ‘answer’ a question from a flow with yes or no and decide the continuation of the flow based on that answer, with the receiving message functionality coming in 1.0.3?

It would be possible when splitting the flow in 2 flows.
The first flow sends the question, the second flow triggers the flow by ‘message received’ , dependent on the answer (and user).

You mean like you send a question (e.g. Would you like to close the blinds?) to a chat and answer it with Yes or No?
With the with the version 1.0.3, technically yes. But you would have to store the last asked question in a variable. And check with “A message received” the answer.

I could implement that functionality inside the app. Once I have so free time for that and I have a test version I’ll let you know.

You always beat me with 1m :smiley:
And you could that in one flow with adv. flow :slight_smile:

Sorry 'bout that hehe.

Updated the test version to 1.0.5.
Just little minor changes. Most visible is a german translation and updated setup instructions.

Update ist out for everyone.