Giter Site home page Giter Site logo

airplay-homekit-rpi's Introduction

AirPlay with HomeKit for Raspberry Pi

This project creates an AirPlay stream target on a Raspberry Pi. It also makes a HomeKit virtual power switch available that turns on whenever a stream is active and off whenever a stream stops. This allows you to create automations that, for example, turn on smart plug (e.g. iHome ISP6x) attached to an audio system or set mood lighting whenever you play music.

Requirements

  • Raspberry Pi configured on your network
  • Docker CE. For raspbian OS, see these setup instructions on the Docker docs site

Recommended hardware

I highly recommend the following hardware components

You can skip the HifiBerry DAC, but you'll be seriously missing out. They sound WAY better than the RPi built in DAC.

Running

Running is simple. Just run the following Docker command: docker run -d --net host --device /dev/snd -v $HOME/persist:/persist -e HOMEKIT_CODE=872-78-174 -e AIRPLAY_NAME=AirPlay_HomeKit ccaum/airplay-homekit-rpi:latest

Replace AirPlay_HomeKit with whatever you want your speaker to show up as in AirPlay.

If you need to set a different HomeKit code, if for example it conflicts with a code already in use, you can set a different value to HOMEKIT_CODE.

Systemd

If you'd like the container to be controlled by systemd so it can start on boot, there's an example airplay.service file in this repository.

  • Place the file in /etc/systemd/system/airplay.service on the raspberry pi.
  • Reload systemd with systemctl daemon-reload
  • Set it to start on boot with systemctl enable airplay
  • Start the airplay service with systemctl start airplay

Setting up HomeKit

  • In the Home app, tap the '+' symbol, then tap the "Add Accessory" option
  • Select the "Don't Have a Code or Can't Scan" option at the bottom of the screen
  • The "AirPlay Stream Switch" should be available as an option. Select it and complete the accessory addition process

Once the AirPlay power switch is set up in HomeKit, you can create automations automatically turn on audio equipment or set lighting scenes.

Streaming Audio

In iOS, tap the AirPlay symbol in your Music app, or whatever app you'd like to stream audio from. Whatever you named the AirPlay speaker should appear as an option.

Thanks

Huge thanks to...

airplay-homekit-rpi's People

Contributors

ccaum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

applebaumian

airplay-homekit-rpi's Issues

Other machines

Excuse me, I have a NAS server with Docker installed in it. Can I configure this function? If so, how do I do it?

How to interact with the homekit switch

Great tool guys!
The installation is seamless.
I was only wondering how can I access the switch state within the raspberry pi?
I was thinking of sending an IR signal to turn on my Amp whenever the switch got turned on but I don't know where I can retrieve that information.
It doesn't seem to be indicated in the readme so perhaps a wiki entry for it would be appropriate.
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.