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

http://obything.obycode.com/features/

Obything was the first place I looked but it’s not available anymore, been waiting for it to be rereleased

Hi Everyone,
I have been successfully using airfoil and airfoil-api for a couple years now, coupled with Home Assistant. Today, I started the process of navigating away from Home Assistant and setup a SmartThings hub in addition to HA Bridge (following the instructions outlined above by ijaspley and yaggayoyo). Thanks for taking the time to document things so well in this thread…exactly what I needed to get started! I am able to control my airfoil speaker via HA Bridge as directed in Yaggayoyo’s Step 7. However, I am running into an issue adding the speaker as a ‘thing’ in the smartthings app. The Hue Advanced (Connect) smartapp has no issue discovering both the HA Bridge and the speaker (as a Hue Light). 0 Hue Groups are found. When I click ‘save’ I am first given a green message that “Hue Advanced (Connect) is now installed and automating”. However, a few seconds later a red message states"an unexpected error occurred". I checked the smartthings log and get the following:

“error physicalgraph.app.exception.UnknownDeviceTypeException: Device type ‘Hue Advanced Lux Light’ in namespace ‘claytonjn’ not found. @line 511 (addChild)”

Has anyone else recently run into this issue and found a solution? Any help or suggestions are appreciated!

Thanks in advance,
Dave

I know that the IP address of the hub needs to be unique, if you have used it for anything else it could be throwing out when you set it up

Have you added the device handlers from claytonjn? I think you need them too

Thanks for the quick reply. I do have claytonjn’s device handlers setup. As for the IP address of the smartthings hub, it was auto assigned and does not match any other device on the network. I’ll keep digging.

Ah, sorry, not the smart things hub, the HA bridge IP address (so the computer or raspberry pi running HA bridge can’t already have an address as a device in smart things) I had to move my ibrew to another device but I think you can run HA bridge in docker to assign it a separate IP.

Thanks Ian. I did get this working and for the most part can turn a specific airplay speaker on and off without issue (in testing there were times smartthings seemed to loose communications with airplay or get out of sync). I did not have good luck with accurately controlling speaker volume using the dimmer feature of the smartthings switch, however. The dimmer value in smartthings did not correlate 100% with the volume of the speaker in airfoil. This is odd as I have accurate control of speaker volume when using Alexa. For example, if I were to say “Alexa, set X speaker to 10”, the volume slider in airfoil for the respective speaker would move to the 10% location. Using Alexa, I could go up or down in volume accurately. Using the smartthings dimmer feature it seemed I could go up in volume but not back down. Sometimes the volume would simply go to 100% as well. I am now looking into a new solution using lannouncer and WebCoRE in a roundabout way to trigger a specific Alexa routine that sets the speaker to a specific volume level as well as launches a specific Pandora station.

Hi - I gave up on putting this on a windows machine and got a pi. When i try to run it I get this:
pi@raspberrypi:~/airfoil-api-master $ npm run start

airfoil-api@0.0.1 start /home/pi/airfoil-api-master
node app.js

*** WARNING *** The program ‘node’ uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=node
*** WARNING *** The program ‘node’ called ‘DNSServiceRegister()’ which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister

The terminal hangs up and there’s nothing I can do. Any suggestions?

Thanks!

Hi,I think there is a conflict between nosejs and node, try uninstalling node and try again

I’ve checked node and everything is OK. Here is the log I’m getting:

0 info it worked if it ends with ok
1 verbose cli [ ‘/usr/bin/node’, ‘/usr/bin/npm’, ‘run’, ‘start’ ]
2 info using npm@6.4.1
3 info using node@v11.4.0
4 verbose run-script [ ‘prestart’, ‘start’, ‘poststart’ ]
5 info lifecycle airfoil-api@0.0.1~prestart: airfoil-api@0.0.1
6 info lifecycle airfoil-api@0.0.1~start: airfoil-api@0.0.1
7 verbose lifecycle airfoil-api@0.0.1~start: unsafe-perm in lifecycle true
8 verbose lifecycle airfoil-api@0.0.1~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/pi/airfoil-api-master/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
9 verbose lifecycle airfoil-api@0.0.1~start: CWD: /home/pi/airfoil-api-master
10 silly lifecycle airfoil-api@0.0.1~start: Args: [ ‘-c’, ‘node app.js’ ]
11 silly lifecycle airfoil-api@0.0.1~start: Returned: code: 1 signal: null
12 info lifecycle airfoil-api@0.0.1~start: Failed to exec start script
13 verbose stack Error: airfoil-api@0.0.1 start: node app.js
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:189:13)
13 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:189:13)
13 verbose stack at maybeClose (internal/child_process.js:978:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
14 verbose pkgid airfoil-api@0.0.1
15 verbose cwd /home/pi/airfoil-api-master
16 verbose Linux 4.14.79-v7+
17 verbose argv “/usr/bin/node” “/usr/bin/npm” “run” “start”
18 verbose node v11.4.0
19 verbose npm v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error airfoil-api@0.0.1 start: node app.js
22 error Exit status 1
23 error Failed at the airfoil-api@0.0.1 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Any thoughts??

Thanks!!

Maybe try manually installing mdns and removing mdns from the requirements in .js, otherwise I don’t know

So I figured out that I can run the following AppleScript in the AppleScript editor to find out all the existing speakers on my network:

tell application “Airfoil”
get every speaker
end tell

The output for me is:

{ speaker id “com.rogueamoeba.airfoil.LocalSpeaker” of application “Airfoil”, speaker id “745E1C0ECF7E@VSX-822” of application “Airfoil”, speaker id “7056818529FC@Master-Bedroom” of application “Airfoil”, speaker id “A01828EA5AE6@Exercise Room” of application “Airfoil”, speaker id “0011245DFE43@Outside Deck” of application “Airfoil”, speaker id “001124000DD1@Lower Level” of application “Airfoil”, speaker id “00112462AD3D@Eve’s-Room” of application “Airfoil”, speaker id “1CE62BF23AEB@Theatre Room” of application “Airfoil”, speaker id “68A86D5E095A@MainLevel” of application “Airfoil”}

If you’re running just Airport Expresses as your speakers, you can get the ID from the Windows version of the AirportUtility (the Mac version didn’t seem to show this, although I didn’t poke around too much).

So is the ha-bridge controlling Aifoil, or is it controlling each speaker directly? If it’s controlling Airfoil, then the url which is loaded into ha-bridge would be IP address of the machine it’s running on and the port Airfoil listens to together with speaker id?

Or, is the url the IP address of the airport express base station (in my case), the port on that device and then the speaker ID?

It uses the Mac addresses and name you mentioned above to control each speaker through airfoil

Please help.
I followed your instructions to the letter and I get this error upon test-
Request Error, Please look in your habridge log: error {“type”:“6”,“address”:"/lights/110",“description”:“Error on calling url to change device state”,“method_name”:"/lights/110/state"}

Not sure that I installed the Airfoil API properly.
Does this look right?
Last login: Wed Dec 9 23:26:58 on ttys000

/Users/Fred\ 1/Downloads/airfoil-api-master-2/script/restart ; exit;

Freds-new-laptop:~ Fred2$ /Users/Fred\ 1/Downloads/airfoil-api-master-2/script/restart ; exit;

Uninstalling airfoil-api…

/Users/Fred 1/Library/LaunchAgents/org.airfoil-api.plist: No such file or directory

rm: /Users/Fred 1/Library/LaunchAgents/org.airfoil-api.plist: No such file or directory

Installing airfoil-api…

logout

Saving session…

…copying shared history…

…saving history…truncating history files…

…completed.

[Process completed]

Please help!

I haven’t had to edit it for years, there’s a command to pull up a list of your speakers in the airfoil-api instructions…if you can get the list up you’ve installed the app and it’s an issue with what you’ve put in the box on ha bridge, this should match the id of the speaker in the list from the api

Okay I am able to use speakers.scpt to get this result-
“false,0.608803749084,Computer,com.rogueamoeba.airfoil.LocalSpeaker|false,0.540143251419,kitchen counter MacBook Pro,kitchen counter MacBook Pro|true,0.259033203125,Hottub,54E43AE6D508@Hottub|false,0.085123695433,Living Room (3),0866988DFA6C@Living Room (3)|false,0.252941131592,Living Room,C8D083E047B0@Living Room|false,1.0,kitchen counter MacBook Pro,3C0754767A21@kitchen counter MacBook Pro”

I use the result to try to enter just the “hottub” speaker into the HA bridge.


And I still get the same error -
Request Error, Please look in your habridge log: error {“type”:“6”,“address”:"/lights/110",“description”:“Error on calling url to change device state”,“method_name”:"/lights/110/state"}

Ugh!!! Please help!
Thanks in advance.

Hi, is airfoil running? I don’t know why it says false? Also, replace spaces in the names of your speakers directly on the speakers/airports with underscores _ It doesn’t like spaces.

I’ll have a look when I get home to see what mine looks like now

Yes-Airfoil is running and I purposely used the Hottub speaker for testing as it doesn’t have any spaces.

Ok, so in my boxes I have now only got things in target

http://localhost:8084/speakers/-whatever_speaker_id_is@name/connect

Same for /disconnect

And in dim for /volume

Not selected anything else for anything except dim put ${intensity.percent} in http body and choose content type text/plain

Haven’t chosen type or ANYTHING else, I may have in the past but jar has updated and moved things around - this is what I have now