A Home Assistant custom component that creates custom notification services which fire events instead of sending actual notifications. Perfect for advanced automations where you want to intercept and handle notification calls programmatically.
- Dual API Support: Works with both legacy
notify.<action_id>service calls and modernnotify.send_messageentity calls - Event-Driven: Fires
notify_actions.messageevents with all notification data - Optional Action Sequences: Execute Home Assistant actions after firing the event
- Template Support: Use templates in action sequences with full access to notification data
- Default Data: Define default data that gets merged with notification calls
- UI Configuration: Complete UI-based setup via Config Flow and Options Flow
- Multi-Language: Includes English and German translations
- Open HACS in Home Assistant
- Go to "Integrations"
- Click the three dots in the top right corner
- Select "Custom repositories"
- Add
https://github.com/akentner/notify_actionsas an integration - Click "Install"
- Restart Home Assistant
- Download the latest release from GitHub
- Extract the
custom_components/notify_actionsdirectory to your Home Assistantcustom_componentsdirectory - Restart Home Assistant
- Go to Settings → Devices & Services
- Click + Add Integration
- Search for "Notify Actions"
- Enter:
- Action ID: Unique identifier (e.g.,
my_notification) - Friendly Name: Display name in the UI
- Action Sequence (optional): Actions to execute after the event
- Default Data (optional): Default data object for templates
- Action ID: Unique identifier (e.g.,
After creating a notification action, you can configure optional action sequences via the Configure button:
- Use the visual ActionSelector (same as in automations)
- Add service calls, delays, conditions, etc.
- Use templates with these variables:
message- Notification messagetitle- Notification titletarget- Notification targetdata- Data object (merged with default_data)action_id- The action IDfriendly_name- The friendly name
Legacy API (supports all parameters):
service: notify.my_notification
data:
message: "Hello World"
title: "Test"
data:
custom_field: "value"Modern Entity API (message + title only):
service: notify.send_message
target:
entity_id: notify.notify_actions_my_notification
data:
message: "Hello World"
title: "Test"Create an automation that listens to the notify_actions.message event:
trigger:
- platform: event
event_type: notify_actions.message
event_data:
action_id: my_notification
action:
- service: persistent_notification.create
data:
title: "{{ trigger.event.data.title }}"
message: "{{ trigger.event.data.message }}"Create a notification action with predefined defaults that get merged with call-time data:
- Create action with ID
custom_alert - Configure default data:
priority: high
category: system
timeout: 30
custom_field: default_value- When you call the service, the default data is merged with your provided data:
service: notify.custom_alert
data:
message: "Alert!"
data:
priority: critical # Overrides default "high"
extra_field: "value" # Added to defaults
# timeout: 30 (inherited from defaults)
# category: system (inherited from defaults)- The event will contain the merged data object accessible via the
datatemplate variable
Intercept all notification calls and route them through your own logic:
- Create actions for different notification types
- Use automations to handle the events
- Apply custom filtering, throttling, or routing logic
- Legacy Service (
CustomNotifyActionService): Supports all notification parameters - Modern Entity (
CustomNotifyActionEntity): Limited to message + title (Home Assistant constraint)
- Service/Entity receives notification call
- Fire
notify_actions.messageevent with all data - Execute optional action sequence (if configured)
- Templates are pre-rendered before script execution
This component is designed to be simple and maintainable:
- Event-based architecture (no actual notifications)
- Template rendering via Home Assistant's Script helper
- UI-based configuration (no YAML needed)
- Both APIs share common code paths
- Restart Home Assistant after installation
- Clear browser cache (Ctrl+Shift+R)
- Check Home Assistant logs: Settings → System → Logs
- Verify action sequence syntax via Options Flow
- Test templates in Developer Tools → Template
- Listen to
notify_actions.messagein Developer Tools → Events - Verify action_id matches your configuration
- Check that service call is reaching the integration
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Created by Alexander Kentner