zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

Remove Device not working

Open 3DIRK opened this issue 7 years ago • 7 comments

Bug Report

What happened

IKEA Tradfri Light is not reachable anymore, so I tried to remove the light from the network. Removing throws an error. (And "force remove" did not start either.)

What did you expect to happen

Device shall be remove

How to reproduce it (minimal and precise)

Issue command to remove device

Logfile: https://pastebin.com/t3hHEUPx

Debug Info

zigbee2mqtt version: latest-dev CC253X firmware version: latest non routing

3DIRK avatar Sep 24 '19 14:09 3DIRK

I noticed that force remove doesn't happen. Remove, device doesn't respond, nothing happens

sjorge avatar Sep 24 '19 20:09 sjorge

'Force remove' has been removed as it was giving false expectations.

Note that the coordinator/zigbee2mqtt cannot remove a device, it can only request a device to remove itself from the network (this is how removing in zigbee works). If the device doesn't remove itself; it just cannot be removed from the network.

In pre zigbee2mqtt 1.6 dev, when this happend we 'force removed' it; which basically did nothing more than removing the entry from database.db. However the device itself was still in the network therefore this behaviour has been removed.

Koenkk avatar Sep 25 '19 23:09 Koenkk

Thanks for the reply, @Koenkk

There is no need anymore to remove the device from database in case of an unsucessful removal? Don't we get a bunch of stale devices in the database?

3DIRK avatar Sep 26 '19 10:09 3DIRK

In case of an unsuccessful removal the device is not removed from the network thus it shouldnt be removed from the db.

Note that somes devices also remove itself from the network when you factory reset them. In this case they will send an event and zigbee-herdsman will remove them from the database.

Koenkk avatar Sep 26 '19 10:09 Koenkk

On 2019-09-26 12:36, Koen Kanters wrote:

In case of an unsuccessful removal the device is not removed from the network thus it shouldnt be removed from the db.

Note that somes devices also remove itself from the network when you factory reset them. In this case they will send an event and zigbee-herdsman will remove them from the database.

-- You are receiving this because you commented. Reply to this email directly, view it on GitHub [1], or mute the thread [2].

There do seem to be some edge cases, say the DB is corrupt and you need to repair everything...

Some device then automatically show up in the db in a incomplete state, resulting in an incomplete DB. They device then seem unable to succesfully be repaired because they are in the db but not really. So the only way to solve that is to change the id and channel of hte netwerk.

(That is how I fixed my corrupt db, which was a pain. Force remove + repair used to work more or less, I first tried blacklisting but then they obviously cant be repaired at all.)

-- ~ sjorge

Links:

[1] https://github.com/Koenkk/zigbee2mqtt/issues/2029?email_source=notifications&email_token=AAC4WEJJ5WKX4W6XLVTF5Z3QLSGCHA5CNFSM4I2AQBZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7VDYZI#issuecomment-535444581 [2] https://github.com/notifications/unsubscribe-auth/AAC4WEKAQPLTJ7F6YTSNSUTQLSGCHANCNFSM4I2AQBZQ

sjorge avatar Sep 26 '19 10:09 sjorge

@sjorge I think with zigbee-herdsman (zigbee2mqtt dev branch) the database won't get corrupt anymore (the whole database thing has been simplified and we are not using nedb anymore).

In case you want start from scratch, just change the pan_id and zigbee-herdsman will automatically cleanup the db.

Koenkk avatar Sep 27 '19 12:09 Koenkk

Quick question - am having various problems pairing new devices. I reflashed my CC2531 and suddenly an IKEA blind which I'd unsuccessfully tried to pair about 8 months earlier appeared. Never seen it before in Zigbee2MQTT. It says the interview is not complete, though, and the device has an exclamation mark and does not work. It's also showing as unsupported. I can't remove it nor do anything with it really. I'm guessing this device still counts as part of my limit of 15 direct children?

26tajeen avatar Dec 27 '20 11:12 26tajeen