Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
11.98k 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

x61 commented 8 months ago

Same here. they just disappeared 👻

mikezs commented 8 months ago

I have this issue too, I'm running everything in docker. Every now and again (sometimes months) the devices just all disappear at the same time and stop working. When I repair them, the status in zigbee2mqtt says "leaving network" first meaning they're just not having the messages received

transon123A commented 7 months ago

I also encountered the problem of losing the device in z2m,,didn't see it in the Z2M devices list, it just flashed in pairing mode! Latest Z2M version 1.35.3-1 ​

FunInfinity commented 7 months ago

same here on 1.35 and 1.36.0 version. suddenly 6 devices (all miboxers controllers) disappeared from the list. when I try to repair - the screen is flushed with messages " has left the network". And also is not repairing in the end.

burak-sayici commented 5 months ago

Hello, I am having the same problem. After I updated Zigbee2MQTT and home assitant core today, no devices started to appear and connections were lost. The list is empty. Will this problem be fixed?

oywino commented 5 months ago

With som many people complaining about the same issue (or similar issues), maybe it's time @Koenkk steps in and shows some concern for us (his users). Or is that too much to ask?

Koenkk commented 5 months ago

If someone can provide debug log starting from the moment the devices are there until they disappear I'm happy to investigate.

See this on how to enable debug logging.

WillyCat commented 4 months ago

If someone can provide debug log starting from the moment the devices are there until they disappear I'm happy to investigate.

See this on how to enable debug logging.

link is broken (404)

WillyCat commented 4 months ago

How I solved the issue (works for me, could work for you, no guarantee)

Looks like a pure gui issue, when starting z2m, logs indicate devices are known :

[2024-06-02 14:43:26] info:     z2m: Currently 3 devices are joined:
[2024-06-02 14:43:26] info:     z2m: 0x70ac08fffe493702 (0x70ac08fffe493702): ZBMINIL2 - SONOFF Zigbee smart switch (no neutral) (EndDevice)
[2024-06-02 14:43:26] info:     z2m: 0xf4b3b1fffe459015 (0xf4b3b1fffe459015): Not supported (Unknown)
[2024-06-02 14:43:26] info:     z2m: 0x00158d0001ab2d77 (0x00158d0001ab2d77): WSDCGQ11LM - Aqara Temperature and humidity sensor (EndDevice)

looking into database.db, each device has its line in the json file, all data are correct (ieeeAddr etc.)

state.json has a recent timestamp , data has been updated recently

devices info are published to mqtt whenever there is something to publish

so from an engine perspective, as far as I can tell, all is fine.

When connecting to the interface, there is no device displayed There is no error message in the the logs saying that the interface is unable to display what can be found in database.db either.

I'm using latest dockerhub docker image running Zigbee2MQTT version 1.38.0 (commit #fe048e6)

Having a look at js console in the browser, I saw these errors index-3cebf61c.js:61 WebSocket connection to 'ws://(my address)/api' failed: my understanding is that this is how the js in the browser retrieves the list of devices from the backend

The reason why this happens on my setup is that I am using nginx as a reverse proxy , what required some additional setting to handle websockets I added these lines :

                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_read_timeout 86400;
                proxy_http_version 1.1;

and now it works !

My guess : either nginx or zigbee2mqtt or both changed (maybe zigbee2mqtt switched to websockets or nginx changed the way it handles this) requiring this additional setup

Not sure this can solve the issue for everyone but for those having an nginx reverse proxy, it's worth a try

by the way, an error message on the front end would be welcome ;-)

hope this helps

oywino commented 4 months ago

Your solution seems to indicate that you are accessing your Z2M server via an NGINX Reverse Proxy, right? You probably have a very good reason for doing so, while the rest of us have our Z2M server running on the same network (LAN/WLAN) as everything else we have, thus there is no need for a reverse proxy, and consequently we don't have one installed at all.

WillyCat commented 4 months ago

Your solution seems to indicate that you are accessing your Z2M server via an NGINX Reverse Proxy, right? You probably have a very good reason for doing so, while the rest of us have our Z2M server running on the same network (LAN/WLAN) as everything else we have, thus there is no need for a reverse proxy, and consequently we don't have one installed at all.

Exactly. When having an nginx reverse proxy, things happen exactly as described in this post and applying the changes fixed the issue. I do agree that the solution only applies to this setup, one among many so this is not "the" solution, but a solution for some around here. What I also tried to do is explain how I came to that conclusion and there is a reasonable chance that the methodology could also apply to other setups. Especially, considering the z2m is ok in the backend, tracking what happens between the js front end and the websocket backend api is the point I would check because this seems to be the culprit. The idea was not to say "hey , I solved the issue" but to provide some hints to help

GianGiacomo-ONE-SYS commented 1 month ago

This issue seems to be here again in the 1.40.1, I'm trying with no success, to pair 2 IKEA bulbs. They appear and after 30 sec they are removed from the database because they "left the network"

[2024-09-07 21:35:19] debug: zh:zstack:znp: AREQ: <-- ZDO - leaveInd - {"srcaddr":63180,"extaddr":"0xa46dd4fffe542abc","request":0,"removechildren":0,"rejoin":0} [2024-09-07 21:35:19] debug: zh:controller: Device leave '0xa46dd4fffe542abc' [2024-09-07 21:35:19] debug: zh:controller: Removing device from database '0xa46dd4fffe542abc' [2024-09-07 21:35:19] warning: z2m: Device '0xa46dd4fffe542abc' left the network [2024-09-07 21:35:20] info: z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0xa46dd4fffe542abc","ieee_address":"0xa46dd4fffe542abc"},"type":"device_leave"}'