There's some good direct wire options that others will put forth but I've never used them myself (edit add: as many are Z-Wave). If you aren't happy with any of those I have done the following hack to a couple of different magnetic (window) style "contact" sensors with great success and have, thus far, lasted years.