core icon indicating copy to clipboard operation
core copied to clipboard

Emby Integration creates duplicate entities that can't be removed

Open Ryderjj89 opened this issue 10 months ago • 17 comments

The problem

I was looking through my services and noticed that Emby had something like almost 1600 entities. I went in and took a look and there were over a thousand "emby_jellyseerr" entities that can't be removed because they are "in use" and can only be disabled.

I also noticed in the HA log mentions about the integration "misbehaving".

2025-04-27 20:12:30.876 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [132685980552352] Joshua from 47.204.131.240 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36 Edg/135.0.0.0): Client unable to keep up with pending messages. Reached 4096 pending messages. The system's load is too high or an integration is misbehaving; Last message was: b'{"type":"event","event":{"r":["media_player.emby_jellyseerr_2748"]},"id":47}'

What version of Home Assistant Core has the issue?

core-2025.4.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

emby

Link to integration documentation on our website

https://www.home-assistant.io/integrations/emby

Diagnostics information

No response

Example YAML snippet


Anything in the logs that might be useful for us?


Additional information

The docs don't mention anything about how to exclude entities or prevent duplicates.

Image

Ryderjj89 avatar Apr 28 '25 12:04 Ryderjj89

Hey there @mezz64, mind taking a look at this issue as it has been labeled with an integration (emby) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of emby can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign emby Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


emby documentation emby source (message by IssueLinks)

home-assistant[bot] avatar Apr 28 '25 12:04 home-assistant[bot]

having the same issue

rspedding888 avatar May 19 '25 20:05 rspedding888

@frenck Can we get some eyes on this please? The developer of this integration has not responded. Is this still supported?

Ryderjj89 avatar May 31 '25 15:05 Ryderjj89

This is largely an issue with Jellyseer creating duplicate entries rather than reusing the same one. I don't use Jellyseer and only see real devices in ha. There isn't currently a mechanism to exclude certain entities and likely won't be unless someone wants to take the time to convert this integration to web UI setup. Unfortunately I don't have the time to do that these days, but will happily accept any pull requests needed on the pyemby repository to make it happen.

You can manually delete them from the core config file if needed

mezz64 avatar May 31 '25 18:05 mezz64

Thanks @mezz64. Talking to the Jellyseerr team, looks like this was something they found was happening from it. This PR goes over the fix they're implementing. So we should be good. Just have to wait for their next release.

https://github.com/fallenbagel/jellyseerr/pull/1651

Ryderjj89 avatar May 31 '25 18:05 Ryderjj89

They release the fix @Ryderjj89 linked, but I'm still having 14k not_provided entities in Home Assistant. I'm gonna remove the whole integration.

dadino avatar Jun 11 '25 08:06 dadino

Yeah I noticed the same thing. The entities are not gone. I can't even delete them from the core entity registry because they all just come back.

Ryderjj89 avatar Jun 11 '25 12:06 Ryderjj89

I used Spook orphan entities removal action and it worked, after removing the emby integration. It also removed tons of other entities, some which I didn't expect would be removed (fixing it now).

dadino avatar Jun 11 '25 12:06 dadino

Oh nice! They didn't come back when you re-added the integration?

Ryderjj89 avatar Jun 11 '25 12:06 Ryderjj89

I didn't re-add the integration.

dadino avatar Jun 11 '25 13:06 dadino

Ah. Yep they still come back, even after removing them with Spook. @mezz64 looks like this issue might be something more than just Jellyseerr possibly. Looping in @fallenbagel so maybe we can figure this out. I don't want to stop using Jelly but having 1600 entities is crazy.

Ryderjj89 avatar Jun 11 '25 13:06 Ryderjj89

same issue here, any solution yet, without removing the integration?

J0n4e avatar Jun 11 '25 19:06 J0n4e

When you look at your devices list in emby do you see the Jellyseer entries? If they are coming back after removing and re-adding the integration that's telling me they still exist in emby since all the integration does is query the emby device list to know what to add to home assistant.

mezz64 avatar Jun 11 '25 20:06 mezz64

When I look at Emby vs HA, the number is not even close. Here's some screenshots of the counts. It's 125 vs 1776.

This first one is from Emby:

Image

This one is from Home Assistant filtered down to just the Jellyseerr entities:

Image

Here's a confirmation when trying to delete them that they are still being provided by the integration and can't be removed.

Image

Ryderjj89 avatar Jun 11 '25 21:06 Ryderjj89

I'm a 25 devices in Emby, but had 14000 media_players in HA before removing the integration.

dadino avatar Jun 12 '25 08:06 dadino

https://github.com/fallenbagel/jellyseerr/pull/1710

This should fix this issue

fallenbagel avatar Jun 12 '25 21:06 fallenbagel

Looks like that did work. I changed to the Jellyseerr develop branch and then restarted everything. All the duplicate entities disappeared.

Ryderjj89 avatar Jun 15 '25 23:06 Ryderjj89

Looks like that did work. I changed to the Jellyseerr develop branch and then restarted everything. All the duplicate entities disappeared.

i did the same, nothing changed for me, i just wait now to see if the number increases

J0n4e avatar Jun 19 '25 13:06 J0n4e

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.