Send message

The Send message action sends a notification to a browser or installed web app (PWA) registered with HTML5 Push Notifications.

Using this action from the user interface

If you prefer building automations and scripts visually, Home Assistant walks you through this action step by step. You pick what to target, tweak a few options, and save. No YAML knowledge required.

To send a notification from an automation or a script:

  1. Go to Settings > Automations & scenes.
  2. Open an existing automation or script, or select Create automation > Create new automation.
  3. If you’re setting up a new automation, add a trigger in the When section. Scripts do not need a trigger.
  4. In the Then do section, select Add action.
  5. From the search box, search for and select HTML5 Push Notifications: Send message.
  6. Under Target, select the notification device to send the message to (see Targets).
  7. Add a title for the message.
  8. Optional: add a message, icon, action buttons, or other settings.
  9. Select Save.

Note

Keep in mind that support for the features described below can vary depending on the browser and platform you are using. Refer to the MDN Notifications API documentation for a detailed overview of compatibility across environments.

Options in the UI

Title (Required)

Title for your notification.

Message (Optional)

The message body of the notification.

Icon (Optional)

URL or relative path of an image to display as the main notification icon. Maximum size is 320px by 320px.

Badge (Optional)

URL or relative path of a small image to replace the browser icon on mobile platforms. Maximum size is 96px by 96px.

Image (Optional)

URL or relative path of a larger image to display in the main body of the notification. Experimental support; may not be displayed on all platforms.

Tag (Optional)

The identifier of the notification. Sending a new notification with the same tag replaces the existing one. If not specified, a unique tag is generated for each notification.

Actions (Optional)

Adds action buttons to the notification. When the user clicks a button, an event is sent back to Home Assistant. The number of actions supported may vary between platforms. (See action button options).

Text direction (Optional)

The direction of the notification’s text. Adopts the browser’s language setting behavior by default.

Renotify (Optional)

If enabled, the user is alerted again (sound/vibration) when a notification with the same tag replaces a previous one.

Silent (Optional)

If enabled, the notification does not play sounds or trigger vibration, regardless of the device’s settings.

Require interaction (Optional)

If enabled, the notification remains active until the user clicks or dismisses it, rather than automatically closing after a few seconds. This provides the same behavior on desktop as on mobile platforms.

Vibration pattern (Optional)

A vibration pattern to run with the notification. An array of integers representing alternating periods of vibration and silence in milliseconds. For example, [200, 100, 200] vibrates for 200ms, pauses for 100ms, then vibrates for another 200ms.

Language (Optional)

The language of the notification’s content.

Timestamp (Optional)

The timestamp of the notification. By default, uses the time when the notification is sent.

Time to live (Optional)

Specifies how long the push service retains the message if the user’s browser or device is offline. After this period, the notification expires. A value of 0 means the notification is discarded immediately if the target is not connected. Defaults to 1 day.

Urgency (Optional)

Whether the push service tries to deliver the notification immediately or defers it in accordance with the user’s power-saving preferences.

Extra data (Optional)

Additional custom key-value pairs to include in the payload of the push message. This can be used to include extra information that can be accessed in the notification click event.

Action button options

Action buttons are configured in the Actions field. Each item supports:

Action identifier (Required)

The identifier of the action. This is sent back to Home Assistant when the user clicks the button.

Title (Required)

The label of the button displayed to the user.

Icon (Optional)

URL or relative path of an image displayed as the icon for this button. Maximum size is 128px by 128px.

Using this action in YAML

If you work directly in YAML, or you want to know exactly what Home Assistant does under the hood, this section has the technical reference. It lists the field names you use in YAML, their types, and which ones are required.

In YAML, refer to this action as html5.send_message. A basic example looks like this:

ActionActions are used in several places in Home Assistant. As part of a script or automation, actions define what is going to happen once a trigger is activated. In scripts, an action is called *sequence*. [Learn more]
action: html5.send_message
data:
  title: "Reminder"
  message: "Have you considered frogs?"
  icon: /static/icons/favicon-192x192.png
  badge: /static/images/notification-badge.png
  tag: message-group-1
  actions:
    - action: test-action
      title: 🆗 Click here!
  require_interaction: true
  vibrate:
    - 125
    - 75
    - 125
    - 275
    - 200
    - 275
    - 125
    - 75
    - 125
    - 275
    - 200
    - 600
    - 200
    - 600
target:
  entity_id: notify.my_desktop

Note

When using a relative path for an image or icon URL, the path is resolved relative to the base URL of your Home Assistant instance.

Options in YAML

title string Required

Title for your notification message.

message string

The message body of the notification.

icon string

URL or relative path of an image to display as the main icon in the notification. Maximum size is 320px by 320px.

badge string

URL or relative path of a small image to replace the browser icon on mobile platforms. Maximum size is 96px by 96px.

image string

