Suggestions for automating WC light and fan ... "brain trust needed"

I'm looking for suggestions on how to program the smallest rooms of the house.

  • There is a light and an extractor fan controlled by a z-wave dimmer and switch respectively.
  • I have a motion sensor and a door sensor installed and now I need to automate this to work the way my significant other will be happy with!
  • She wants the light to come on and stay on while the WC is in use.
  • I want the light to go off on exit and not be on if the room is not used.
  • I want the fan to come on if the room is used for more than 1 minute and stay on for 10 minutes, with the light turning off on exit.
  • The door is not always left closed and sometimes the room is used with the door open.
  • I want the levels of the light to vary by mode.

I wish I could offer a prize for the most elegant solution using RM, Simple Lighting or Motion Lighting. Kudos will have to be the reward I guess, if anyone can do this in a single automation - or indeed what is the minimum you can think of?

Who knows, maybe we should start a weekly challenge for those that have great logical thinking!

You are going to need to add a motion sensor. The contact sensor won't help if its use is inconsistent.

Yep -that what I have done. I'm trying to see if I can do this in 1,2 or 3 rules and am learning that the easy part is installing the equipment - the fun/challenging part is making it behave the way i want it.

I was trying to see if there's a way to override the motion sensor switching off the light when inactive using the contact sensor when the door is closed. That would be easy in Motion Lighting if it were an option for stopping turning off but I think I have to create a virtual switch triggered by the open closed sensor in order to prevent lights turning off when the door is closed.

Thanks for the feedback -as always.

This could backfire if someone closed the door after they left the room. Light would stay on. Contact sensors just don't tell you anything useful about occupancy.

The way to deal with the motion sensor turning off the light when someone is in the room is to use a longer delay. I've found that 4 minutes works for this application. If it fails, you up the time.

That I already have - and it works well! Maybe I'm overthinking it and trying to get the light to turn off when the door reopens - and the fan stays on.

II was thinking I could override the door closing and the light being on by setting a timer for that situation but much longer from the motion sensor off time.

I'll play and try to work it out - and learn from my errors I'm sure.

What helped me in a similar situation is thinking of the light and fan separately, no interaction between them.

If motion is active, light turns on. If motion is inactive, delayed 2 minutes and turn off, using a standard rule. This works in my case because our room is small and motion sensor is 2-3 ft from the occupant's position. Bigger room probably needs more delay.

I have my exhaust fan turn on if the door contact closes. Simple trigger. Not sure if this would work in your case depending on who closes the door in which....uh...."use" cases.

The exhaust fan turns off by motion...if motion is inactive, wait 10 minutes and turn off the fan.

So...light is totally motion controlled. On and off. Fan turns on by contact, and off by motion inactive with a delay.

1 Like

And the fan turning on could have a one minute delay. Use a rule instead of a trigger, and if the door opens before delay up, it would never come on.

2 Likes

Yes - that is getting to where I want to be - just beginning to understand when to use a rule and when a trigger. Thanks.

1 Like

Cancel is only available for rules, not triggers or triggered rules. It happens when the truth of the rule changes. Every change of state of a condition causes the rule to be evaluated. In your case, that would be the door opening or closing.

So if the rule is to turn on the fan after a delay (with cancel on truth change) when the door closes (condition is door closed), if the door opens before the delay is up, it won't follow through with turning it on.

OK so here's my solution - and it seems to work pretty well. We will see what the approval factor is.

It achieves all of the specs using one trigger and one triggered rule:

  • The light to come on and stay on while the WC is in use.
  • I want the light to go off on exit and not be on if the room is not used.
  • I want the fan to come on if the room is used for more than 1 minute and stay on for 10 minutes, with the light turning off on exit.
  • The door is not always left closed and sometimes the room is used with the door open.
  • I want the levels of the light to vary by mode

Trigger:

Any motion in the room turns on the light dimmed according to mode

Triggered Rule

Motion stops OR door opens

If door open, fade light off and delay fan off for 5 mins

If door closed, delay fade off for 5 mins and delay fan off for five mins

I think I'm getting this! Thanks for the pointers. Is there anywhere we could start sharing these sorts of solutions so we don't reinvent the wheel each time?

I'm loving RM!

And adding the feedback ... big thumbs up from Mrs R.

2 Likes

Well done @Linvale
For sharing the example, under the RM topic there is an Examples sub topic for you to share it on. Would be good with screen shots too.

I have a very similar need to this but just have to buy an in switch smart relay so I donā€™t need to start replacing front light switch etc but just havenā€™t got round to look for a suitable one for a new build house in the UK

1 Like

Done - thanks for pointing this section out - will add screen shots when I am back from travels (and its been fully tested by my wife on her own - best tester I know!).

1 Like

:joy::joy::joy: Lol best tester but do you find when not testing something specific, and an automation stops working as expected, they are the worst critic and bottle up days of a failed automation and then loose it completely? ...... or is that just my mrs? :joy::joy::joy:

Well I guess they do have a lot to put up with (at least in mys case) the some of fun partsof Home Automation can appear like a really bad idea once implemented ....

Here is the "On" trigger:
image

And here is off:

Playing with how long long to set the delay for turning off if motion not detected and the door is open but has worked reliably whilst I have been away!

2 Likes

@Linvale just for clarity, in your On rule, is ā€œMaster Bath Toilet Lightā€ a motion sensor in the trigger events? Iā€™m asking because it says ā€œactiveā€ and in the Off rule thereā€™s a reference again but ā€œinactiveā€

Yes the trigger is the active motion.
The trigger of off is either motion ending or the door opening.