Rules for bathroom ventilation

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
sawo
Normal user
Posts: 16
Joined: 26 Mar 2020, 12:20

Rules for bathroom ventilation

#1 Post by sawo » 16 Jun 2020, 20:55

Hi all,

could any one please assist me with a espeasy rule?

I would like to setup an bathroom ventilation rule,
so when the lux value is above 100 and/or the humidity is above 65 the fan should turn on and stay on for 5min.
I am using a wemos d1, dht22 and a bh1750.

This is the rule I have to far: but the "delay" doesn't work...
On System#Boot do
gpio,0,0
endon

On Light#Lux>100 do
gpio,0,1
endon

On Light#Lux<99 do
delay 300
gpio,0,0
endon

thx
sawo

User avatar
grovkillen
Core team member
Posts: 3609
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Rules for bathroom ventilation

#2 Post by grovkillen » 16 Jun 2020, 21:02

Never use delay, it's blocking.

Code: Select all

On System#Boot Do
 Let,1,0
EndOn

On Humidity#Level>65 Do
  Event,FanOn
EndOn

On Light#Lux>100 Do
  Event,FanOn
EndOn

On FanOn Do
  GPIO,0,1
  TimerSet,1,300
EndOn

On Rules#Timer=1 Do
  GPIO,0,0
EndOn
This rule will have the fan running until the lux and humidity is below those values and then run for 300 seconds.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

sawo
Normal user
Posts: 16
Joined: 26 Mar 2020, 12:20

Re: Rules for bathroom ventilation

#3 Post by sawo » 16 Jun 2020, 21:11

hi grovkillen,

thanks alot for your help again!!!
It works!!!

Thanks

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 17 guests