Advice Pls: ATV differentiation of Plex/Infuse and other streaming apps

Hi folks,
I’m after some advice before I embark on my next automation if I may.
My setup:
Denon AVR - integrated into HA
AppleTV 3rd and 4th gen
Netflix and other streaming apps installed
Plex Server (I use both Infuse and Plex Apps on the ATV)

I currently control my lights via the Hue Plugin in Plex - works a treat across both Infuse and Plex native app.
I use the Denon and smart switches (with power monitoring) to control other functions around the room say for xbox, nintendo switch and so on via the discrete Denon Inputs (and power consumption of those consoles).

However when we watch Netflix I currently don’t have a way to control lights as the Denon is simply set to AppleTV input. The same AppleTV input could be playing Plex content, any of the catch-up services, Netflix, Hulu, etc. So no elegant way to determine what is happening.

My question (finally):
What information can I get from the AppleTV once it’s integrated into HA?
Is it simply playing, not_playing and the like?
If so, I could create an automation with not-conditions to avoid overlaps with Plex and other automations?
Does it tell you via attributes (for example) what it’s playing, via which app and so on?

Thanks so much!

1 Like

If you use my custom component (which is supposed to replace my old integration that is part of home Assistant today), you will get basic metadata like title or artist. For devices running tvOS (ATV 4 and later) you will also get which app is currently playing something.

And the link:

You’re awesome!
I’ll dig in and explore.

Thanks so much.

Hi again,
I’m not that familiar with the CLI of HA.
I’m running HA in a (Linux) docker and I can’t seem to run the install per your guide here:
https://pyatv.dev/documentation/#installing-pyatv
pip / pip3 or python commands aren’t recognised.
Or does the install via HAC do this for me already?
I’m unsure how to do a scan for my ATV’s to gather the ID’s PINs to pair, etc…

Sorry for the silly questions (perhaps).
I’d be happy to write some install guides if that would help as I’m coming from a very small base of understanding…

I’ve installed system-wide (probably shouldn’t have):
python3-pip

sudo apt-get install build-essential libssl-dev libffi-dev python-dev
pip3 install pyatv

But no other dependencies, this is clearly a problem as I’m not able to scan as I got a traceback…

This may be beyond my limited capability in this space given the stage of this development…
?

right - you’ve done all the hard already!
I can see I simply had to head to the integrations page in ‘configuration’!
you’re amazing.
I’ve added one of my ATV’s. Let’s see what I can see.
Am I able to uninstall the packages I installed system wide? will that break anything?
I regret doing it…

You beat me to it. You can uninstall all the packages you installed, they are already installed in the container. The rest you already figured out is handled by the config flow :blush:

1 Like

Mindful of your time…
Should the integration continue to operate and report the media playing after the device goes into standby? Mine hasn’t, not sure if this normal or not…
Should I simply continue to trawl through https://github.com/postlund/pyatv/issues?
Cheers,

Yeah, there are various issues regarding this. I prefer if all issues go to the pyatv issue tracker as I monitor that more closely than this forum.

1 Like