If you want to enable Gmail notifications in your Home Assistant this video is for you.

Home Assistant – Gmail Notifications (How-To)

You can use notifications in Home Assistant for many different things.

For Example:

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

Gmail sample notifications automatically received from Home Assistant

To complete this tutorial you will need:

  1. Working Home Assistant!
  2. To Subscribe to my mail list 🙂

If you don’t have Home Assistant yet you can read my article and watch my video – here

Of course you can search for “SMTP” in the integration section in home-assistant.io or you can directly hit the following link –   https://www.home-assistant.io/integrations/smtp/

Setup

Watch the video above or follow these steps:

  1. Go to your Google Account.
  2. On the left navigation panel, choose Security.
  3. 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.
  4. At the bottom, choose Select app and choose the app you’re using. For example: Mail
  5. Choose Select device and choose the device you’re using. For example: Mac
  6. Choose Generate.
  7. Follow the instructions to enter the App Password. The App Password is the 16-character code in the yellow bar on your device.
  8. Copy the App Password and store it somewhere safe. We will need it for the configuration.yaml file in Home Assistant
  9. Choose Done.
  10. 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: john@gmail.com
    encryption: starttls
    username: john@gmail.com
    password: APP_Password_From_Point_7_Above
    recipient:
    - james@gmail.com
    - bob@gmail.com
    sender_name: My Home Assistant
  11. You can add the following automation in the automation.yaml file of Home Assistant if you want to test the Gmail Notifications. Of course you can customize it to suit your needs:
    # Example automation.yaml entry
    - id: '123'
    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
  12. Restart your Home-Assistant to activate your new configurations.
  13. 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”
  14. 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.


3 Comments

Mark · 22/04/2020 at 3:02 am

I am wondering if it is possible to configure some notifications for different recipients. There are some notifications that I only want to get, but there are others that I would like other family members to get. For example: If there is a leak somewhere I would want everyone in the house to get the notification, but if it is a minor issue like HASS has restarted I am the only one that really needs the notification. Thanks for your time and your great work!

    Kiril Peyanski · 22/04/2020 at 9:42 am

    Sure you can do that Mark. You just have to create several automations in Home Assistant. Join my Discord server if you have difficulties doing this we will try to help you there.

      Mark · 23/04/2020 at 7:33 am

      Oh, thanks for your quick response! I will join your discord server I’m sure it will be helpful since I am pretty much a newbie! I will try not to ask the question previously asked! Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *