petro-kushchak / homebridge-homepod-radio

MIT License
35 stars 2 forks source link

More than a Homepod Mini #2

Open mario-2015 opened 2 years ago

mario-2015 commented 2 years ago

Hello,

I would like to know is it possible to integrate more than one Homepod / or Airplay-er ? If so, how does that work ?

{ "platform": "HomepodRadioPlatform", { "name": "Homepod Radio", "model": "BBC - Radio 1", "homepodId": "FIRST-ID, SeCOND-ID", "radioUrl": "http://stream.live.vc.bbcmedia.co.uk/bbc_radio_one" }

petro-kushchak commented 2 years ago

Hi, technically should be possible - for each HomePod plugin can start separate atvremote streaming pipe...

I could add support for multiple devices later, once other issues polished with single HomePod implementation (streaming process potential crashes, and/or cases when HomePod starts playing from other device)

justdun commented 1 year ago

Hi all,

Depending on your application, I have a work around that I am testing at the moment that seems to partially solve this issue.

My use case is that I want to use 2 x homepods and 6 x JBL Soundfly speakers (Airplay1) to sound an internal siren around the house as part of my alarm system trigger.

I have set up according to the instructions, and have a common siren .wav sound file on localhost.

I have multiple HomePodPlatform instances in my homebridge configuration, each with a different:

All point to the same directory and siren .wav file. (see code below)

Each instance shows as a separate button in Homekit.

Then I set up a dummy button (from [https://github.com/nfarina/homebridge-dummy] ) and set up an automation to trigger each of the speaker buttons from the HomePodPlatform instances.

I found that you set the speaker automation to 'resume' audio (if you use 'play' it wants you to set an Apple Music sound which is not what we want here).

Now I just need to hit the 'dummy' button and the siren plays on each of the speaker instances I have set up. There is a separate delay for each speaker (unfortunately), so they are not syncronised - but for my use case that is not a problem.

Will be great if we can one day stream to multiple speakers from the one instance in homebridge, but this work around might help a few.

Take care,

Justin.

Config example:

   {
        "homepodId": "<SpeakerIDnumber1>",
        "mediaPath": "/Users/Documents/Homebridge/sounds",
        "httpPort": 4567,
        "verboseModel": true,
        "volumeControl": false,
        "radios": [
            {
                "name": "Siren1",
                "radioUrl": "http://localhost:4567/play/siren.wav",
                "volume": 25
            }
        ],
        "platform": "HomepodRadioPlatform"
    },
    {
        "homepodId": "<SpeakerIDnumber2>",
        "mediaPath": "/Users/Documents/Homebridge/sounds",
        "httpPort": 4568,
        "verboseModel": true,
        "volumeControl": false,
        "radios": [
            {
                "name": "Siren2",
                "radioUrl": "http://localhost:4568/play/siren.wav",
                "volume": 25
            }
        ],
        "platform": "HomepodRadioPlatform"
    },
    {
        "homepodId": "<SpeakerIDnumber3.",
        "mediaPath": "/Users/Documents/Homebridge/sounds",
        "httpPort": 4569,
        "verboseModel": true,
        "volumeControl": false,
        "radios": [
            {
                "name": "Siren3,
                "radioUrl": "http://localhost:4569/play/siren.wav",
                "volume": 25
            }
        ],
        "platform": "HomepodRadioPlatform"
    }