Getting device icons to work with Airfoil source

Posted on
Fri Sep 16, 2022 10:16 am
Different Computers offline
User avatar
Posts: 2541
Joined: Jan 02, 2016
Location: East Coast

Getting device icons to work with Airfoil source

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?

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Mon Sep 19, 2022 10:38 am
jay (support) offline
Site Admin
User avatar
Posts: 18216
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Getting device icons to work with Airfoil source

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

Posted on
Mon Sep 19, 2022 12:56 pm
Different Computers offline
User avatar
Posts: 2541
Joined: Jan 02, 2016
Location: East Coast

Re: Getting device icons to work with Airfoil source

Ah well. thanks Jay.

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Mon Mar 20, 2023 5:55 pm
Different Computers offline
User avatar
Posts: 2541
Joined: Jan 02, 2016
Location: East Coast

Re: Getting device icons to work with Airfoil source

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")

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests