Remove duplicate Apple TV

You did remove both discovery and the plex config?

OK removed both discovery and the plex config and it only saw the original media_player.apple_tv!

Re-enabled the plex config and for some reason they have swapped round now. So media_player.apple_tv is now the new one with the richer data. No idea why. But this is good :slight_smile:

Thinking about it, I think the other one is being created by my device tracker UniFi component. Not sure how to stop that seeing the Apple TV though.

When you say “original” media_player.apple_tv, which do you mean then? I assumed that you didn’t have plex nor discovery enabled, so it would be the apple_tv platform?

Yes, it was just the old media_player.apple_tv showing. Not the new one.

I now have two entries again

media_player.apple_tv
media_player.apple_tv_2

But the first one is now the new platform, the second is the old one. So my automations work with the new platform and richer data. Which is good :slight_smile: I now want to stop media_player.apple_tv_2 being discovered. I think that is my UniFi device tracker. My Apple TV connects via WiFi and UniFi just sees it and HA creates a record for it.

Ok, that seems a bit strange to me that UniFi would do that. I could understand if it discovered it as a device and created device_tracker.apple_tv. Can you try to disable plex, discovery and apple_tv and see if it still is there? We should probably single out the source.

OK disabled discovery, plex and apple_tv, both media_player entries have gone.

The solution I offered was simply to allow you to differentiate between the two so you knew which one to display. You didn’t mention about wanting to remove it from dev states. As long the name is different so that you now know which one to include in automation, I don’t really see the problem because as long as you don’t include it in a group or view, you’ll never see it.

This is likely due to some discovery and is a topic we’re discussing in this thread that you might be interested in:

If you add only discovery, do you get two devices? If they are connected both with wire and wifi, you probably should.

Thanks @rpitera. I understand, trying to get to the bottom of why I get two entries. As you say it will be down to discovery I’m sure.

@postlund, now enabled discovery only and I now have the old platform media_player.apple_tv. Nothing else.

1 Like

I’m having similar issues because I am testing new components for devs for stuff that will be coming up in the next release. Since some of them are either improvements on existing platforms or in the case of Ring doorbells, taking a device supported in one platform and supporting it directly, I run into the issue of trying to figure out which sensor/device is the released version and which one is the test.

entity_namespace has been a big help in this. Discovery on the other hand has not, as I am sure you know… LOL

Ok, that’s good. Can you try to look for media_player.apple_tv in your log file (grep media_player.apple_tv home-assistant.log)?

Oh and heads up - there’s a PR in for adding ignore: to discovery!!! Literally just happened.

https://github.com/home-assistant/home-assistant/pull/6048

Thanks @postlund!

Nothing in the log.

So you see it in the web interface but not in the log? If you search for just apple_tv?

I only had errors being logged. Will turn that off. Sorry…

Yes, I can see it now. Lots of entries, but apple_tv_2 has appeared again. Man this is so confusing.

Do you use plex on the Apple TV?

If so won’t plex just be creating the other media.player.appletv?

If you can set up entity namespace for all your media_player configs then I think this mystery media player might get renamed…

media_player.plex_appletv

(Apologies if this is what you tried already, I am getting a cold so head is feeling a bit fuggy at the moment!)

OK added a entity_namepsace to the manually specified Apple_TV in media_players.yaml and I have identified this in fact creates the old style attributes. The auto discovered platform in fact is showing the new style attributes!

I am not sure what is going on but that is looking very different to what I got earlier.

I think I need to reset all this and try again.

I am a bit confused, and perhaps don’t understand what exactly is the issue, but have you applied entity namespace to all your media players, not just Apple TV?

For example until I set up entity namespace my nvidia shield tv was discovered as a player by both plex & chromecast so created 2 media players…

media_player.shield
media_player.shield1

It wasn’t until I set entity namespace that I could get them to differentiate as…

media_player.plex_shield
media_player.cast_shield

I assumed that what you are seeing is the same, that the Apple TV & plex are both creating a player. The plex one will automatically use the device name, which I guess just happens to be “appletv”

I might be completely wrong though!!!

Sorry for causing confusion!

I have added a unique namespace to the apple_tv in media_players.yaml and restarted HA. This unique namespace is the only listed apple entity when first turned on.

Now I run BBC iPlayer on my Apple TV and that is detected OK and all the attributes are populated OK. Nothing else appears.

Now I run Plex on the Apple TV and immediately another entity appears media_player.apple_tv alongside the existing unique one above. So it seems when running plex it does create another entity. Both now remain permanently until I restart HA and then reverts to only having only the unique one from above until I start Plex again.

Yes, so it is plex creating the other media player - it is not a duplicate, it is a separate thing. One media player is created by the appletv platform & one by the plex platform.

So if you assign entity namespace to plex as well it would now be called…

media_player.plex_appletv

If you were to install Kodi on your appletv, and then add the kodi platform to home assistant you’d probably get another one called…

media_player.appletv_3