Examples Sending Notification Depending of the Presence


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 component.

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'