petro-kushchak / homebridge-homepod-radio

MIT License
38 stars 2 forks source link

Question: Homepod announcement #16

Open Kroellie opened 2 years ago

Kroellie commented 2 years ago

Hi, a theoretical question for you before I waste all my time: I want a sort of JARVIS solution in my home, where events get notified through the homepod. However, when it is playing something, I want it to resume after the announcement. Is there a way where I can read its current activity, and trigger it again when I have streamed an audio file?

petro-kushchak commented 2 years ago

Hi, that's something I was planning to support in the future - text to speak for notifying messages (instead of audio file playback) and then auto resume of previously streamed audio(internally by plugin w/o need to re-triggering). Technically plugin could also trigger some notifications (when or expose external toggles but that would be much more fragile and hard to configure

Kroellie commented 2 years ago

I wouldn't focus too much on the TTS, as those service providers have all their own unique implementation method, and ultimately all produce an mp3 file to be streamed. There is for example the github project jishi/node-sonos-http-api which has everything you need. I think the biggest challenge would be the 'capture current state' and 'resume previous state' activity. Of course in a live radio stream, that would be 'easy' to reconnect to. I think the biggest problematic usecase of the Homepod though is Apple Music, or Airplaying Spotify. I'm unable to find anything similar to Sonos' feature 'announce' in the pyatv project. I think after any mp3 stream it would simply stop and not continue where it was left. Technically I think the feature is there, as there is also a doorbell notification which exactly does what is needed. And that does resume.

petro-kushchak commented 2 years ago

Thanks for hints TTS - will check it out..

I also haven't seen any references in pyatv for reading/resuming Apple Music or Airplay stream - hopefully with next version of iOS there will be more API available. Some basic scenarios could be supported - you can read current track/album playing on HomePod and play it again, but it wont resume playlist. From my testing you can not resume Airplay streaming from other devices at the moment...