Occupied Bathroom Script

In case anyone else has a similar need, here is a script in use at our bathroom. It requires a 4 in 1 motion sensor that can read the humidity. It will turn on a light at a low level when motion detected, and then increase the light to full when the shower is on. Later I will be adding a smart switch to my exhaust fan when the it detects the shower is on. The script assumes that the motion detector has a setting to send a no movement event after a set amount of time.

[url=https://gist.github.com/bytedreamer/6db5702cf82f031dad91bc07107a8e31]https://gist.github.com/bytedreamer/6db5702cf82f031dad91bc07107a8e31[/url]