vectronic / homebridge-alarm-panel

A Homebridge plugin providing an alarm system with a web UI.
MIT License
11 stars 0 forks source link

Airplay Integration #1

Open Cloudore opened 5 years ago

Cloudore commented 5 years ago

Hey!

Fun plug in to interact with, do you think it'd be easy to set the sound output location to airplay targets instead of sonos?

vectronic commented 4 years ago

Sorry I didn't answer this sooner - I wasn't getting notifications for issues.

Interesting. Can you point me at any info on how I could do that? i.e. something similar to how I am currently using node-sonos-http-api project for Sonos Integration.

Cloudore commented 4 years ago

No worries, I'm not sure exactly how to make it work, but I would think about it as the Raspberry Pi becoming an Airplay player for the duration of the triggered state and then disconnecting when it finishes. While it is connected as an airplay player it would connect to airplay targets defined on the config.json and play the alarm sound also defined.

I've seen a couple of third party applications be able to use airplay this way, but I am unsure how much work it'd be to implement. I know of https://github.com/mikebrady/shairport-sync, but this makes the raspberry become a player, the opposite of what we would want in this case, since we would wanted to be the source of the sound.

vectronic commented 4 years ago

A quick search returns a couple of NodeJS client libs although they seem to be not updated recently...

e.g. https://github.com/benvanik/node-airplay might be a contender.

I have changed the code base to now refer to generic web hooks instead of Sonos API URLs. So ideally a separate service would be running which just defines a URL to hit for each web hook. Without this the code vase would need to be changed to specifically use the project linked above to discover and connect to Airplay devices.