If you want to enable Home Assistant Gmail notifications this video article is for you.
You can use notifications in Home Assistant for many different things.
- Silently logging events.
- Show notifications on the Home Assistant web interface.
- To send Telegram Notifications
- 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 able to receive Gmail notifications from Home Assistant when there is some state change in your Smart Home.
The described method can be used for any SMTP (Simple Mail Transfer Protocol) enabled mail provider out there with some minor modifications of the server hostname and eventually the port.
In this article/video 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 Gmail notification will be created
To complete this tutorial you will need:
- Working Home Assistant!
- To Subscribe to my mail list 🙂
If you don’t have Home Assistant yet you can read my article and watch my video – here
Home Assistant Gmail notifications
To enable the Home Assistant Gmail notifications – watch the video above or follow these steps:
- Go to your Google Account.
- On the left navigation panel, choose Security.
- On the “Signing in to Google” panel, choose App Passwords. If you don’t see this option:
- 2-Step Verification is not set up for your account.
- 2-Step Verification is set up for security keys only.
- Your account is through work, school, or other organization.
- You’ve turned on Advanced Protection for your account.
- At the bottom, choose Select app and choose the app you’re using. For example: Mail
- Choose Select device and choose the device you’re using. For example: Mac
- Choose Generate.
- Follow the instructions to enter the App Password. The App Password is the 16-character code in the yellow bar on your device.
- Copy the App Password and store it somewhere safe. We will need it for the configuration.yaml file in Home Assistant
- Choose Done.
- Add the following sample configuration in your Configuration.yaml file and customize it for your needs:
# Example configuration.yaml entry notify: - name: gmail platform: smtp server: smtp.gmail.com port: 587 timeout: 15 sender: email@example.com encryption: starttls username: firstname.lastname@example.org password: APP_Password_From_Point_7_Above recipient: - email@example.com - firstname.lastname@example.org sender_name: My Home Assistant
You can add the following automation in the automation.yaml file of if you want to test the Home Assistant Gmail Notifications. Of course you can customize it to suit your needs:
# Example automation.yaml entry - id: '123434561' alias: I'm home gmail description: '' trigger: - entity_id: person.kiril from: away platform: state to: home condition:  action: - data: message: find it on peyanski.com/newsletter title: Subscribe to my newsletter service: notify.gmail
- Restart your Home-Assistant to activate your new configurations.
- To test your configuration – go to States tab on Developer Tools. Then simulate the needed state changes of the sensor to trigger the automation. Just as I’m showing in the video you have to change the state of presence sensor “person.kiril” from “away” to “home”
- Check your Gmail account for new notification
Of course you can use the newly configured service notify.gmail in your Home Assistant for everything you want and not only for presence detection notifications.
Support my blog
Above all – any sort of engagement on my YouTube channel or/and my website – peyanski.com, does really help out a lot with the YouTube and Google 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 Twitter by searching for KPeyanski username. I post there pretty much daily.
I really hope that you manage to follow the steps in this video till the end and you have working Gmail 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.