This simple card allows you to notify any notification service manually from the dashboard.
- Go to the "Frontend"-tab in HACS
- Click on "Explore & Add Repositories"
- Search for
Notify Card - Click "Install this Repository in HACS"
- Copy the
notify-card.jsfile to yourconfig/wwwfolder - Add a reference in the resource config:
resources:
- url: /local/notify-card.js
type: moduleExample config:
type: 'custom:notify-card'
label: Notify TV
card_title: Send Notification
notification_title:
input: Title
action: notify.living_room_tv
data:
message: "{{ msg }}"
title: "{{ title }}"actionis the name of the action (service) to be calleddatais used to define the data that gets passed to the action. Any data can be entered here and home assistant templates are supported. (withmsgandtitleas variables for the entered text anduserfor the current user object)labelis optional and controls the placeholder textcard_titleis optional and controls the card title. Set tofalseto hide the title entirely and remove the header paddingiconis optional and controls the send button icon (default:mdi:send)groupis optional. Set totruewhen embedding inside another card — removes the border, box shadow, and background so the card blends into its parentnotification_titleis optional and can be used as a second textfield
Minimal config:
type: 'custom:notify-card'
action: notify.living_room_tv
data:
message: "{{ msg }}"For services that require an entity as a target:
type: 'custom:notify-card'
action: tts.google_say
data:
message: "{{ msg }}"
target:
entity_id: media_player.nestmini_living_roomIf you want a textfield to set the notification title with every message you can configure it like this:
type: 'custom:notify-card'
action: notify.living_room_tv
data:
message: "{{ msg }}"
title: "{{ title }}"
notification_title:
input:If you want to change the label of the title textfield you can do that in the input parameter:
notification_title:
input: 'Put Title here'To use a custom icon for the send button:
type: 'custom:notify-card'
action: notify.living_room_tv
icon: mdi:bullhorn
data:
message: "{{ msg }}"To embed the card inside an entities card without a visible border or background:
type: entities
entities:
- entity: input_number.some_helper
- type: custom:notify-card
action: notify.living_room_tv
card_title: false
group: true
data:
message: "{{ msg }}"