Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
11.97k stars 1.67k forks source link

Devices are disappearing from Device list. #15299

Closed erzhan89 closed 1 year ago

erzhan89 commented 1 year ago

What happened?

Devices 4 pc. (RTV https://www.zigbee2mqtt.io/devices/GS361A-H04.html ) disappearing from Device list. after 15-20 minutes. Before they worked without issues.

What did you expect to happen?

To have stable connection.

How to reproduce it (minimal and precise)

No response

Zigbee2MQTT version

1.28.4

Adapter firmware version

6.10.3.0 build 297

Adapter

ITead Sonoff Zigbee 3.0 USB Dongle Plus V2 model "ZBDongle-E"

Debug log

No response

Koenkk commented 1 year ago

Can you check the following:

vignez2991 commented 1 year ago
  1. restart z2m --> Yes, All devices exist.

  2. restart power --> No, The File was empty

Koenkk commented 1 year ago

And what in case of:

vignez2991 commented 1 year ago
  • Start z2m --> Yes, All devices exist.
  • Stop z2m --> Yes, All devices exist.
  • Power restart --> Yes, All devices exist (Disabled Auto start z2m and restarted 5 times)
Koenkk commented 1 year ago

Interesting, so that goes well.

In the scenario:

  1. start z2m
  2. restart power
  3. stat z2m

Can you provide the herdsman debug logging of both 1 and 3?

See https://www.zigbee2mqtt.io/guide/usage/debug.html on how to enable the herdsman debug logging. Note that this is only logged to STDOUT and not to log files.

vignez2991 commented 1 year ago

Interesting, so that goes well.

In the scenario:

  1. start z2m
  2. restart power
  3. stat z2m

Can you provide the herdsman debug logging of both 1 and 3?

See https://www.zigbee2mqtt.io/guide/usage/debug.html on how to enable the herdsman debug logging. Note that this is only logged to STDOUT and not to log files.

I have attached log file for both the cases after_power_restart.log before_power_restart.log

1 - File name before_power_restart.log 3 - File name after_power_restart.log

riversideneyon commented 1 year ago

I have same issue since couple weeks. Always specific 1 device disappearing after some time. It's also the most recent added device since couple weeks.

Device is philips hue motion sensor. Stick is zigstar V4 if I'm not mistaken.

I can enable debug but will that not be to big file since it happens after couple days, i can try reboot since it can be related to it.

Koenkk commented 1 year ago

@vignez2991 at point 3, it seems the database is indeed gone, I don't see anything about z2m clearing it. Between step 1 and 2, is the data/database.db filled with the paired devices?

vignez2991 commented 1 year ago

Step 1 - data/database.db contains paired devices Step 2 - data/database.db file is empty.

In Linux sometimes the file gets truncated While doing a power restart when the file is opened with write mode (Or opened by any process). This could be the reason for the database.db file getting empty.

Koenkk commented 1 year ago

@vignez2991 z2m only writes/open the database occasionally, the chance that every time your power restart z2m is doing a write on the database (which should take a very short amount of time) is astronomically low.

vignez2991 commented 1 year ago

Yes But, When i stopped z2m and tried power restart several times database file contains actual data. The database file gets empty only when i do power restart after running z2m service

Grazulex commented 1 year ago

Hello, do we have a fixed, I have the same issue under Jeedom and Zigbee2mqtt v.1.30.0 Version PHP installée : 7.3.31-1~deb10u2. my controler is a "Zigbee 3.0 USB Dongle Plus Gateway Con Antena, EFR32MG21 + CH9102F Coordinator EFR32MG21" and it's always the 3 sames devices (Aqara E1) that are disappearing after a reboot.......If I can help to find a quick fixed, let me know :-(

Do I need to make a downgrade to 1.28.2 to fixed this ussue the time to you find a solution ? it's my heating devices that disappear and it's very annoying :-(

FYI, I took responsibility to install the Dev version to test.... one thing I can already tell you is that pairing is much more stable and faster since I've been on Dev :-) So I'm waiting to see if this version will be more stable....and fixed this issue to.

Wattrider commented 1 year ago

Hi,

same for me

Virtual machine Home Assistant 2023.1.7 Sonoff Zigbee 3.0 V2 dongle (ezsp) Zigbee2mqtt version 1.30.0-1

I have 20 zigbee devices (most sonoff and moes) and 3 are disapearing during the night for example.

If i can help please tell

Jonybat commented 1 year ago

I just noticed this happening in my setup as well. They come back after restarting z2m (which by itself takes a few tries, gets stuck on starting zigbee-herdsman and 502, but that is probably another problem), and go away after a few minutes, without any interaction.

Zigbee2MQTT:info  2023-02-10 11:15:41: Zigbee2MQTT started!
Zigbee2MQTT:warn  2023-02-10 11:23:38: Device 'Bedroom switch' left the network
Zigbee2MQTT:info  2023-02-10 11:23:38: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"Bedroom switch","ieee_address":"0x0c4314fffeb0fe3c"},"type":"device_leave"}'
Zigbee2MQTT:warn  2023-02-10 11:23:38: Device 'Living room switch' left the network
Zigbee2MQTT:info  2023-02-10 11:23:38: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"Living room switch","ieee_address":"0x50325ffffe6c9452"},"type":"device_leave"}'

