I am using HAOS on a Pi, ZigBee2MQTT and have a V2 Sonoff stick, 40 devices on the network with many routers.
I have one Tuya door contact that seems to not report the correct state. It reports that it is open when it closed. If I then open the door the correct state is transmitted, but on closing the unit reports it is open.
The sensor does not appear to refresh the state until there is a state change, but it seems to miss the closing. Is there a setting in Z2MQTT that might help with this ? Possibly debouncing ?
Maybe the 2 pieces are just too far apart in “close” position?
Depending on the device / quality, you can get away with 1 cm or a couple mm…
“Quickly” or not should not matter. A zigbee device will regularly post its state, anyways, so you can assume the device does not know it is closed, here.
Thanks for your input. Yes I agree about the speed. Yesterday I looked at the log after opening and closing the gate slowly, and it missed the closure. At least HA missed it.
The sensor has a 1/8 inch gap so I think that is pretty good. The magnet was mounted as close as possible without hitting the sensor when closed. What my next step may be is to check the interior of the sensor to make sure I am in precise alignment with the reed switch and if I am I may swap out the magnet for a rare earth variety. Failing that I will swap out the sensor with a different brand.
In my experience the Tuya Zigbee end devices seem to need to have a repeater device nearer to them than some other brands’ devices; otherwise they lose their connection to the mesh.
Not related to a ZigBee network problem as I’ve recently added about a dozen new routers which transformed the network from being an unreliable toy, where devices fell off of the net on a daily basis, to a decent stable setup. And for those who can’t trust their Zigbee network, I would highly recommend installing more routers.
This sensor was the first I had seen that does away with the reed switch and instead utilizes a hall effect transistor.
The fix was repositioning the gate latch and the magnet so that it had a better chance of remaining in contact after closing. From all of my tests it seems to have sorted it out.