I assume I’m not the only one facing this. How do you get Volumio to pause then resume (if something was playing) after a TTS message was announced. I get it to ‘pause_play’ but playing the message and resuming music doesn’t work.
I tried it with Node-Red also but the flow isn’t passing anything to the call service node that would do this correctly.
This is what I have now, but several things are an issue. e.g.: playing the TTS removes the paused media therefore resume wouldn’t do anything even if it got executed. I believe I’ll need to store the state of things.
Either I am going about this the wrong way, re-inventing the wheel or surprisingly the first one to need this functionality?
OK, I think I have it done (almost). Just need it to play my stored message from the MQTT instead of hard-coded one. The pause/play works (doesn’t resume from where it was, but plays track that was playing from beginning).
This seems to do it. All TTS is now generic via MQTT topic. This flow handles the player state (playing, stop, pause) and plays TTS or stops music/radio, plays TTS and starts the music/station of the stored position in the volumio queue of what was previously playing.
NOTE: There is a ‘seek’ number that does come in the ‘Get Volumio State’, however Volumio doesn’t seem to honor it back according to their API doc., i.e. you cannot resume from where the song was. Also, although I used paused, I might as well have used stop because once the TTS plays, there isn’t a resume option as it seems to blow away what was paused. It would be nice if there was multi-channel support in Volumio.
Anyway, this is what I was after so this will have to do for now.
I didn’t realize Volumio has a websocket API that seems to support the seek (elapsed time) function. Will need to look into that to make this use-case just right.
UPDATE: No luck on the websockets. Hopefully someone with a better understanding of it in Node-Red can provide some input. It seems the calls need a method and data. The data is easy as it would be whatever is needed in JSON. Put I don’t see how the method is to be sent. Also, I am not getting that “connected” status for the websocket nodes. If I use ws://, it says not connected, when I use http:// it doesn’t say anything.
Things have improved but I have not got time to complete it. The maintainer of the Volumio MQTT via WebSockets added the support I requested so I’ll be moving to that. Stay tuned.