This probably isn’t it, but just in case, anytime you have a sensor with a magnet that used to work and now isn’t working, it’s worth asking if there’s any metal nearby that might have become magnetized over time. That can throw off the sensor completely.
I installed an Ecolink door sensor on my wrought iron gate. The magnet is on the gate and the sensor is on the 1.5" square post. It worked for about two weeks and then stopped working. I went out to troubleshoot it and found that when I remove it from the gate, and move the magnet over it several times, it begins to work again. I can “open/close” the sensor without any issues at all. The moment I put it back up against the gate, it stops working and it remains in whatever state it was at when I placed it against the metal. I have tried so many variations to this process that I am convinced it is the gate metal that causing the problem. The weird thing is that it worked perfectly for the first couple of weeks.
I have tried taking a 1/4" piece of wood and using it as a backing for the senso…