Alexa control of Airfoil

Posted on
Sun Dec 11, 2016 3:29 am
Benwin offline
Posts: 8
Joined: Jan 21, 2013

Alexa control of Airfoil

Is it possible to add AirFoil speakers to the Alexa-Hue Bridge so we can turn them on and off and set the volume using the "Alexa set <Bedroom Speakers> to 75%" command?

Posted on
Sun Dec 11, 2016 6:12 am
marketability offline
User avatar
Posts: 198
Joined: Dec 08, 2015
Location: UK

Re: Alexa control of Airfoil

I had some success trying that by creating a virtual on/off device with the relevant action groups
I had some issues with Indigo updating speaker status but the echo/alexa bit worked fine

Posted on
Mon Dec 12, 2016 11:12 am
jay (support) offline
Site Admin
User avatar
Posts: 18185
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Alexa control of Airfoil

Benwin wrote:
Is it possible to add AirFoil speakers to the Alexa-Hue Bridge so we can turn them on and off and set the volume using the "Alexa set <Bedroom Speakers> to 75%" command?


Speakers aren't dimmer devices, which is what Alexa is expecting when you say 75%. Virtual On/Off devices are just that - on/off (relay) so they don't support dimming either (though you should be able to connect/disconnect them using one). It would be possible, but only if there were a virtual dimmer device which could then map brightness onto volume. I don't recall there being a 3rd party plugin that could do something like that.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Dec 12, 2016 12:42 pm
FlyingDiver offline
User avatar
Posts: 7184
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Alexa control of Airfoil

jay (support) wrote:
It would be possible, but only if there were a virtual dimmer device which could then map brightness onto volume. I don't recall there being a 3rd party plugin that could do something like that.


I could probably be convinced to add that to the Masquerade plugin. I guess I'd have to get Airfoil running for that to happen.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Mon Dec 12, 2016 1:01 pm
jay (support) offline
Site Admin
User avatar
Posts: 18185
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Alexa control of Airfoil

Virtual Dimmer devices are - tricky. Once you start thinking about the issues around them, it quickly gets a bit overwhelming. It's on our todo list for the Virtual Devices Interface but hasn't quite gotten enough demand.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Dec 13, 2016 12:00 pm
FlyingDiver offline
User avatar
Posts: 7184
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Alexa control of Airfoil

This should enable you to control Airfoil Pro speaker volume from Alexa:

viewtopic.php?f=216&t=17402&p=130515#p130515

It does On/Off, but only by setting the volume to 0 or 100, which is probably not the right approach. I need to look into that a little more.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Mar 23, 2017 1:06 pm
bkmar1192 offline
Posts: 274
Joined: Sep 12, 2015

Re: Alexa control of Airfoil

I am using the Meta Device plugin to control my AirFoil speakers. I have set them up as meta dimmer devices. I can turn them on/off and say "Alexa, set main speaker to 70%".

Works like a charm!


Sent from my iPhone using Tapatalk

Posted on
Sat Mar 25, 2017 1:22 am
bkmar1192 offline
Posts: 274
Joined: Sep 12, 2015

Re: Alexa control of Airfoil

bkmar1192 wrote:
I am using the Meta Device plugin to control my AirFoil speakers. I have set them up as meta dimmer devices. I can turn them on/off and say "Alexa, set main speaker to 70%".

Works like a charm!


Sent from my iPhone using Tapatalk



BTW - Meta device can be found here: viewtopic.php?t=7980

And my speaker actions are:

Speaker Volume:

Code: Select all
theVolume = int(indigo.devices[**ID of Meta Device**].states['brightnessLevel'])+1

airfoilPlugin = indigo.server.getPlugin("com.perceptiveautomation.indigoplugin.airfoilpro")
if airfoilPlugin.isEnabled():
    try:
        result = airfoilPlugin.executeAction('setVolume', deviceId=**ID of Airfoil Speaker**, props={'volume': theVolume}, waitUntilDone=True)
    except Exception, e:
        print "Exception occurred: %s" % unicode(e)


Speaker On:

Code: Select all
indigo.dimmer.setBrightness(**ID of Meta Device**, value=20)
theVolume = int(indigo.devices[**ID of the Meta Device**].states['brightnessLevel'])+1

airfoilPlugin = indigo.server.getPlugin("com.perceptiveautomation.indigoplugin.airfoilpro")
if airfoilPlugin.isEnabled():
   try:
      result2 = airfoilPlugin.executeAction("connect", deviceId=**ID of Speaker**, waitUntilDone=True)  # ID of Speaker device
      result = airfoilPlugin.executeAction('setVolume', deviceId=**ID of Speaker**, props={'volume': theVolume}, waitUntilDone=True)
   except Exception, e:
      print "Exception occurred: %s" % unicode(e)


Speaker Off:

Code: Select all
airfoilPlugin = indigo.server.getPlugin("com.perceptiveautomation.indigoplugin.airfoilpro")
if airfoilPlugin.isEnabled():
    try:
        result = airfoilPlugin.executeAction("disconnect", deviceId=**ID of Speaker**, waitUntilDone=True)  # ID of Speaker device
    except Exception, e:
        print "Exception occurred: %s" % unicode(e)

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests