Bathroom Fan Timer based Time in Shower (motion) or humidity differential

I would like to use PLTS to have the bathroom fan (Z-Wave on/off switch #1) keep the fan on for the after the bathroom light is turned off (Z-Wave on/off switch #1). Here is the catch, I want the amount of time the fan stays on to equal the amount of time motion was detected in the shower room. 25 minute shower motion = 25 minute vent after the light.

Also, as a second requirement the fan should not to turn off after bed time (either a fixed time or 11pm or ideally when my ‘bedtime’ scene set) until sunrise.

This is my first time programming with PLTS (or Luup) and was hoping to get any tips to build this solution at a high level.

I was also thinking of using a 4 and 1 sensor with humidity, and run the fan until it is within x of a control humidity sensor in the hallway…but haven’t seen how that could be programmed.

Any thoughts on making sure the bathroom gets properly vented based on either shower time or humidity?

Thanks!

It would be simple to use the humidity level to control the fan with a PLEG device.

Triggers
HumidHi MultiSensor Humidity goes above 50
HumidLo MultiSensor Humidity goes below 40
FanIsOn FanSwitch turns on

Schedules
ItsDay DayOfWeek with required time period…

Conditions
FanOn HumidHi and ItsDay
FanOff FanIsOn and HumidLo

Actions
FanOn Turn on fan…
FanOff Turn off fan…

However, my experience with the MultiSensor humidity device is that it is not very reliable so this may not work as well as you want.

You could use PLEG to set the interval of a PLTS timer but calculating the required time could be fun. I don’t believe there is a way to perform arithmetic on timestamps. You could run another PLTS when the light is on and, when it turns off, retrieve the remaining time using a device property, subtract that from the known original interval and set that as the interval for the fan PLTS. It should be possible but may be more trouble than its worth. ;D

I took a simpler approach and set the fan timer between two fixed times depending on how long the light is on. See example.

Thanks Rex!

Can I compare humidity sensor with another outside the room. For example, if humidity is 5 or higher than the “dryer” control humidity sensor?

Can I compare humidity sensor with another outside the room. For example, if humidity is 5 or higher than the "dryer" control humidity sensor?
Yes you can. You would need to create a PLEG [b]Device Property[/b] for each sensor's [b]CurrentLevel[/b]. Example:

Device Properties
HumidityBathroom Bathroom Humidity Sensor CurrentLevel
HumidityBedroom Bedroom Humidity Sensor CurrentLevel

Conditions
FanOn ItsDay and (HumidityBathroom >= (HumidityBedroom + 5))

etc.

Be careful … your humidity values are not likely to be well calibrated.
You could end up with a fan that runs all the time.

Hi,

When taking a shower the humidity rises very quickly
Could i use that in a PLTS?

So: delta Humidity > 10 in 1 min => switch on fan.

Does someone know how to do this?

Thanks
Sjoerd

It would be difficult to do with PLTS. But you could do it with PLEG.

Have a device Property named Humidity
Have a trigger called FanON

Conditions:
DelayedValue (DelayedValue; Humidity > 2:00) ? Humidity : DelayedValue
FanAutoOn (Not FanOn) and (Humidity - DelayedValue > 10)

Then you can also have:
OffValue (FanAutoOn; FanOn) ? DelayedValue + 2 : OffValue
FanAutoOff FanOn and (FanAutoOn; NOW > 20:00) and (Humidity < OffValue)

Minimum Fan On time is 20 minutes, then longer until the humidity is removed.

Hi Richard,

Seems exactly the solution I was looking for.
Set up the Pleg as you advised.
This morning the fan did not switch on.

Hard to check the actual values when taking a shower 8)

Wil test it further. I will let you know.

Thanks so far, this bring me to the idea for further posibilities!

Did you arm the PLEG ?

Hi Richard,
Today I did some test:

See attached.
The delayed condition does not seem to become true, the status is always following the actual humidity
I think the last true is of the time I took the first shower.

The last condition AutoOn remains 0 and false, so when (manual) switch the fan on, it immediately switches off.
This is due to the fact AutoOn remains 0 which is longer then 20 min ago.

The thing I do not understand is why the delayed status keep updated while it’s not true…

Same is also for the Off value, this is always the actual value +2.

Hope you can help, when it works it is the exelent solution…

Kr
Sjoerd

A couple problems …

  1. I do not think you are on the latest version of the PLEG. In your version You will need to rename “DelayedValue” to “_DelayedValue”.
  2. I am not sure how often the Humidity value is being reported … That will effect the time constant in the DelayedValue condition.
  3. There is a Logic bug in the FanAoutOff logic. I need to think about that one some more.

I’m interested in other suggestions on this as well. I have a guest bath that for some reason people refuse to turn on the fan when showering. The humidity gets so high that it condenses on the walls and drips down, leaving water marks.

I eventually wired it with the light so I don’t have that problem any more. I’d like to see you get this working so I can shortcut to a better solution. ;D

Have you thought about using the thermometer in the multi-sensor to detect the heat rise with the shower? Perhaps that reacts quicker than the humidity changes can be detected.

Hi Richard,

Succes!

I manual updated the PLEG plugin’s via the appstore, I assumed autoupdate, but it wasn’t. Now the autoupdate is ticked.
I am now on 5.5

I saw first time i just missed the 10% in 2 min. So adjusted to be sure to 5% in 3 min.
Because the switched off directly after an manual on, I changed the condition FanOn into FanAutoOn.
I will test later when I change back as you initial suggested.

See attached the result’s

I still do not know how it exactly works. (but it does now :D) )

The DelayedValue-state seems be the same as the actual Hum
Also the Off value is actual Hum+5.

I would expect the state is fixed as soon as the as the condition is met.
Can you help us understand so we can find out next time without you excellent help ( quick and good!)

Thanks!
Sjoerd

One more change:

FanOff Not FanOn
OffValue (FanAutoOn and FanOff) ? DelayedValue + 2 : OffValue
FanAutoOff FanOn and (FanOff; FanAutoOn) and (FanAutoOn; NOW > 20:00) and (Humidity < OffValue)