Giter Site home page Giter Site logo

lovelace-notify-card's People

Contributors

bernikr avatar lookedpath avatar selfish avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

lovelace-notify-card's Issues

Support for other languages

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

`

`data` parameter is not at the right level

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);

issue with Alexa media_player

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

Suggestion setting icon in config

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;
    }

Needs Support for Specifying Title for Notification

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

Request feature

Hi, Can be added possibility to select notification service directly from card?

Can this card work with 'input_select' helpers?

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,

How to "Notify Discord"

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

Piper

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

missing arrow

Hi,
Thanks for your great work. I like your card.
I have a small problem with the arrow button.
it is there and working but it is not visible.
Home Assistant: 2021.12.5
Thanks,
Warter
notifycard

How to make it work with Google Home ?

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!

Padding when there is no label

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;
    }

No card in Lovelace

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.

[Feature Request] Allow usage of templates

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.