Turn fan back on when power goes out

I have a fan controller for my bedroom fan. The problem is, it does not have a setting to go back to whatever state it was on if it looses power. So, if I have a storm in the area, and loose power, even for a second (which happens), then fan turns off, and does not come back on when power is restored.

When that happens while I'm sleeping, I end up waking up because the room starts to warm up, and it never fails this seems to happen about an hour before my alarm goes off.

I'm trying to figure some way for it to remember if the fan was on or off, maybe with a virtual switch or something that would stay set during a power outage, but if I just have it turn on and off with the fan switch, it turns off when power is lost too, since the fan switch turns off.

Do you have ways to detect / monitor some of the key elements you need, i.e. the change in your power supply, the temperature and the state of the fan? The state of the fan may not be a necessity....

Along that line, you could look to re-issue the command to the fan if the temperature goes above a threshold, but I would expect the temperature for a sensor would not change in a significant way for a sensor, likely the "feels like" temperature may be more what is affected by the use of a fan.

As an alternative, you could look to mount a contact sensor to one of the blades to detect "motion" of the fan and respond to situations where you expect the fan to be operating but not motion is detected.

I don't really have those ways to detect, but even if I did, how do you tell Hubitat what the state of the fan was, and differentiate it got turned off by a power outage vs it got turned off by the switch?

Let's say I did one of the motion sensors on a blade, Hubitat still needs to know that the fan is supposed to be on in the first place.

That would depend on the device (fan) I expect, i.e. whether it reports being turned off differently when turned off using the switch vs the power outage. If it doesn't, then it may be hard to achieve what you are after...

Something like what I was suggesting would rely on the fan being turned on via a Hubitat rule / app, allowing you to incorporate the setting of a virtual switch or Hub variable to capture that the fan should be on. If you turn the fan on manually using the switch on the wall or some physical remote, then it becomes harder to achieve this.

The only other idea I can think of is using an actual motion sensor pointed at the switch for the fan and to setup a rule to detect the switch turning off while there is no motion near the switch, perhaps limiting this detection to night time if you wanted. If you didn't want to invest in a motion sensor or don't have a spare to use for this purpose, a more rudimentary option would be to say that if the switch turns off through the night to automatically turn it back on 5 minutes later, but if you want to turn it off you use some alternate method through the night, like another smart switch of some kind or a dashboard.

That's the problem. It doesn't report differently.

Would a motion sensor be an option?

Hmm maybe use a Ring v2 extender...

When detect change from battery to mains turn on fan

Perhaps a vibration/acceleration sensor? You can set a trigger so that if movement stops a rule would start a loop that would send the on command every few minutes until it starts up again. This would depend on the fan and if you can put something like that on it and not unbalance it.

Although the Ring 2 extender would also be a solution, as suggested by @rlithgow1

1 Like

OK, but what about when the fan is supposed to be off? This would detect no motion, and turn the fan on.

The issue is not detecting if the fan is on or off with sensors. The switch being off would do the same thing. The issue is how do we let Hubitat know the fan was on or off before power went out?

If the trigger is motion stops then if the fan is off to begin with it will not trigger. You can add time constraints as well, perhaps only when in sleep mode, etc.

In my opinion the simplest way to do this is using a device that detects when mains power is restored. You can use a Ring Extender as suggested by @rlithgow1, or just build a device that detects power loss/restoration.

Here's an example of such a device:

And then use a rule like this:

Required expression: When mode is Sleep
Trigger: Power is restored
Actions: Turn on Fan.

3 Likes

If fan is a simple motor that is either "on" or "off" (or if it can be configured like that), then even simpler solution is possible: just attach smart switch module that has last state memory and can restore it after power outage (For example Aeotec Nano: for Dual Switch Nano it has a parameter 20 that can be set to "Last state [value = 0]").

2 Likes

Does your fan controller report that the fan is off after you lose power? If so, you could just use a repeat loop to re-send the On command to the fan every 15 minutes, or whatever interval you want it to be, until you manually turn it off. No need to detect anything.

Temperature is another option. Set a rule to run the fan above a set temp.

1 Like

I like this idea. Especially because temperature sensors are way more sensitive than humans perceiving temperature changes.

1 Like

Depends on how long the power off periods are; might deplete the battery.

1 Like

True but you can schedule a shutdown to the hub to prevent corruption and upon restart have the restart trigger the fan. Or if the hubitat ups is big enough (a 750 would last a couple of days) all it has to do is wait for direct power to be applied to the repeater. At that point it sees change and turns on the fan

How about mirroring the ceiling fan to a sacrificial plug that remembers power state from before an outage (the $15 Tradfri does this I think).

Then if you use the plug state to turn on the fan, it would re-start after an outage, or vice versa if the plug was set to off, the fan will be turned off after an outage.

Umm, at least that makes sense in my head.
Just don't ask me to write the rule(s). :wink:

I can use a virtual switch as well. The problem is when I use the fan normally, I need the V switch (or in your example the plug) to turn off when I turn the fan off from the switch. When I loose power, and it comes back on, the fan switch is now off, which turns off the V switch, or in your case the plug.

I thought I had a solution, which was actually along those lines. I set up a V switch that would turn on when the fan was turned on, but when the fan was turned off, it would wait 15 seconds before turning the V switch off. Then another rule that was triggered by a system start, that if the V switch was on, then turn the fan on. The idea being that this rule would kick in before the 15 seconds was up.

I got it all set up, tested it out by unplugging my Hubitat, and I was all happy. That is until I remembered I have the Hubitat on a UPS. So it won't loose power and have a power up. But, I think this is still the right direction. I just need to figure out something that will tell Hubitat if power was lost.

I meant the other way around, the plug state controls the fan state.
When power comes back on, the plug remembers whether it was on or off, and sets the fan(via HE) to that same state.

2 Likes