It was a permission problem on the _Playlist directory inside LMS!
After fixing it I can now trigger an alarm and it will resume exactly where it was before it
This script is perfect for me. Thanks @pkozul and @smazman for that script.
@ppmt Great to hear Philippe. Can you just temporarily use the original script (post #65) just to see whether that script successfully resumes the playlist exactly where it was paused?
I just want to see whether my new version actually makes a difference (for someone else other than myself!).
So I tried the said script and at the beginning I thought that it was working the same as yours. It was restarting at the same time it was interrupted but then I realised that it was not the same song.
After triggering the script a few time it seems that it restart at the same time but using the next song in the playlist.
Very strange
I found a great plugin for lms called lmsannounce. It give you an api to do announcements to your squeezebox-player.
Your announcement can be a playlist, a file (mp3, flac ect.) or a TTS. The cool thing is it saves whatever your playing en resumes after the announcement is done!
I’ve used it to extend my doorbell which triggers a shell command doorbell.
I’ve combined it with my earlier efforts to make a easy (or easier) to deploy TTS addon… (using the other method in this topic earlier)
Also because I don’t like the TTS options lmsannouce gives if made it so that you can use whatever TTS home assistant uses.
I’m not much of a programmer so lots of BETA flags and <insert i have no idea what i’m doing dog in lab image here>
Add the repo, install addon, configure the lmsserver:port (without http://) and use.
Using call service → hassio.addon_stdin
input:
alert_volume: 100
mac: '00:00:00:00:00:00'
base_dir: '/volume1/apps/tts/'
tts_message: 'Hi, i am a TTS notification. May i interrupt?'
where base dir is where the tts cache directory is mounted.
Did I mention you need to mount the home assistant tts cache on your LMS server?
Well this was easier in my head… Also I just realized i did not implement playing existing files quite yet.
Look, I wanted TTS, got all excited it worked and wanted to post! Will update later with a better guide and update to addon to include playing non TTS.
Wanting to use your script, but have not got it working yet. Can you share me details/examples on the call service? And the mounting done on the LMS server?
The addon part is the slugs name for the addon. I don’t know if this is the same for everyone or anything but you can look it up by looking at the url when you’ve selected the addon in the addon store.
Where base_dir is the path to the mounted folder from earlier, as seen by your LMS server. The others are self explanatory.
Thanks for the details guide. I have everything set-up (samba, sharing etc) but the sound file in the tts folder is not created when calling the service. And hence nothing happens on my squeezebox.
[00:36:50] INFO: Raw input: {“alert_volume”:25,“mac”:“XX”,“base_dir”:"/volume1/hass/config/tts/",“tts_message”:“This is a test”,“platform”:“microsoft”}
[00:36:50] INFO: Using base_dir: /volume1/hass/config/tts/
[00:36:50] INFO: Using mac: XX
[00:36:50] INFO: Using alert_mp3: null
[00:36:50] INFO: Using tts_message: This is a test
[00:36:50] INFO: Using alert_volume: 25
[00:36:50] INFO: Using platform: microsoft
[00:36:50] INFO: Player lock exists…exiting.
I tried the LMS Announce plugin, but it didn’t really work out in my setup. I have 6 Squeezebox players around the house, and using this plugin, some of them were unable to resume playback after the announcement was played. The players were left in a weird state where their playlists were empty. I might try again in the near future.
Anyone else got it working nicely with multiple players?
For now, I am sticking to the solution I posted earlier. It’s been working for months without any issues (in my setup anyway).
It just needs to match, so if your tts is set to reversotts in HA, also use platform: reversotts for LMS announce.
It should work with all but amazon_polly but i have only tried google and microsoft myself.
I made an integration with the same functionality that adds notify services and a service to use in the automations gui
It is easy to install and configure
@pkozul I’ve managed to get LMS Announce setup with multiple squeezebox players. The problem for me only appeared with synced devices, unsynced players worked fine. I think the issue is that when a player is not the master device for the sync group, then it creates the issue as you have described. If it is the master device, then it works, but also plays the notification to all players with in the group (slave devices).
To overcome this, as part of my notification automation, it checks if the device is synced to another player. If it is, store this information in an input_text, unsync the device, play the notification and then re-sync it to the player stored in the input_text. There is a slight pause in music when it re-syncs, but that is part of sync process from LMS.
One thing note is to add a delay in the automation so that LMS Announce can finish before trying to re-sync the player back. If it’s an mp3 file with a fixed time, then use the time of the file and add a second. If it’s TTS, use the “wait for trigger” and use the state change of the device from playing to idle as the trigger.
I installed the intergration and it saves the playlist, plays the notification but does not resume playing. I’m on the latest 8.2 lms nightly. What lms version do you use?
Great work btw!
I am using LMS 8.1.1
Try rescanning the media collection in LMS, I remember LMS not finding a playlist, but not sure when or why a ran into that problem anymore
Please go to: