Getting device icons to work with Airfoil source

Discuss the Airfoil Pro plugin.
User avatar
Different Computers
Posts: 2600
Joined: Sat Jan 02, 2016 10:07 am
Location: East Coast
Contact:

Getting device icons to work with Airfoil source

Post by Different Computers »

I've messed about with the control page device control icons "iTunesStatus_large+.png" et al, and I can't get them to follow Airfoil's device states. I've tried using "Source status is playing (True or false) and added "iTunesStatus_large+true.png" and "iTunesStatus_large+false.png" but that doesn't work. I've also tried using AirFoil's "Current Source Status" for the icon state and that doesn't work either.

How do you make this work on your control pages?
Sonoma on a Mac Mini M1 running Airfoil Pro, Bond Home, Camect, Roku Network Remote, Hue Lights, DomoPad, Adapters, Home Assistant Agent, HomeKitLinkSiri, EPS Smart Dimmer, Fantastic Weather, Nanoleaf, LED Simple Effects, Grafana. UnifiAP
User avatar
jay (support)
Site Admin
Posts: 18339
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Getting device icons to work with Airfoil source

Post by jay (support) »

It works when you select the Current Source Status. However, the Airfoil API doesn't provide the play status of the source, so the only way to get it is to specify an iTunes device (in your Airfoil device instance's config) from which Airfoil will get the play status. Since the iTunes plugin no longer works, then the play state will never get updated, so all you will ever see is the grayed out play button (which is what shows when the status is 'unavailable'.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
User avatar
Different Computers
Posts: 2600
Joined: Sat Jan 02, 2016 10:07 am
Location: East Coast
Contact:

Re: Getting device icons to work with Airfoil source

Post by Different Computers »

Ah well. thanks Jay.
Sonoma on a Mac Mini M1 running Airfoil Pro, Bond Home, Camect, Roku Network Remote, Hue Lights, DomoPad, Adapters, Home Assistant Agent, HomeKitLinkSiri, EPS Smart Dimmer, Fantastic Weather, Nanoleaf, LED Simple Effects, Grafana. UnifiAP
User avatar
Different Computers
Posts: 2600
Joined: Sat Jan 02, 2016 10:07 am
Location: East Coast
Contact:

Re: Getting device icons to work with Airfoil source

Post by Different Computers »

Revisiting this after removing AirFoil from the mix (because for some reason I can't get AirFoil to be reliable on my network, but AirPlay is) and I found a way to put Apple Music's status into an Indigo Variable--something I'd struggled with since the iTunes Server was deprecated.

Code: Select all

import objc
from Foundation import NSAppleScript

# Define an AppleScript to retrieve the playback state
script_source = """
tell application "Music"
	set playback_state to the player state as string
end tell
return playback_state
"""

# Compile the AppleScript
script = NSAppleScript.alloc().initWithSource_(script_source)

# Execute the AppleScript and retrieve the result
result, error = script.executeAndReturnError_(None)
if error:
    indigo.server.log("Error:", error.localizedDescription())
else:
    playback_state = result.stringValue()
    if playback_state == "paused":
        indigo.variable.updateValue("Apple Music Status", "Paused")
    else:
        indigo.variable.updateValue("Apple Music Status", "Playing")
Sonoma on a Mac Mini M1 running Airfoil Pro, Bond Home, Camect, Roku Network Remote, Hue Lights, DomoPad, Adapters, Home Assistant Agent, HomeKitLinkSiri, EPS Smart Dimmer, Fantastic Weather, Nanoleaf, LED Simple Effects, Grafana. UnifiAP
t-star
Posts: 127
Joined: Fri Oct 26, 2007 9:56 pm

Re: Getting device icons to work with Airfoil source

Post by t-star »

how are you connecting to the speakers via airplay?
Airfoil is flakey on my network now as well. I think that it has to do with being on a mesh network.
User avatar
durosity
Posts: 4381
Joined: Thu May 10, 2012 3:21 pm
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Getting device icons to work with Airfoil source

Post by durosity »

t-star wrote:how are you connecting to the speakers via airplay?
Airfoil is flakey on my network now as well. I think that it has to do with being on a mesh network.
I’ve never had much luck with mesh networks. They’ve always just been flakey for me. The only exception has been unifi, but naturally that’s pretty expensive. What make are you using and is there no possibility of wiring in a couple of good APs?


Sent from my iPhone using Tapatalk Pro
Computer says no.
t-star
Posts: 127
Joined: Fri Oct 26, 2007 9:56 pm

Re: Getting device icons to work with Airfoil source

Post by t-star »

I have gone from one solution to another. Can’t remember the old one but using Linksys Velop now. There are lots of articles on line about AirPlay not working well on mesh. I see it when I try to add a speaker to something that is already playing and they are most likely connected to different points.
Hoping to do some hard wire points but it is an older home and not as easy.
Post Reply

Return to “Airfoil Pro”