Zigbee2MQTT disconnected device

Hello,

i have bought follow tuya products:
https://it.aliexpress.com/item/1005005210965804.html?spm=a2g0o.order_list.order_list_main.96.385c36961aYPIn&gatewayAdapt=glo2ita
https://it.aliexpress.com/item/1005005196806986.html?spm=a2g0o.order_list.order_list_main.76.385c36961aYPIn&gatewayAdapt=glo2ita

what is not clear is why only this kind of device are connected after the paring but after some time (i dont know if after days) the connection is lost… what could be the problem?

Is the connection lost (they don’t send data any more ), or are you worried that you don’t see a line any more on the map ?

My understanding is that a Z2M map is a view of your zigbee network at just a single point in time, when the map function is run. Battery powered zigbee end devices (and perhaps even mains powered end devices) cannot be ‘woken up’ by the central coordinator device in any ‘immediate’ way. It is up to the end devices firmware to decide when and how often it wakes up to either send or receive data or ‘check in’ with the coordinator/router (it is attached to).

From my experience, some end devices and routers do a ‘better’ job of ‘remembering’ and publishing their last known state and route than others. So you will see these devices with ‘connection’ lines when you run the map function. Probably not the same Tuya end devices as you, however, I do have Tuya devices that connect via routers that show connection lines. It may be a function of how long ago the end device last ‘checked in’, I believe I see my ikea motion sensors and battery switches at times seem to have been ‘asleep’ for a long enough period that when I run the map function they do not show a connection line. If the device was last connected via a router and that router has been power cycled since the last ‘check in’ of the end device, therefor the router has reset it’s routing table, this too seems to result in a end device ‘floating in space’.

IHMO, it would be useful to have some type of ‘persistent’ map or other view of zigbee network (not just z2m but zha and others) that showed a better ‘history’ of device communication. The Z2M ‘devices’ view does show (and allow you to sort) by ‘last checkin’ age. You can open this view and the map view in two different browser windows (however remember you have to refresh the map view manually). This gives you some insight to whether a devices battery has gone out (or one case I had a raccoon, bird or squirrel absconded with an outdoor temperature sensor :wink: ).

Good hunting!

we are in the situation where the sensor is not sending anymore the data and it’s not cleary why this happened.

I confirm exactly the same issue, but only with Tuya based, battery operated zigbee devices.
No solution found so far.
Interesting enough, have noticed that whenever sensor (water leak, PIR, door…) registers some change (e.g. door is open/closed) it gets back to “online” status. For a while. Then again goes offline.
My presumption is that this is Tuya way to preserve battery.
For some use cases 'e.g. PIR or water leak, it is OK. I could say, it works reliable. If there is PIR movement, it will report properly.

But it causes quite a lot of issue in HA automation, for instance door open/closed. The HA does not know if the sensor is on/off because it sees it as unavailable.