I'm pretty sure this was working fine a week or so ago, before a couple of HA and z2m updates, but I'm currently away and cannot physically troubleshoot. These particular devices are IKEA battery powered switches, but the batteries are fine, and they are pretty close to the coordinator.

HA 2023.2.3 (os, raspi 3b+) Z2M 1.30.1 Sonoff dongle plus v2 (ezsp)

kirovilya commented 1 year ago

@Jonybat @Wattrider @Grazulex please check on the latest dev/edge version of z2m, I made some changes for ezsp adapter

Grazulex commented 1 year ago

@kirovilya Hello and thank you for the support. I switched to the DEV version last week and since then I have no more problems and the pairing of new devices is also much better. please let me know when this will be included in the stable version that I can switch again to the stable one.

kirovilya commented 1 year ago

@Grazulex yesterday there were some more changes in the code for improvement. they will all be included in the next release (March 1st)

Grazulex commented 1 year ago

@kirovilya ok....I have just made the update....I let you know if I have issues again. Many thanks

Grazulex commented 1 year ago

@kirovilya Update done and I have lost all my https://www.zigbee2mqtt.io/devices/SRTS-A01.html devices again :-(

kirovilya commented 1 year ago

@Grazulex Can you describe at what point the devices left the network? Or do they disappear when you restart z2m? in the logs there is information that they go out of the network?

kirovilya commented 1 year ago

@Grazulex in the latest version, processing of one event is specially disabled so that devices are not deleted

kirovilya commented 1 year ago

@Grazulex if the devices disappeared when restarting z2m, then this is another problem, possibly related to the file system

Grazulex commented 1 year ago

@Grazulex if the devices disappeared when restarting z2m, then this is another problem, possibly related to the file system

yes, I have lunch the update (dev) and restart the demon (I'm on Jeedom) and when z2m was restart all the SRTS devices was disappeard. I have just link again all the device (this step is perfect and quick).

Grazulex commented 1 year ago

@Grazulex if the devices disappeared when restarting z2m, then this is another problem, possibly related to the file system

If that can help you, I can restart z2m in debug mode and check if I find something...

Grazulex commented 1 year ago

@Grazulex if the devices disappeared when restarting z2m, then this is another problem, possibly related to the file system

Why I lost only one type of devices and not the other one ? is this link to the device himself or to the file system ? What can I do if is it not a z2m issue ?

kirovilya commented 1 year ago

@Grazulex probably because you added them last and it were not saved in the database file

Grazulex commented 1 year ago

@kirovilya I think that I had make a mistake with the update....now I'm in the 1.30.1-dev and I have restart the service and ALL the devices are there :-) Many thanks...I let you know if I have issues.

draggero commented 1 year ago

I have the same problem. It’s not problem with file system. Before first disappearing i switch dongle-p to dongle-e then I saw problem. I've try reinstall HA to new disk but it's not help.

Grazulex commented 1 year ago

I have the same problem. It’s not problem with file system. Before first disappearing i switch dongle-p to dongle-e then I saw problem. I've try reinstall HA to new disk but it's not help.

@draggero Are you sure that HA contain the dev version of z2m and not the stable one ? The fixed is until now only in the last dev version.

vignez2991 commented 1 year ago

Yes But, When i stopped z2m and tried power restart several times database file contains actual data. The database file gets empty only when i do power restart after running z2m service

May I expect a fix for this??

Grazulex commented 1 year ago

Yes But, When i stopped z2m and tried power restart several times database file contains actual data. The database file gets empty only when i do power restart after running z2m service

May I expect a fix for this??

@vignez2991 Try the last Dev version : "in the latest version, processing of one event is specially disabled so that devices are not deleted"

draggero commented 1 year ago

I have the same problem. It’s not problem with file system. Before first disappearing i switch dongle-p to dongle-e then I saw problem. I've try reinstall HA to new disk but it's not help.

@draggero Are you sure that HA contain the dev version of z2m and not the stable one ? The fixed is until now only in the last dev version.

Ok, after few days I can say - it works :)

