deejay808:
Well, let me give you some additional background on the system. These sensors are an extension of my domotics system (Loxone). The arduino and the loxone system communicate using UDP messages over my local network. Whether that is a good choice may be another discussion. Anyway, it works already for about 3 years. Since the last update of the loxone system, I've seen 'open windows' that are in fact closed pop up almost every day; just 1 or two of them.
What actually happens is, when a read sensor opens, a message is send to the loxone. When it closes, another message is send. I have the impression that the handling of the messages has been changed such that 2 consequent messages in a short time might not be 'seen'. Just a guess ... because that is the only thing that changed in the whole system. Routers and switches have been reset
Of course, the 'sparks' in the circuit from the reed sensors to the arduino were there before. It is only now that they have become a problem.
If the sensors or their placement would be bad, I think I should see a lot more high/low events in my log. So I am quite sure that that is not the problem.
This would have been good information to know at the beginning. I was under the impression that you had just assembled this and were still in the "ironing out the wrinkles" phase.
The fix might be as simple as using a software debounce filter on all of the switch inputs. For slow things like doors and windows you can probably get away with a relatively long settling interval, like 250 ms or so.