bernikr / lovelace-notify-card

Send notifications directly from the dashboard
MIT License
45 stars 16 forks source link

How to make it work with Google Home ? #8

Closed silversmarty closed 2 months ago

silversmarty commented 2 years ago

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!

bernikr commented 2 years ago

The card is currently only designed for services in the notify. domain. At the moment I don't have the time to change it, but I might eventually get around to it.

ikrowni commented 2 years ago

Id love to see this ability added. I have a mix of devices

RuoYear commented 2 years ago

The card is currently only designed for services in the notify. domain. At the moment I don't have the time to change it, but I might eventually get around to it.

When I was trying to call the service to let the text play to my XiaoMi Speaker, I found your design. Thank you. But also encountered this issue, unable to pass appropriate parameters. For example, I want to do is: service: xiaomi_miot.intelligent_speaker data: entity_id: media_player text: text But it cannot be executed, tell me 'extra keys not allowed @ data['message']'. So I was checking notify-card.js, it is found in line60 passes data to child data, so it cannot be used in general, maybe just only used to Alexa.

So when I read hass developers document, try to modified the local code, change '{message: msg, title: title, data: this.config.data}' to 'this.config.data', and input title&msg, it works.

In this way, it can realize many possibilities. Thank you again.