Have Bathroom Light follow Bathroom Fan

Not sure if this is possible.

  • Fan switch turns on (trigger)
  • Turns on Bathroom light at 100
  • When Fan switch turns off
  • The Bathroom light turns off
  • In this rule HARD part I need it to supersede any other rule that might be running.



Before your last action of turning off the light, you could use cancel rule timers for any other rule that might be running.

Your first rule looks good in terms of doing it what you want it to do directly, though you shouldn't need that very first action, the "On," since the "Dim" action will also turn the device on if it's off (or at least that is normal behavior for most devices if you didn't check yours).

The tricky part is making this rule prevent others from running. Obviously, this rule and other rules have no way to know anything aside from whatever you create that communicates this status or otherwise prevents what you don't want to happen. Your suggestion of setting Private Boolean on these other rules is a good idea, though if you tried to do that, your second screenshot doesn't show any evidence of having done so. You did check "Use required expression," but there is none defined. Did you mean to add "Private boolean is true" there? If so, that, coupled with some way to set it on this rule (say, setting it to false right after the "Dim" action in your first rule and back to true at the end of that same rule) should work. You'll probably also want to enable the option to cancel pending actions and not just restrict triggering in this second rule.

There are likely many other ways you could approach this. For example, would it be basically the same thing if you just prevented the second rule from doing anything when the fan is on? You could use that device status directly without using Private Boolean being set from one rule in another, which could be simpler. Ultimately up to you, of course!

What do you want to happen if the fan and lights are on and somone turns off the light?

I found this in ChatGPT but I can not figure out how to do the last part????

I don't think that's a good approach, though since it's not a complete rule, it's hard to say. I'd stick with the one you have plus one of our suggested modifications. (That being said, the docs will tell you the location of any menu items. :wink: )

okay - thanks

Good -> thought but that will not happen

Are the switches for the fan and the light in the same box? Most people just wire them together if they always want both running.

Can this be simply be done with the mirror app.? Fan state always follows light state,

First, the Fan & the Light are in two different switch boxes across the room from each other.

I ran this rule and it:

  • Turned the light ON
  • Turned it to 100%
  • Did not turn off in 15 minutes


  • List item

I don't know what this has to do with the Mirror app that I wondered might work for your application. I am assuming the light and the fan are both controlled by smart switches.

If you read the thread he was responding to my question.

Right, because that action was never reached: you're waiting for the fan to turn off first, and from your description of events, that never happened.

From this rule and your previous ones, it's not clear that you understand this, but rule actions run in order. A "wait" will effectively pause things there until something happens, either the event (or condition if it's not already true) you're waiting for, a cancellation, or you manually re-initializing the rule. This is spelled out in the documentation, which many of us have suggested you read but seems to have still not happened. Please do. :slight_smile:

If you enable all logging for the rule (it's on by default), then look at the "Logs" page and filter it to just this rule, you'll probably find log entries that suggest this is what's happening. If not, you should at least find other clues, and sharing them here would be helpful to us if they aren't immediately helpful to you.

Also, why did you add this second wait in the first place? It wasn't in your original rule, or perhaps this is one of the "other rules" you mentioned. If it's a modification of something above, it is very hard for others to troubleshoot if you keep changing things in ways that are different from what they suggest, so stating any changed goals you have and the reasons you made any modifications beyond what was offered would be immensely helpful.

That's an interesting idea! I don't think you can translate "on" for a switch to "set level 100" on a dimmer, but certainly just the "on" piece could work. But then we still have the problem of how to stop the other rules from doing their thing during this time (certainly the private boolean approach that was being toyed with wouldn't work, but it's possible looking at the fan state directly as I also suggested might).

(Maybe some Basic Rules where some are restricted by fan state instead of any of this in RM? That might be easier... :thinking: )

1 Like

I was thinking this could be a virtual device that would turn on the light 100%. We are missing the other rules that can act on these devices.

Or a pre-existing condition for light and fan both being off. Then it is unlikely that they are being controlled by another rule(s) at that time.

Please see updated rule. FYI the first part of the rule worked great (the earlier rule)
this is what it did.

  1. It turned the Light ON.
  2. It turned the Light from 50 percent to 100 percent.

What it did not do is turn the fan off and the light off in 15 minutes.
This is my fault. I keep reading the Documentation like I was told. However I still have not digested all of it and still sorting it out. It is midnight here and my wife is sleeping. I do not feel lead to test this rule right now.

I am just letting you know that it is possible to adjust the dim level bbrannon. For you I hope this is a help. For everyone else PLEASE do not look at this because I have not tested it yet. The second half that is.

  1. Stop "Master Bath - Overhead Light On - Day 50 percent"
  2. Have the Fan run for 15 minutes and shut off
  3. Turn off Overhead Light
  4. Resume "Master Bath - Overhead Light On - Day 50 percent"

Please check back tomorrow and I will let you know how it went. I have attached some screenshot / notes

image





![Trigger Master Bath Fan 11-20-5|386x500](u

Please this is just for bbrannon. Again I have not tested the new rule.

That was not apparent to me.

Okay, I did read the doc like you asked me to. I am having trouble finding "Cancel Pending Actions"

This "AAA Master Bath Fan turns on, dim Master Overhead Light to 100 " works perfect! I have it set to only one minute for testing.

  1. When I turn the Fan ON the Light turns ON and switches to 100 percent.
  2. It runs for the one minute and shuts off -> GREAT!
  3. The Fan and the Light turn off after the one minute.

You did check "Use required expression," but there is none defined. Did you mean to add "Private boolean is true" there? If so, that, coupled with some way to set it on this rule (say, setting it to false right after the "Dim" action in your first rule and back to true at the end of that same rule) should work. You'll probably also want to enable the option to cancel pending actions and not just restrict triggering in this second rule.




I tried to do what you asked but FAILED. I will continue to go over the doc, however if you can help a dummy here I can not find or figure out "want to enable the option to cancel pending actions" how to do this. Is it possible you can give me a screenshot where this is?

Here is what I tried and what it looked like last night (did not work at all)

The rule I did today works perfect except I would LOVE to figure out how to stop/cancel another rule.

This rule that you helped me with works PERFECT!

Thank You so much for all your help. I know I am a bit dense, but if you can help me with this last rule I promise to leave you and everyone alone for awhile.

Thanks again

It is on the page where you configure the required expression itself (click/tap into that, not the main rule page).

I must be missing something here. Why not just trigger on master bath fan changed?