Can someone help me write a code for a contact sensor

Much discussion of trying to determine occupancy in the following topic. It often comes down to whether you want to account for visitors (inlaws? little kids? new girlfriend?) who may not know your light protocols:

Many people will close a bathroom door almost all the way, but not quite, for any of many reasons. Little kids are an obvious example, but there are also people with arthritis who find door knobs difficult, parents listening for little kids in the other room, people in wheelchairs, new girlfriend taking a shower who wants to subtly let you know it’s OK to come in, etc.

In your own household, it’s up to you whether you want to take all of those into account or not.

1 Like