postlund / pyatv

A client library for Apple TV and AirPlay devices
https://pyatv.dev
MIT License
841 stars 91 forks source link

[ Feature ] add_output_devices for HomePods #2126

Closed corrpel closed 11 months ago

corrpel commented 11 months ago

What feature would you like?

Possible to add/remove a device to the main driver

Describe the solution you'd like

Having a homepod and another speaker that is airplay2 compatible. Say "Hey Siri, play some music", homepod would be the master for audio playing. Then give the possibility to add another speaker to the first homepod, like we are using the voice to do it ("Hey Siri, add Kitchen"). I am not talking about streaming from the iphone, i am talking playing directly on HomePod without IOS intervation.

Any other information to share?

I am trying to use it by talking to homepod mini, but always add to this stream another airplay2 compatible device, automatically, using some scripting. Currently when i try to do it:

atvremote -i XXXXXXXXXXXX output_devices
Device: Bath Spk (YYYYY-ZZZZ-IIII-PPPP-SHDGBDHDHD283)
atvremote -i XXXXXXXXXXXX add_output_devices=YYYYY-ZZZZ-IIII-PPPP-SHDGBDHDHD283,ZZ:ZZ:ZZ:ZZ:ZZ:ZZ
2023-08-06 15:08:05 ERROR [pyatv.scripts.atvremote]: Command 'add_output_devices' is not supported by device
postlund commented 11 months ago

I expect good to be possible. Is the service command (add_output_devices) called against the HomePod or the receiver you want to add? You would have to call it on the HomePod (the main driver).

corrpel commented 11 months ago

It is called against the HomePod. I think it is not implemented for HomePod type devices, that is why is giving the error. Edit: I believe i misunderstood how is working. Let me try again and get back.

corrpel commented 11 months ago

Yes, my bad, it was a bit confusing in the documentation, that both YYYYY-ZZZZ-IIII-PPPP-SHDGBDHDHD283 and ZZ:ZZ:ZZ:ZZ:ZZ:ZZ are supported. Only homepods have the YYYYY-ZZZZ-IIII-PPPP-SHDGBDHDHD283. Sonos and shairport-sync have only ZZ:ZZ:ZZ:ZZ:ZZ:ZZ identifiers. Thank you, Very nice that is working!

postlund commented 11 months ago

You can pick any identifier belonging to the device you are connecting to. Or use -s <ip> if you have static IP addresses. But great that it actually worked!