floris-b / lms_tts_notify

Logitech Media Server TTS Notify Queue for Home Assistant
29 stars 8 forks source link

Add support for ChimeTTS #19

Closed svxa closed 1 week ago

svxa commented 5 months ago

ChimeTTS is another TTS wrapper that adds the ability to modify the audio sent to the media players. For example, similar to alert_sound, a pre-message sound can be added. In addition, it can also do fading, post-message sounds, etc.

In my setting, only one of my media players (PiCorePlayer) was able to play from the already implemented TTS systems. The other media players (squeezelite-esp32) simply refused to do it. The only way to get all of them playing was to use ChimeTTS.

In this PR, I added the option to use ChimeTTS as another alternative TTS provider. It is tested for my setup.

Configuration examples

configuration.yaml example:

notify:
  - platform: lms_tts_notify
    name: bose_livingroom
    tts_service: chime_tts.say
    entity_id: tts.piper
    media_player: media_player.bose_livingroom
    device_group: person.xyz
    force_play: true
    volume: 0.4
    chimetts_chime_path: glockenspiel
    chimetts_end_chime_path: marimba
    chimetts_tts_pitch: 3

Service call to service queue:

service: lms_tts_notify.queue
metadata: {}
data:
  message: This is a message
  volume: 0.6
  force_play: true
  device_group: person.xyz
  entity_id: media_player.bose_livingroom
  chimetts_chime_path: bells
  chimetts_end_chime_path: ba_dum_tss
  chimetts_offset: 250
  chimetts_final_delay: 50
  chimetts_tts_speed: 116
  chimetts_tts_pitch: 1

Service call to service notify:

service: notify.bose_livingroom
data:
  message: This is a message
  data:
    chimetts_chime_path: bells
    chimetts_end_chime_path: ba_dum_tss
    chimetts_offset: 250
    chimetts_final_delay: 50
    chimetts_tts_speed: 116
    chimetts_tts_pitch: 1

Known issues

Unsetting defaults

To unset defaults from configuration.yaml the key needs to be actively set in the service call.

For example to unset chimetts_chime_path: bells it needs to be set to e.g. chimetts_chime_path: custom_chime_path_1, which is empty (at least in my case).

krid002 commented 1 month ago

This would be very cool if it would be added any chance to get this added? @floris-b