If you want to enable Home Assistant Telegram notifications this video is for you.
Table of Contents
Why you need Home Assistant Telegram notifications?
You can use notifications in Home Assistant for many different things.
- Silently logging events.
- To show notifications on the Home Assistant web interface.
- To inform you about state changes in your smart home.
- Or even to display emergency messages that includes pictures from security cameras.
Home Assistant support wide variety of platforms for notifications.
By the end of this How-To you will know how to use Telegram to deliver notifications from Home Assistant to your iOS, Android device or your Desktop PC or MAC
In this article I will also show you how to create an automation that will monitor for state changes of the Presence Sensor and when that happens a Home Assistant Telegram notification will be created.
To complete this tutorial you will need:
- Working Home Assistant!
- A smashed Subscribe to my newsletter button
If you don’t have Home Assistant yet you can read my article and watch my video – here
Of course you can search for “Telegram” in the integration section or you can directly hit the following link – https://www.home-assistant.io/integrations/telegram/
Steps to Follow
Watch the video above or follow these steps to enable your Home Assistant Telegram notifications:
- You have to create a Telegram bot.
- Follow those instructions to create one and get the API_AUTHENTICATION_TOKEN of your newly created bot .
- You need to send a message to your new bot from your Telegram user, because bots are not allowed to contact users.
- You need to configure a Telegram bot in Home Assistant and define there your API key and the allowed chat ids to interact with.
To verify that everything is working before adding your configuration and credentials to Home Assistant, try opening the URL below in a browser and don’t forget to replace AUTHENTICATION_TOKEN and USER_ID with yours:
If you manage to receive a Telegram message and only after you successfully subscribe to my newsletter (just kidding for the latter) you can continue to the Home Assistant configuration.
# Example configuration.yaml entry for the Telegram Bot
- platform: polling
# Example configuration.yaml entry for the notifier
- name: NOTIFIER_NAME
Try it from Home Assistant
Choose the Services tab from the Developer Tools sidebar item, then from the drop-down menu select the “telegram_bot.send_message”. Enter the following JSON message into the Service Data field:
“title”: “Subscribe to Kiril’s YouTube channel”,
“message”: “And don’t forget to hit the Like button”
and press the CALL SERVICE button.
For instance to automatically create notifications when a Presence sensor is updated you can use Home Assistant automation.
This is my configuration example below that I also used in my video. You have to put these lines in your Automation.yaml file of your Home Assistant installation.
# Example automation.yaml entry for Telegram
- id: '1571544830794444'
alias: I'm home telegram
- entity_id: person.kiril
title: Subscribe to Kiril's channel
- url: https://media.alienwarearena.com/media/tux-r.jpg
To activate and test the automation you have to change the state of presence sensor “person.kiril” from “away” to “home”. You can do that manually through the developer menu in Home Assistant for example.
Support my blog
Above all – any sort of engagement on my YouTube channel does really help out a lot with the YouTube algorithm, so make sure you hit the Subscribe, Like and Bell buttons If you enjoy this post & video.
Also feel free to add me on Instagram, Snapchat and Twitter by searching for KPeyanski username. I post there (Twitter) pretty much daily.
I really hope that you manage to follow the steps in this video till the end and you have working Telegram notifications in your Home Assistant at the moment.
Don’t forget to subscribe to my newsletter here – https://peyanski.com/newsletter/
Stay safe and see you next time.