Can someone help me write a code for a contact sensor

Agreed :smile:

Here’s my philosophy when i write an app. I try not to assume for any variable. If i don’t have emperical data about a situation i tend to not write it into an app. This is what I would do.

  1. You could custom make a trip sensor for the bath that would override all the different inputs for the smart app. SO when someone enters the shower the light stays on permanently.

2.You could use a moisture sensor in the bathtub that would also do the same thing when water is detected. Same thing here. It would over ride the other sensor inputs until no water is detected.