bernikr / lovelace-notify-card Goto Github PK
View Code? Open in Web Editor NEWSend notifications directly from the dashboard
License: MIT License
Send notifications directly from the dashboard
License: MIT License
Could you add possibility to set a language in this card? I tried as below, but it seems, this field is ignored:
- type: custom:notify-card
card_title: Send notify to Salon
target: tts.google_say
entity: media_player.salon
data:
language: pl
`
Hello,
When I add data parameters for the service like this :
type: custom:notify-card
...
data:
volume_level: 0.3
title: Announce
it will send to a sub data key to the service.
You have to merge the msg
with the data
to provide only one data
dict:
var service_data = Object.assign({}, this.config.data, { message: msg });
this.hass.callService(domain, target, service_data);
When I select the service alexa_media_XXX and want to send a notification, following error message appears:
TypeError: 'NoneType' object is not subscriptable
the issue is very likely to be from me but seems I start a new HA install, I don't have alexa_media entity anymore but only media_player like "media_player.living_room"
when I try this, I have "Failed to call service [...] service not found"
type: 'custom:notify-card'
target:
- media_player.living_room
data:
type: announce
label: Living
Allow changing the send button icon in the config:
let label = this.config.label ?? "Notification Text";
let icon = this.config.icon ?? "mdi:send";
this.content.innerHTML += `
<div style="display: flex">
<ha-textfield id="notification_text" style="flex-grow: 1" label="${label}"></ha-textfield>
<ha-icon-button id="send_button" slot="suffix">
<ha-icon icon="${icon}">
</ha-icon-button>
</div>
`;
type: custom:notify-card
target: script.send_mqtt_announcement
label: Announcement text
icon: mdi:bullhorn
card_title: false
card_mod:
style: |
notify-card > ha-card {
padding: 16px 0px 0px 16px;
}
Some notifications require a title to be specified, like the IOTLink notifications for example,
This is a working service call from my developer-tools/service
page.
service: script.notify_freddys_desktop
data:
message: The Body of this Notification is a test too.
title: Test Notification
This is what is required to send a notification, In order for it to work I must specify a title and a message.
But when trying to use this card and specifying a title like this
type: custom:notify-card
target: script.notify_freddys_desktop_quick
data:
title: Quick Notification
It doesn't work, I'm assuming this is because the service call the card is trying to do is this
service: script.notify_freddys_desktop
data:
message: Body of the Notification
data:
title: Quick Notification
which isn't actually specifying a title at all.
I've worked around this issue, by making a modified version of my script that specifies a title in the script, but this means I have to create a new script just for this card to use for every machine and each specific card in my UI that I may want to specify a different title for. Not ideal, but it works.
I think adding support for notify services that may require title would be worth it. My suggestion for supporting titles specifically would be to add a new option in the card's config
specify_title: true #Enables a second text field in the card for specifying the notification title at will, defaults to false
default_title: "Quick Notification" #If specify_title is false, use this title for all notifs sent with this card, if specify_title is true, then just have this be the default contents of the title field, if not specified behavior would just be identical to how the card works now.
Even in applications where the title isn't required, I think everyone using this card would benefit from being able to add a title to their Notifications
Hi, Can be added possibility to select notification service directly from card?
This is a great frontend card, thanks for creating it. This card would be amazing if you could specify a list of targets via yaml list or input_select.
Then from the frontend card, have a dropdown menu that allows you to select the target notify source you want to send to. Added bonus, if you could also write a custom message or also select from a pre defined message again from an input_select helper.
Thanks in advance,
The service "notify.discord" requires additional entry "target", I configured the card as below, but it doesn't seem to work.
Card Config
type: custom:notify-card
target: discord
data:
target: 'xxxxxxxxxxxxxxxx'
card_title: Notify Discord
notification_title:
input: Title
HA Service Call
service: notify.discord
data:
title: Test
message: Testing
target: 'xxxxxxxxxxxxxxxxxx'
HA Error Log
Logger: homeassistant.components.discord.notify
Source: components/discord/notify.py:77
Integration: Discord ([documentation](https://www.home-assistant.io/integrations/discord), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+discord%22))
First occurred: 6:36:54 PM (6 occurrences)
Last logged: 6:52:19 PM
No target specified
Card
type: custom:notify-card
target: tts.speak
entity: media_player.alarm_speakers
data: <-- tried adding this with no luck..
media_player_entity_id: media_player.alarm_speakers
Service
service: tts.speak
data:
cache: true
message: test
media_player_entity_id: media_player.alarm_speakers
target:
entity_id: tts.google_en_com
So I have this working now with tts.google_translate_say but is it possible to use this with piper? I couldn’t get it working but I’m inexperienced
Hello,
first of all, many thanks for this amazing card: it's exactly what I was lookin for!
I'm trying to make it work with Google Home, which have the following syntax:
service: tts.google_translate_say
data:
entity_id: media_player.cuisine
message: test
language: fr
However, I've read your discussion about Alexa and it seems that the Google syntax is not compatible with what you've done for Alexa (mainly because additionnal attributes as "entity_id" (which is the target id of the desired Google Home) needs to be added in the "data" attribute.
As a reminder, the Alexa syntax seems to be:
service: notify.alexa_media_bad
data:
message: MESSAGE TEXT
data:
type: announce
My question is pretty simple : How to make it work with Google Home ?
Thanks again!
There is a way to change via gui the notify service?
When there is no label the padding needs adjusting, card_mod will do the trick like this.
type: custom:notify-card
target: script.send_mqtt_announcement
label: Announcement text
card_title: false
card_mod:
style: |
notify-card > ha-card {
padding: 16px 0px 0px 16px;
}
I installed via HACS and did a reboot but the custom card is not available. Even when I create a manual card it is not possible because the card is not available.
I also tried to install manually but I don't know where to add the resource:
resources:
- url: /local/notify-card.js
type: module
If I add this code to config.yaml I get an error.
I’d like to make the card looks simpler.
Hi, I love this card. But one thing I really miss is the option to use templates. For instance, I want the notification_title
to include a template, where it automatically enters the username of the person logged in.
Like so (which does works with service-calls):
[[[ return 'Message from ${user.name}!' ]]]
This then automatically sends the username of the user logged in that sends the message.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.