Logitech Media Server TTS Notify Queue

@floris-b many thanks for your great work, I try to migrate away from the old alert script.
I have TTS and alert sound working on 1 player, but I seem to have a few issues:

  • I have no idea how I can add multiple players, the list as stated in previous post doesn’t work (and not listed players cannot be used ?), might be worth adding it in the docs.
Invalid config for [notify.lms_tts_notify]: value should be a string for dictionary value @ data['media_player']. Got ['media_player.squeezebox_wit', 'media_player.keuken']
  • Is there any way just to play a sound, without TTS, would be great for doorbell for example. Now it is mandatory

For multiple players you need to repeat

    - platform: lms_tts_notify
      name: sonos_zitkamer_lms
      tts_service: tts.google_say
      media_player: media_player.sonos_zitkamer_lms
      device_group: group.all_persons
      volume: 0.4
    - platform: lms_tts_notify
      name: sb_speelkamer
      tts_service: tts.google_say
      media_player: media_player.sb_speelkamer
      device_group: group.all_persons
      volume: 0.4
1 Like

TTS messages are not generated or sent to LMS with this plugin, instead the squeezebox and tts integration is used.

No, would be easy to implement. I will implement it next time I work on it

with the new release it is optional

1 Like

@floris-b, it seems there still is an issue:

Triggered manually at 4 november 2021 19:42:03
Call service notify.squeezebox_keuken
Stopped because an error was encountered at 4 november 2021 19:42:03 (runtime: 0.01 seconds)

required key not provided @ data['message']

I am on version 0.3.11

the underlying notify code of home assistant requires a message, if you use the service lms_tts_notify.queue the message is optional

Hi,
I have some problems getting this to work - I think i missed something…
I have a LMS running on a RaspberryPi 3 with a Squeezelite Player configuration named “Infospeaker”.
I can play my music from ma LMS library on that Player - this works fine.

In HA I have installed the LMS TTS Notify Plugin and configured my configuration.yaml like this:

tts:
  - platform: google_translate
    service_name: google_say
    language: "de"

notify:
  - platform: lms_tts_notify
    name: Infospeaker
    tts_service: tts.google_say
    media_player: media_player.Infospeaker
    device_group: group.all_persons
    alert_sound: Alert
    volume: 0.4

If I use the developertools - services tab and choose the player “Infospeaker” enter a text and try to play it - there’s no sound.

Thanks for any hint.
Markus

I think I got a little further:
The name of the Squeezelite PLayer is wrong - it needs to be the entity:
image

So I changed the config:

tts:
  - platform: google_translate
    service_name: google_say
    language: "de"

notify:
  - platform: lms_tts_notify
    name: Infolautsprecher
    tts_service: tts.google_say
    media_player: media_player.max2play_1
    device_group: group.all_persons
    alert_sound: Alert
    volume: 0.4

But now I get an error ni the log:

Logger: pysqueezebox.server
Source: /usr/local/lib/python3.9/site-packages/pysqueezebox/server.py:183
First occurred: 18:47:57 (35 occurrences)
Last logged: 18:52:58

Failed communicating with LMS: <class 'asyncio.exceptions.TimeoutError'>
Failed communicating with LMS: <class 'aiohttp.client_exceptions.ClientConnectorError'>

Any idea what could be wrong?

Thanks
Markus

First make sure the squeezebox player and TTS works in HomeAssistant
Also do not forget to set playlist location in LMS, if not set the restore playlist does not work after the alert message

1 Like

Hi,
I found my problem within Squeezelite versions >= 1.8.6-938.
Versions above work perfectly fine.
Just a hint…

I would like to use this, BUT… i have no tts service i can use.
I have a local rhasspy rather then an online service.
I can publish per mqtt for rhasspy to speak using the snips: integration, but there is no tts service (i have no idea how to make one).
While squeezelite is using the soundcard i dont hear anything from rhasspy, so i would like rhasspy speaking throught LMS

@floris-b Is there any way to use your Notify queue using mqtt?
Thats how i use it for answering rhasspy requests.

service: mqtt.publish
data:
  topic: hermes/dialogueManager/endSession
  payload: >-
    {"sessionId": "{{trigger.event.data._intent.sessionId}}","text" :
    "{{text to speak}}"}

the answer comes with the topics
hermes/audioServer/ez/playBytes
hermes/audioServer/ez/playFinished
hermes/audioServer/ez/audioFrame

hello, I can’t get the music back after a tts. I have a playlist that is being created, I see that the music before the tts is recorded there but it does not restart. In “playlist” on home assistant, I see the file but if I click to launch it manually, I have this error:

the logs don’t tell me anything specific.
sorry for my english, i am a french speaking user.
Any idea ?
Thanks

Have u ticked the ‘Force play’ box and switched it on? ( This in UI-mode)
Here’s an example in yaml-mode:

service: lms_tts_notify.queue
data:
  entity_id: media_player.es9023
  message: There is someone at the door!
  volume: 0.1
  force_play: true
  alert_sound: Doorbell

Offcource make sure that if you use an alert-sound, u have a playlist with the same name defined in lms.

yes, I tried with and without and it’s the same thing.

I didn’t put any warning sound.

I wanted to try to do it with node red but I don’t know which way to go to get the playlist

This is a great integration, thanks for the work!

When I make a service call that references multiple speakers like below. Does this sync the multiple speakers before sending the audio?

service: lms_tts_notify.queue
data:
  entity_id: 
    - media_player.lms_formal
    - media_player.lms_kitchen
    - media_player.lms_lr
  message: Ring ring, ring ring ring. There is someone at the door. Ring ring, ring ring ring.
  force_play: true
  volume: 0.75

It seems like in some cases the speakers don’t do the tts announcement in sync if multiple are specified.

Works like a charm. Thanks!

I tried to add the custom repository and it says Invalid Add-on repository! What can i do?

I got it working, but now i have another problem. When the Squeezebox is off and the script starts, everything is fine, but after the script its starts playing music instead of going off again.

No one any idea why?