home-assistant.io/source/_cookbook/automation_telegram_presence_alert.markdown
Franck Nijhof 1833c32a2c Cleans up front matter (#9835)
* Sets front matter defaults

* Removes default front matter from section templates/pages

* Removes default front matter from addon pages

* Removes default front matter from integration pages

* Removes default front matter from posts

* Removes default front matter from docs pages

* Removes default front matter from other pages

* Fixes blog category pages
2019-07-11 14:35:08 -07:00

984 B

title, description, ha_category
title description ha_category
Examples sending notification depending of the presence Examples sending notification depending of the presence Automation Examples

This will send a message when someone in your known devices list connects to your local network. In other words, when someone arrives home. It will only work if you are using the Nmap device tracker or a similar integration.

This example uses Telegram to send the notification.

notify:
  - name: Telegram
    platform: telegram
    api_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    chat_id: xxxxxxxxx

Add the automation rule. Change device_name_here to match the device you want to track.

automation:
  trigger:
    platform: state
    entity_id: device_tracker.device_name_here
    from: 'not_home'
    to: 'home'
  action:
    service: notify.Telegram
    data:
      message: 'Person is now home'