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:
- Go to Settings > Automations & scenes.
- Open an existing automation or script, or select Create automation > Create new automation.
- If you’re setting up a new automation, add a trigger in the When section. Scripts do not need a trigger.
- In the Then do section, select Add action.
- From the search box, search for and select HTML5 Push Notifications: Send message.
- Under Target, select the notification device to send the message to (see Targets).
- Add a title for the message.
- Optional: add a message, icon, action buttons, or other settings.
- Select Save.
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
URL or relative path of an image to display as the main notification icon. Maximum size is 320px by 320px.
URL or relative path of a small image to replace the browser icon on mobile platforms. Maximum size is 96px by 96px.
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.
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.
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).
The direction of the notification’s text. Adopts the browser’s language setting behavior by default.
If enabled, the user is alerted again (sound/vibration) when a notification with the same tag replaces a previous one.
If enabled, the notification does not play sounds or trigger vibration, regardless of the device’s settings.
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.
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.
The timestamp of the notification. By default, uses the time when the notification is sent.
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.
Whether the push service tries to deliver the notification immediately or defers it in accordance with the user’s power-saving preferences.
Action button options
Action buttons are configured in the Actions field. Each item supports:
The identifier of the action. This is sent back to Home Assistant when the user clicks the button.
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:
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
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
URL or relative path of an image to display as the main icon in the notification. Maximum size is 320px by 320px.
URL or relative path of a small image to replace the browser icon on mobile platforms. Maximum size is 96px by 96px.
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.
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.
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).
The direction of the notification’s text. Adopts the browser’s language setting behavior by default.
If enabled, the user is alerted again (sound/vibration) when a notification with the same tag replaces a previous one.
If enabled, the notification does not play sounds or trigger vibration, regardless of the device’s settings.
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.
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.
The timestamp of the notification. By default, uses the time when the notification is sent.
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.
Whether the push service tries to deliver the notification immediately or defers it in accordance with the user’s power-saving preferences.
Action button options in YAML
Action buttons are configured in the actions field. Each item supports:
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.
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)
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
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.
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:
- Dismiss message: Dismiss a message.