Grazulex commented 1 year ago

@kirovilya Hi, If i'm not wrong, the 1 March you will merge this fixed in the main branch so I can swicth from the dev to the stable version ? correct ?

kirovilya commented 1 year ago

@Grazulex yes, all code from the dev version will be merged into the main one and released

vignez2991 commented 1 year ago

Yes But, When i stopped z2m and tried power restart several times database file contains actual data. The database file gets empty only when i do power restart after running z2m service

May I expect a fix for this??

@vignez2991 Try the last Dev version : "in the latest version, processing of one event is specially disabled so that devices are not deleted"

Hii @draggero,

Sorry for late reply, I have tested with the version 1.30.1-dev. It looks fine, everything is working normal. I tried power restarted several times the database file was not corrupted. Thanks for the fix.

When should i expect this update in stable release??

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

almirus commented 1 year ago

hi! same for me the device (FUT036Z) wasn't the last added (old device). I had to re-pair the device for it to appear in the list.

PS Power is not supplied continuously to FUT036Z. Switched on by mechanical switch. Before disappearing, I noticed that the light was flashing (for some reason it was in pairing mode). After that flashing stopped, and the device disappeared from the list

Версия Zigbee2MQTT [1.30.4](https://github.com/Koenkk/zigbee2mqtt/releases/tag/1.30.4) commit: [unknown](https://github.com/Koenkk/zigbee2mqtt/commit/unknown) Тип координатора zStack3x0 Версия координатора 20220301 Адрес координатора IEEE 0x00124b0022810ef5 Версия веб интерфейса 0.6.127

Stooovie commented 1 year ago

Same, i have two devices disappear from Z2M just in the last 24 hours. Not disconnected or unavailable. Actually gone from the devices list.

BeFygo commented 1 year ago

Same here, a 'Nous A1Z' disappeared from the device list last night and after a z2m (docker) reboot the entity's where removed in home assistant. No logs where saved for the time of disappearance.

And with hitting the pair button z2m show that the device left the network en shortly after reconnects with the custom name I gave it... ?

seb49 commented 11 months ago

Same here

Device works fine but not list. Also, I have a group with 3 devices (work fine) but on the UI the group is empty.

`Zigbee2MQTT version [1.33.2]

Coordinator type zStack3x0 Coordinator revision 20210708 Coordinator IEEE Address 0x00124b0014d98e09 Frontend version 0.6.142 Zigbee-herdsman-converters version 15.106.0 Zigbee-herdsman version 0.21.0`

lacrimal commented 11 months ago

Same mine - 12 devices disappeared only two thermometers left in z2m interface automation wok just fine. After forced pairing popup say 'device leaving network' and after that it appears again. 1.33.2 EZSP v8 0.6.142 15.106.0 0.21.0

oywino commented 11 months ago

I have exactly the same issue as @lacrimal It all began a few days back when Z2M suddenly had stopped and restart failed with the following error: MQTT retention requires protocol version 5 So I added version: 5 to my mqtt section in configuration.yaml and Z2M started again without this error. But all my devices were gone and I had no clue how to retrieve them. So, I decided to pair them all over again, one-by-one but after first updating Z2M to version 1.33.2 commit: 9996c93 During re-pairing, I noticed he same behavior as @lacrimal describes: After forced pairing popup say 'device leaving network' so obviously it was all in there somewhere. This is the Settings-->About summary:

Zigbee2MQTT version 1.33.2 commit: 9996c93
Coordinator type    EZSP v8
Coordinator revision    6.7.9.0 build 405
Coordinator IEEE Address 0x60a423fffe1f42fa
Frontend version    0.6.142
Zigbee-herdsman-converters version 15.106.0
Zigbee-herdsman version 0.21.0
Stats:
Total 0
By device type
By power source
By vendor
By model

After going through the complete repairing of all devices, all was well again (I thought) and in working order. But no - upon the next restart of Z2M everything was again lost. The Z2M UI dashboard is empty and no device is working.

I'm running Eclipse Mosquitto 2.0.18 in a Docker container. Z2M also run in a Docker container. This setup has worked fine for a long time, until the 'version 5' issue popped up the other day. Please help

klibro commented 10 months ago

Yes, happened to me a few times now. I'm running Z2M as a Home Assistant add-on connecting to Mosquito which is also been run as an add-on. My zigbee gateway is a Sonoff ZBBridge flashed with Tasmota. All works for a while, but if the gateway loses power, then some (but not all) devices often disappear. As others have reported, re-pairing them first results in a "leaving network" message, suggesting the device hadn't really disappeared in the first place.

hakong commented 10 months ago

I've just noticed this issue as well. All my paired devices are gone. I moved my coordinator to a new IP address, changed the IP address in zigbee2mqtt, restarted and everything is empty.

Edit: I firmware upgraded the coordinator in right before moving to a new IP address.

Edit 2: I copied database.db.backup over database.db and re-started. Now all my devices are back. That's very strange. Why does zigbee2mqtt just wipe its database?

EuPhobos commented 9 months ago

Same here, device just dissapear with no reason.. The device it self working well. It's worked several month and disappear.

Starting Zigbee2MQTT version 1.34.0-dev (commit #87f6b9e)
Starting zigbee-herdsman (0.26.1)
zigbee-herdsman started (resumed)
Coordinator firmware version: '{"meta":{"maintrel":1,"majorrel":2,"minorrel":7,"product":1,"revision":20221226,"transportrev":2},"type":"zStack3x0"}'
Currently 14 devices are joined:
BuurmanG commented 9 months ago

Devices disappeared with no reason..... Every 2~3 days 😒

mwhrtin commented 9 months ago

I think this is happening to me as well. I couldn't control a device in HomeAssistant and when I checked the history I could see that the last time it reported anything to HomeAssistant was 5 days ago. Went over to Zigbee2MQTT to check the status there and to my surprise the device was no longer listed. Not offline or unavailable, it's just missing.

How do I get it back?

I've tried to restart everything, I was running Zigbee2MQTT 1.35.0 so I've updated to 1.35.1, I've tried to re-add the device both with and without resetting the device. But Zigbee2MQTT refuse to acknowledge it.

berkansezer77 commented 9 months ago

I am having the exact same issue. My Hue Motion sensor is constantly being deleted from the list. How can I fix that ?

riversideneyon commented 9 months ago

I had same issue in the past but after trying everything issue is finally resolved but not sure what exactly has resolved. Try to remove device from zigbee interface, perform a factory reset on hue motion and pair it again.

I am having the exact same issue. My Hue Motion sensor is constantly being deleted from the list. How can I fix that ?

berkansezer77 commented 9 months ago

I had same issue in the past but after trying everything issue is finally resolved but not sure what exactly has resolved. Try to remove device from zigbee interface, perform a factory reset on hue motion and pair it again.

I am having the exact same issue. My Hue Motion sensor is constantly being deleted from the list. How can I fix that ?

I actually did that couple of times. But it still disappears from device list and even not appearing in mqtt as well. Something is going on. I have 2 other devices connected but they work normal.