NotifyHookDocs
Recipes

Home Assistant

Trigger Home Assistant automations from phone notifications, such as a doorbell ring, a delivery or a bank alert.

1. Create the automation#

In Home Assistant, go to Settings → Automations & scenes → Create automation, open the YAML editor and paste:

Single automation in the UI YAML editor
alias: Phone notification → HA
triggers:
  - trigger: webhook
    webhook_id: notifyhook-8f3b2c1e9a   # make this long and random
    allowed_methods: [POST]
    local_only: false
actions:
  - action: persistent_notification.create
    data:
      title: "{{ trigger.json.app }}: {{ trigger.json.title }}"
      message: "{{ trigger.json.text }}"
mode: queued

The fields from your NotifyHook template are available as trigger.json.<key>. Replace the sample webhook ID with your own random value. This is a single automation object for the UI editor; if maintaining automations.yaml directly, add it as a list item with the matching indentation.

Two kinds of curly braces

The {{ trigger.json.title }} above is Home Assistant's Jinja templating. It runs inside HA and is unrelated to NotifyHook's {{title}} placeholders, which are filled on your phone.

2. Get an HTTPS URL#

NotifyHook only sends to https:// URLs, so http://homeassistant.local:8123 won't work. Choose one:

  • Home Assistant Cloud (Nabu Casa): save the automation with local_only: false, then open Settings → Home Assistant Cloud → Webhooks. Enable this automation's webhook and copy its public address (https://hooks.nabu.casa/…).
  • Your own HTTPS: a reverse proxy with TLS (Caddy, nginx, Cloudflare Tunnel) in front of HA. The URL is https://ha.example.com/api/webhook/notifyhook-8f3b2c1e9a.
The webhook ID is the password

Anyone who knows a Home Assistant webhook URL can trigger it, and HA webhooks don't check signatures. Use a long random ID and don't share rule exports that contain it.

Keep local_only: true instead if you only need LAN access through your own HTTPS endpoint. Don't use unauthenticated webhooks for locks, doors or other safety-sensitive actions. See Home Assistant's webhook reference.

3. Create the NotifyHook rule#

  • Webhook URL: the URL from step 2.
  • Source apps: for example your doorbell, courier or banking app.
  • Filters: optional, for example Title contains doorbell.

The default template works as-is. A smaller one is enough for most automations:

JSON template
{
  "app": "{{appName}}",
  "title": "{{title}}",
  "text": "{{text}}"
}

Use ⋮ → Test webhook in the rule editor. A persistent notification should appear in Home Assistant. Home Assistant answers webhooks with 200, even if no automation uses that ID, so check the automation's trace if nothing happens.

Ideas#

  • Doorbell: flash the hallway lights when your doorbell app notifies.
  • Deliveries: forward "out for delivery" notifications and announce them on a speaker.
  • Phone battery context (Pro): include {{battery.level}} alongside a notification and use it in a webhook-triggered template sensor. Battery changes alone don't trigger NotifyHook.
Conditional action example
actions:
  - if:
      - condition: template
        value_template: "{{ 'doorbell' in trigger.json.title | lower }}"
    then:
      - action: light.turn_on
        target: { entity_id: light.hallway }
        data: { flash: short }