Telegram: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
Brian Wilson (talk | contribs)
 
(4 intermediate revisions by the same user not shown)
Line 3: Line 3:
Messaging system similar to WhatsApp (but not owned by Facebook!)
Messaging system similar to WhatsApp (but not owned by Facebook!)


Advantages:
So far Telegram fills the gap where I want to receive periodic notifications from machines (like Home Assistant for example)
and don't want to write a complete Android app to support it.
 
I suppose I could just use email but that's not nearly so fun. Set up is about the same effort.
 
=== Advantages ===


* Free, and no ads
* Free, and no ads
Line 19: Line 24:
on all these messaging apps.
on all these messaging apps.


Disadvantages:
=== Disadvantages ===


* It's free and has no monetized base at this time and it could disappear tomorrow. The company is owned by a billionaire who could lose interest and decide to build electric cars or drones or something instead.
* It's free and has no monetized base at this time and it could disappear tomorrow. The company is owned by a billionaire who could lose interest and decide to build electric cars or drones or something instead. Spaceships are particularly popular right now.
* You have to install an app, and possibly convince your friends to install it too.
* You have to install an app, and possibly convince your friends to install it too.


Line 33: Line 38:
I currently only want to send messages anyway so it's probably okay.
I currently only want to send messages anyway so it's probably okay.


# Set up an account. Install the app on a phone. Ignore its requests to access contacts and files, you don't need that right now.
# Set up an account. Do this by installing the app on a phone. Ignore its requests to access contacts and files, you don't need that right now.
# Contact the botfather and set up a bot account. Get a token.
# Make things easy, jump over to your computer and browse to https://web.telegram.org/z/ and link your account there.
# Get your personal id.
# In the browser UI, search for "botfather" and send him a message containing /newbot and set up your new bot account. You need a unique name for the bot like "server" and a unique username like "server_bot". Treat the token he returns with great care. Use cut and paste, you can do that easily since you are in a browser not the app!
# Put the token and id on your server.
# Get your personal id. Save that somewhere too.
# Send a message to the name you set up "@server_bot" (search for it). This lets Telegram know it's okay for server_bot to send messages to you.
# Set up a tiny script to test things on your server and put the token and the id for your personal account in there.
# Send a message from your phone to the server, to establish a link. This lets Telegram know that you are okay receiving messages from your server.
# Send a message from your phone to the server, to establish a link. This lets Telegram know that you are okay receiving messages from your server.
For some code, go to my git repo-- https://github.com/brian32768/telegram.git


== Links ==
== Links ==
Line 43: Line 52:
I got the idea to use it from this [https://randomnerdtutorials.com/esp32-door-status-telegram/ Random Nerd tutorial].
I got the idea to use it from this [https://randomnerdtutorials.com/esp32-door-status-telegram/ Random Nerd tutorial].


https://telegram.org
Telegram home page https://telegram.org or the shorter version https://t.me how cool is that, man, I wish I were a billionaire so I could afford a domain name that's a single letter.
 
https://t.me


[[Category: Messaging]]
[[Category: Messaging]]

Latest revision as of 01:20, 28 October 2021

Overview

Messaging system similar to WhatsApp (but not owned by Facebook!)

So far Telegram fills the gap where I want to receive periodic notifications from machines (like Home Assistant for example) and don't want to write a complete Android app to support it.

I suppose I could just use email but that's not nearly so fun. Set up is about the same effort.

Advantages

  • Free, and no ads
  • Android App
  • IOS App
  • Browser app
  • Can run behind a firewall, via polling
  • Integration built in to Home Assistant
  • I was able to set it up in Home Assistant in about 20 minutes start to finish.
  • It's open source so you might be able to run your own server and have some degree of privacy and autonomy, but maybe that's not true. I have not looked.

I still had to give it my phone number to get started, but that's sort of how it works. I did not have to let it read files or access my contacts. You only need to do that if you want to use it as a full messaging system with your friends, and I have no friends. Well, none that are messaging geeks anyway. My former friends are already tired of hearing me tell them to install another messaging or VOIP app. In fact they are just tired of hearing from me on all these messaging apps.

Disadvantages

  • It's free and has no monetized base at this time and it could disappear tomorrow. The company is owned by a billionaire who could lose interest and decide to build electric cars or drones or something instead. Spaceships are particularly popular right now.
  • You have to install an app, and possibly convince your friends to install it too.

Notification system

I am going to describe the basics of using it to send notifications from a Linux server to my phone. Please see the "links" section for more information, these are just my notes and not intended to be a complete tutorial on Telegram.

On Home Assistant, I set it up to use polling because I did not feel like setting up yet another proxy. I really am not supposed to expose services to the Internet though so far Spectrum seems less inclined to care than Comcast was.

At work, I used polling too because it was so easy to use in Home Assistant. I currently only want to send messages anyway so it's probably okay.

  1. Set up an account. Do this by installing the app on a phone. Ignore its requests to access contacts and files, you don't need that right now.
  2. Make things easy, jump over to your computer and browse to https://web.telegram.org/z/ and link your account there.
  3. In the browser UI, search for "botfather" and send him a message containing /newbot and set up your new bot account. You need a unique name for the bot like "server" and a unique username like "server_bot". Treat the token he returns with great care. Use cut and paste, you can do that easily since you are in a browser not the app!
  4. Get your personal id. Save that somewhere too.
  5. Send a message to the name you set up "@server_bot" (search for it). This lets Telegram know it's okay for server_bot to send messages to you.
  6. Set up a tiny script to test things on your server and put the token and the id for your personal account in there.
  7. Send a message from your phone to the server, to establish a link. This lets Telegram know that you are okay receiving messages from your server.

For some code, go to my git repo-- https://github.com/brian32768/telegram.git

Links

I got the idea to use it from this Random Nerd tutorial.

Telegram home page https://telegram.org or the shorter version https://t.me how cool is that, man, I wish I were a billionaire so I could afford a domain name that's a single letter.