Multiroom airplay through airfoil with smartthings, home kit, android wear, logitech harmony and Alex control - is this integration?

I managed to add my airplay speakers to smartthings with multiroom by doing the following:

Set up airplay speakers onto network (simple)

Install airfoil for use of multiple speakers

Install airfoil-api

Install HA Bridge

Use the usage commands in airfoil-api reade.md to find speakers and add the on/off/dim commands for each speaker into HA Bridge.
This saves the speakers as hue lights in a new “hue bridge”.

The speakers will now be found by Alexa - good start!

I wanted them in smartthings but I already had a hue bridge connected so I added this smart app and all the device handlers in the IDE

I was then able to add the new “hue bridge” and then the speakers as dimmable lights into smartthings!

To add siri support I installed homebridge on my computer and the smartthings plugin

To get the config.json right I installed the smartapp in the smartthings IDE by pdlove and copied the generated config.

I was then able to control my speakers via any lighting app in smartthings, setting rules for arrival, departure, motion, time etc. I could also control my speakers via Alexander and any smartthings device I had selected via siri and home kit!

I then resigned in to smartthings on my logitech harmony hub to control the speakers via remote control (they are in the lights section).

For android wear I simply used the cleverobjects app

This requires launching of the wear app to use but it does respond to voice when it’s open.

I’m not too hot on coding, these are all bits I’ve found over the last few months but I’ll try and help anyone if I can.

Now I want to add iTunes control into smartthings and I will be a happy bunny :wink:

Haven’t tried the Spotify commands yet but interested to see if I can add a Spotify ‘light’ that turn’s off when I leave the house and on when I return home.

I had trouble installing the airfoil-api, what I ended up doing was installing mdns manually with npm install mdns (or sudo npm install -g mdns , you’ll have to chmod 775 .) , then removing mdns from the requirements in the package.json file and changing the two instances of port 8080 to 8081 in app.js

You have to change the port number to match in the commands then.

This is where you lost me. How do I do that in the HA Bridge GUI?

Got it! It was more simple than I thought.

Step 1: In HA Bridge GUI (http://serverIP:port#) goto Add/Edit

Step 2: Name the Device. I named mine “Speaker AppleTV”

Step 3: In the “On Items” area change Type to “HTTP”, in “Target Item” field paste in the url for the speaker you want to use from the usage commands from airfoil-api readme. Mine was 10.168.1.14:8881/speakers/5855CA028A72@AppleTV/connect. Connect means “On”. Then change “Http Verb” to “POST” and click add.

Step 4: In the “Dim Items” area change Type to “HTTP”, in “Target Item” field paste in the url for the speaker you want to use from the usage commands from airfoil-api readme. Mine was 10.168.1.14:8881/speakers/5855CA028A72@AppleTV/volume. Then change “Http Verb” to “POST” add ${intensity.percent} to Http Body and changing Content Type and click add.

Step 5: In the “Off Items” area change Type to “HTTP”, in “Target Item” field paste in the url for the speaker you want to use from the usage commands from airfoil-api readme. Mine was 10.168.1.14:8881/speakers/5855CA028A72@AppleTV/disconnect. Disconnect means “Off”. Then change “Http Verb” to “POST” and click add.

Step 6: Scroll back to top and click “Add Bridge Device”. This will add it to Bridge Devices area.

Step 7: Goto Bridge Devices menu and Test On, Test Dim and Test Off. You will see the changes reflected in your AirFoil App installed on your PC/Mac.

NOTE: If your Speaker name in AirFoil API has a space in it, (ie. Living Room AppleTV) this will not work as the HTTP post cannot handle spaces properly. I had to change the name of my devices to something without a space for it to work.

I had to drop the http:// off my URLs in step 3, 4, 5 for this to post as I am a new user and limited to 2 URLs per post. Strange limitation but oh well.

Ah yes, you have to choose content type text/plain and write in
${intensity.percent} in the http Boo box

This worked really well! Thank you. I’ve been waiting and hoping that Obything would come back, but this seems like a great work around.

I was hoping for obything to come back too, chatted with Brice and expected it before Christmas, I’ve actually nicked a bit of code and added it to the HAM bridge smartapps to allow start/stopping of iTunes and use the Spotify start pause etc with HAM Bridge when I leave or enter the house etc, it’s pretty cool to have presence control over music. I still like the HA Bridge method as I can use all the other stuff (Alexa, android wear etc) but HAM Bridge is the toy of choice at the moment

Actually, by combining HAM Bridge and HABridge I’ve made an iTunes ‘light’ for play and pause of iTunes playlists and library through all the above controllers too

I’ve knocked together another load of stuff for control of iTunes and Spotify via a Modified Virtual Remote in the Smartthings App. It’s got loads of parts to it but that helps with automation and forwarding to Alexa and Logitech Harmony. See the steps at https://github.com/ijaspley/HAM-Bridge-Smartthings-Media-Control

How I install HA-Bridge on my Mac (or Windows)? I see it in Github, but I don’t know what to do with it.

I think I figured it out, but I get this error: ERROR com.bwssystems.HABridge.HABridge - Could not start ha-bridge webservice on port [80] due to: Permission denied

Ok - I got HA-Bridge running.

Now I’m having problems getting the airfoil-api running. I can install but not run.

Hi, try putting sudo before the launch command

Thanks for the feedback. With fresh eyes it looks like it’s throwing an error because the port 8080 is in use, which it is the port I have ha-bridge running on, because port 80 (the default for ha-bridge) is being used by something else and I forced ha-bridge to run on 8080. They are both running now.

Now I need to figure out how to find the url for the speakers.

I can’t get this to work. I had it working on a Mac, but I can’t get it working on a windows machine. I get errors like “cant find python” and “failed at mdns@2.3.4. install script” I have no idea what that means. Any suggestion?

So are we just using the airfoil-api to sniff out the speaker details and the manually enter them in the bridge?

That’s the one

I don’t use Windows but try installing python separately and mdns then remove them from the requirements file, maybe that will work