Basics: Push message for Homematic with Telegram App

Support for our english speaking visitors

Moderator: Co-Administratoren

Antworten
tomi_cc16
Beiträge: 711
Registriert: 30.11.2013, 16:35
Wohnort: Mordor

Basics: Push message for Homematic with Telegram App

Beitrag von tomi_cc16 » 04.01.2017, 19:23

There is a good documentation in German how to create a Push message to your Smart Phone:
Original creator: https://www.technikkram.net/2016/03/pus ... -versenden
Or youtube video [German]: https://www.youtube.com/watch?v=hWzvO4_yVJY

Here the english translation how to do it in 5min:

First Create Telegram Bot

To access the Api, an API key is required. This requires the following steps:
1. Install Telegram app on your smartphone
2. Click the magnifier icon in the upper right corner and search for the BotFather contact
3. Start a conversation with BotFather, you should get an overview of all commands directly
4. Use /newbot to create a new bot
5. a name for the bot is asked, simply how you want to name your bot
6. Now you will be asked for a new user name, also create a user name
7. Now the bot responds with the API key or API token (from now referred as <API_KEY>)
8. Now another <CHAT_ID> is required, preferably log on to the computer via https://web.telegram.org and search for the bot. The username of the bot from step 6 is used for this. If you found him, you start a conversation by typing something to the bot !!!(very important)!!!.
9. Now take this link address _https://api.telegram.org/bot<API_KEY>/getUpdates .
Use the same browser window or tab, in which the chat was started with the bot in the previous step.
Please copy the URL manually and replace <API_KEY> with your key from step 7. An "id" can be taken from the answer in the last line. This is our <CHAT_ID>. The result should look something like this:

Bild

10. Now the finished URL can be created. Please replace your <API_KEY> and your <CHAT_ID> in the following URL:
11. _https://api.telegram.org/bot<API_KEY>/sendMessage?chat_id=<CHAT_ID>&text=<Your_message>
12. After calling the page, you should get a message to the mobile phone and the message <Your_message> should have arrived. In the browser, the answer should look like this:

{"ok":true,"result"[...]

Please note that SSL (= https: //) is mandatory. This encrypts the API key and your message during transport.

If there are problems, try again to compare your URL with this example:
_https://api.telegram.org/bot557138945:AAfdjdfuTDkQ9cirHCUQMNF/sendMessage?chat_id=5872168&text=HalloTest


Than Configuration of the CCU2 program

There are many scenarios now that you can create a PUSH messsage for. We will provide a simple example where a PUSH message is sent when a door is opened.

1. Create a new program via Programs and Shortcuts -> Program Creation & Center Shortcuts -> New
2. Add trigger condition
3. Script is selected as activity and then click “Create script” next to it
4. The script is followed by the following: <API_KEY>, <CHAT_ID> and <Your_message>.

string stderr;
string stdout;
string url="\"https://api.telegram.org/bot<API_KEY>/sendMessage?chat_id=<CHAT_ID>&text=<Your_message>\"";
system.Exec("wget --no-check-certificate -q -O - "#url, &stdout, &stderr);


6. The finished program should look something like this:
Bild
7. A click on error check should return "No Error"
8. Two clicks on OK Save the program and it can be tested now, just open the door ;-)

I hope for you it works perfectly. Basically, there are other push services/apps that can be used instead e.g. @Home, Prowl, ...
Pushover App: (use Chrome to translate the page)
https://www.technikkram.net/2017/07/hom ... e-schicken
iOS Homematic App @Home (use Chrome to translate the page)
https://www.technikkram.net/2016/03/hom ... richtigung
iOS pocket control HM (use Chrome to translate the page)
https://penzler.de/phAnleitung/Anleitun ... ungen.html

Homematic Link Collection for Beginners (read it !! it's in German but so important - use Chrome to translate the page)
viewtopic.php?f=19&t=22801
Zuletzt geändert von tomi_cc16 am 20.05.2018, 20:14, insgesamt 5-mal geändert.

NotAnother
Beiträge: 3
Registriert: 16.11.2016, 12:39

Re: Push message for Homematic CCU with Telegram app

Beitrag von NotAnother » 17.01.2017, 22:43

Thank you, that is very useful info! I've thought about something like that for some time now, but you've saved me a lot of researching!

Sergo
Beiträge: 80
Registriert: 01.11.2017, 18:28
Wohnort: Estonia

Re: Push message for Homematic CCU with Telegram app

Beitrag von Sergo » 02.11.2017, 10:03

that is very interesting, thanks a ton!

Antworten

Zurück zu „HomeMatic - english“