home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.11k stars 29.79k forks source link

Unifi integration - Failed to remove device entry, rejected by integration #117918

Closed axi92 closed 2 months ago

axi92 commented 3 months ago

The problem

I want to remove some devices because they got auto-discovered. When I click the "delete" button I can see an error in the web console

Uncaught (in promise) 
Object { code: "home_assistant_error", message: "Failed to remove device entry, rejected by integration" }
85810.KOFQKhuoNdo.js:20:27565
    action http://192.168.0.10:8123/frontend_latest/85810.KOFQKhuoNdo.js:20
    AsyncFunctionThrow self-hosted:856
    (Async: async)
    value http://192.168.0.10:8123/frontend_latest/85810.KOFQKhuoNdo.js:20
    handleEvent http://192.168.0.10:8123/frontend_latest/app.o3bCeFDd3rk.js:2
    (Async: EventListener.handleEvent)
    _$AI http://192.168.0.10:8123/frontend_latest/app.o3bCeFDd3rk.js:2
    v http://192.168.0.10:8123/frontend_latest/app.o3bCeFDd3rk.js:2
    g http://192.168.0.10:8123/frontend_latest/app.o3bCeFDd3rk.js:2
    _$AI http://192.168.0.10:8123/frontend_latest/app.o3bCeFDd3rk.js:2
    T http://192.168.0.10:8123/frontend_latest/app.o3bCeFDd3rk.js:2
    _$AI http://192.168.0.10:8123/frontend_latest/app.o3bCeFDd3rk.js:2
    v http://192.168.0.10:8123/frontend_latest/app.o3bCeFDd3rk.js:2
    g http://192.168.0.10:8123/frontend_latest/app.o3bCeFDd3rk.js:2
    _$AI http://192.168.0.10:8123/frontend_latest/app.o3bCeFDd3rk.js:2
    v http://192.168.0.10:8123/frontend_latest/app.o3bCeFDd3rk.js:2
    g http://192.168.0.10:8123/frontend_latest/app.o3bCeFDd3rk.js:2
    _$AI http://192.168.0.10:8123/frontend_latest/app.o3bCeFDd3rk.js:2
    v http://192.168.0.10:8123/frontend_latest/app.o3bCeFDd3rk.js:2
    g http://192.168.0.10:8123/frontend_latest/app.o3bCeFDd3rk.js:2
    _$AI http://192.168.0.10:8123/frontend_latest/app.o3bCeFDd3rk.js:2
    z http://192.168.0.10:8123/frontend_latest/app.o3bCeFDd3rk.js:2
    update http://192.168.0.10:8123/frontend_latest/app.o3bCeFDd3rk.js:2
    performUpdate http://192.168.0.10:8123/frontend_latest/app.o3bCeFDd3rk.js:2
    scheduleUpdate http://192.168.0.10:8123/frontend_latest/app.o3bCeFDd3rk.js:2
    _$Ej http://192.168.0.10:8123/frontend_latest/app.o3bCeFDd3rk.js:2
    AsyncFunctionNext self-hosted:852
    (Async: async)
    requestUpdate http://192.168.0.10:8123/frontend_latest/app.o3bCeFDd3rk.js:2
    set http://192.168.0.10:8123/frontend_latest/app.o3bCeFDd3rk.js:2
    value http://192.168.0.10:8123/frontend_latest/85810.KOFQKhuoNdo.js:20
    InterpretGeneratorResume self-hosted:1465
    AsyncFunctionNext self-hosted:852
    (Async: async)
    value http://192.168.0.10:8123/frontend_latest/85810.KOFQKhuoNdo.js:20
    performUpdate http://192.168.0.10:8123/frontend_latest/app.o3bCeFDd3rk.js:2
    scheduleUpdate http://192.168.0.10:8123/frontend_latest/app.o3bCeFDd3rk.js:2
    _$Ej http://192.168.0.10:8123/frontend_latest/app.o3bCeFDd3rk.js:2

The websocket connection shows following:

REQ:

{
    "type": "config/device_registry/remove_config_entry",
    "device_id": "f515493c2eb7c7690c8b48a5df7ee4cf",
    "config_entry_id": "5cfb6bb12f95f5408548551b22f701be",
    "id": 47
}

RES:

{
    "id": 47,
    "type": "result",
    "success": false,
    "error": {
        "code": "home_assistant_error",
        "message": "Failed to remove device entry, rejected by integration"
    }
}

What version of Home Assistant Core has the issue?

core-2024.5.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

unifi

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-05-22 11:33:37.967 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140347674838848] Error handling message: Failed to remove device entry, rejected by integration (home_assistant_error) axi92 from 192.168.0.178 (Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0)

Additional information

No response

home-assistant[bot] commented 3 months ago

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

Code owner commands Code owners of `unifi` 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 unifi` 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)


unifi documentation unifi source (message by IssueLinks)

Kane610 commented 3 months ago

You can only delete them if they are not known by unifi self. Is it a client or unifi device you want to delete?

axi92 commented 3 months ago

Yes it is a wlan client.

fft1010 commented 3 months ago

Hi, I have unify as well, and as I have a similar problem with ESPSomfy (was auto discovered twice, but one could not be removed any more), I think it is a problem somewhere else. But I have zero clue, but maybe this helps as a hint. The autodiscovered device (twice) was not a problem before core 2024.4.4 (including), but with 2024.5.3 I saw warnings, that this "ESPSomfy" tried to add every entity twice. Turned out, the auto discovery added the device twice.

thanks Juergen

wittypluck commented 2 months ago

Hello, for Unifi you can only remove inactive clients or devices. An inactive client or device is one for which HA has not received any update at all since the start of HA or the reload of Unifi integration. If you are trying to remove an active device or client, this is not possible (by design, and I believe this is the general logic of HA), so you can close this issue.

Kane610 commented 2 months ago

The way you should solve this is by disabling automatic tracking of clients and only select the ones you want in by configuring the integration

FreakyBigFoot commented 2 months ago

I'm having this same issue but with Zwave.

I just get the following in my console:

Uncaught (in promise) Object { code: "home_assistant_error", message: "Failed to remove device entry, rejected by integration" }

Kane610 commented 2 months ago

I'm having this same issue but with Zwave.

I just get the following in my console:

Uncaught (in promise) Object { code: "home_assistant_error", message: "Failed to remove device entry, rejected by integration" }

One integration one issue. Open one for zwave