For me simple is better. If I can put a capacitor or resistor/capacitor on something rather than write many lines of code that's better than taking the time to make the code work.

Your location says Greece so any link in the U.S. might not be viable but mercury tilt switches are fairly common here. If you have an old thermostat, the ones with the slide for setting temperature not digital, they have a mercury switch in them.