I have looked around, but I can’t find it. Reason: I have a door lock that partly looses the connection to Zigbee2MQTT every week or so. Which leads to the automation that unlocks the door when I, my wife or anybody who has the BLE Beacons I have programmed in (guests, like our kids when they are here) comes into range of ESPresense and then triggers the motion detector outside the door.
I have tried with two different coordinators, and that doesn’t stop this from happening, but I found out today that with this newest coordinator (SONOFF ZBDongle-E) I can get the lock back just by running a re-interview! So I tried to find a way to automate that in Hass, but I can’t find it. I searched a bit, but only found some very old suggestions about deleteing “interview finished” in the file and restarting Z2M, but of course that’s not practical. Shouldn’t there be a way to do that in Hass? I have been unable to find it so far.
It sounds like you’re trying to fix the symptom, not the actual problem.
Look into why your lock is dropping off the network. Chances are, you don’t have enough zigbee routers to strengthen the mesh, or you have interference issues, or your lock is crappy.
Either way, re-interviewing or changing coordinators isn’t the way to go long term. You need to figure out what exactly is causing your issues. I suggest you start by reading this.
Thank you for answering, but I wish you had answered the queston that I asked instead of answering with the Sir Humphrey in “Yes minister”: “That’s not the question, I think the real question is…”. I wasn’t going to do the full “passion of the Mastiff in Zigbee hell” but I guess I have to.
I have tried three different controllers (two Conbee II and the Sonoff with antenna), I have tried all the possible frequencies. I have tried with and without an USB SSD. I have tried moving the controller. I have had four different Zigbee/BLE chips for the lock. And I have a whopping 7 devices, all within ten meters from the controller, and the door lock is within two meters from the controller and in the same room, no walls in between. None of the others have any problems anymore after I replaced the controller. I tried the optimization you link to, but one of the motion sensors(the other six devices are five motion sensors and one temp sensor) was unreliable until the swap to the Sonoff with an external antenna. That’s the one that is seven meters from the controller, behind a drywall with a wooden door. It seemed like seven meters was beyond the limit for the Conbee.
What you are correct about is that the lock is crappy (or more precisely the Zigbee/BLE chip), but it’s the only lock I can use for that door. I much prefer ID Lock, which works on Z-Wave, a much, much better system in my opinion after three years with Zigbee and seven with Z-Wave. The problem is that I need a lock that has a physical key option because this door is the only way to get in to this place without breaking a window. So unless you can guide me to build a Z-Wave chip for the lock or a Zigbee that doesn’t loose connection every now and then (I have read about ohers having the same problem) there’s not much to do about the lock, and a band-aid solution is the only solution.
So maybe you or somebody else could please help me with the actual question I’m asking now?
Here is an idea (I have not actually tried this) … if you can snoop on your MQTT messages, then when you do the re-interview, capture the MQTT topic/payload that was published which invoked the re-interview. Then use a HA automation to replay/publish to MQTT this same topic/payload.
That is of course possible, yeah. But that means I have to find the command for re-interview, and I haven’t fount that in Hass, that’s what I’m looking for. I don’t think Zigbee2MQTT sends any messages to it self when starting re-interview from the GUI.
I just tried this in UI->DevTools->Actions MQTT Publish
Topic: zigbee2mqtt/bridge/request/device/interview
Payload: {"id": "Living Room Lamp"}where Living Room Lamp is the friendly name
And I see logs in ZigBee2MQTT saying the device is being interviewed.
So looks like it works.
Fantastic, thank you very much for your help! I did not find that. Exactly what I needed! I have a reboot every night at 04, so I will add a delay of ten minutes and then run that. I hope that will fix it.