URL or relative path of a larger image to display in the main body of the notification. Experimental support; may not be displayed on all platforms.

tag string

The identifier of the notification. Sending a new notification with the same tag replaces the existing one. If not specified, a unique tag is generated for each notification.

actions list

Adds action buttons to the notification. When the user clicks a button, an event is sent back to Home Assistant. The number of actions supported may vary between platforms. (See action button options).

dir string

The direction of the notification’s text. Adopts the browser’s language setting behavior by default.

renotify boolean

If enabled, the user is alerted again (sound/vibration) when a notification with the same tag replaces a previous one.

silent boolean

If enabled, the notification does not play sounds or trigger vibration, regardless of the device’s settings.

require_interaction boolean

If enabled, the notification remains active until the user clicks or dismisses it, rather than automatically closing after a few seconds. This provides the same behavior on desktop as on mobile platforms.

vibrate list

A vibration pattern to run with the notification. An array of integers representing alternating periods of vibration and silence in milliseconds. For example, [200, 100, 200] vibrates for 200ms, pauses for 100ms, then vibrates for another 200ms.

lang string

The language of the notification’s content.

timestamp string

The timestamp of the notification. By default, uses the time when the notification is sent.

ttl map

Specifies how long the push service retains the message if the user’s browser or device is offline. After this period, the notification expires. A value of 0 means the notification is discarded immediately if the target is not connected. Defaults to 1 day.

urgency string

Whether the push service tries to deliver the notification immediately or defers it in accordance with the user’s power-saving preferences.

data map

Additional custom key-value pairs to include in the payload of the push message. This can be used to include extra information that can be accessed in the notification click event.

Action button options in YAML

Action buttons are configured in the actions field. Each item supports:

action string Required

The identifier of the action. This is sent back to Home Assistant when the user clicks the button.

title string Required

The label shown on the button.

icon string

Optional URL or relative path to an image for the button. Maximum size is 128px by 128px.

Targets of the action

This action requires a target. The target is the object of the action. You can point the action at a single entityAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more], a device, an area, a floor, or a label, and Home Assistant will run the action on every matching notify entity behind that target.

  • Entity: one specific notify entity, such as notify.living_room.
  • Device: every notify entity that belongs to a device.
  • Area: every notify entity in a room or area.
  • Floor: every notify entity on a floor.
  • Label: every notify entity that shares a label.

You can also select different target types in one action. For example, you can add a specific entity and an area as targets in the same action to run the action on both of them at once.

Try it yourself

Ready to test this? Open Developer tools > Actions, search for this action, fill in the fields, and select Perform action. You see what happens on your actual entitiesAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more] without writing a line of YAML.

More examples

Real scenarios where this action shows up in automations and scripts. Copy any example and adapt it to your setup.

Tip

You don’t need to edit YAML to use these examples. Copy a YAML snippet from this page, open the automation editor in Home Assistant, and press Ctrl+V (or Cmd+V on Mac). Home Assistant automatically converts the pasted YAML into the visual editor format, whether it’s a full automation, a single trigger, a condition, or an action.

Action: send a doorbell-rang notification with an open-door action button

If the doorbell rings, receive an actionable notification with a camera snapshot. Opens the door when you tap the “Open door” action button.

  • Trigger: Doorbell rang (event.doorbell)
  • Action: Send message
  • Target: My desktop (notify.my_desktop)
AutomationAutomations in Home Assistant allow you to automatically respond to things that happen in and around your home. [Learn more]
alias: "Send doorbell-rang notification to my desktop"
triggers:
  - trigger: doorbell.rang
    target:
      entity_id: event.doorbell
actions:
  - action: html5.send_message
    target:
      entity_id: notify.my_desktop
    data:
      title: 🔔 The doorbell rang.
      message: Someone is at the entrance door.
      icon: https://homeassistant.example.com/www/entrancecamera_snapshot.jpg
      actions:
        - action: open-door
          title: Open door
      require_interaction: true
      ttl:
        minutes: 5
      urgency: high
  • Trigger: Event
  • Condition: Template
  • Action: Open lock
  • Target: Entrance door
AutomationAutomations in Home Assistant allow you to automatically respond to things that happen in and around your home. [Learn more]
alias: "Open entrance door when open-door action button is tapped"
triggers:
  - trigger: event.received
    target:
      entity_id: event.pc
    options:
      event_type:
        - clicked
conditions:
  - condition: template
    value_template: "{{ trigger.to_state.attributes.action == 'open-door'}}"
actions:
  - action: lock.open
    target:
      entity_id: lock.entrance_door

Still stuck?

The Home Assistant community is quick to help: join Discord for real-time chat, post on the community forum with the action you’re calling and what you expected to happen, or share on our subreddit /r/homeassistant.

Tip

AI assistants like ChatGPT or Claude can also explain actions or suggest the right one when you describe what you want in plain language.

Related actions

These actions work well alongside this one: