Page 1 of 1

Need some inteligence..

Posted: Monday 17 July 2017 8:17
by R0yk3
Hello,
i have got a script hich togles a fan in my bathroom if the hum. is > 70% then spins for an hour, or if in the mentime the hum. is < 60% is turns off.
All works wel except now the outside hum. is >70% so in the bathroom is does not come below 70% and the fann keeps spinning.
i upped it now to 72% otherwise it keeps going on all day and night.. :|

See the script
http://prntscr.com/fwl6xz
Image

So how do i give the inteligence that if the outside hum. is > 70% it just runs for 1 hour in blockly.
Like,
If outside hum is >69% and inside is >70% run 1 hour (then stop) <- but turn on if the hum. rises again if i take a shower. :?:

or start fan if hum. rises 5% then run 1 hour, but i have no reference. :evil:

I cannot fgure this out, BTW i have no fysical switch. :|

Help.. :?

Re: Need some inteligence..

Posted: Wednesday 19 July 2017 6:05
by mrf68
Determine how fast the hum. rises 5% when using the shower. Check hum. and store the value in a variable. Check hum. again after the earlier determined time period and calculate the difference. If difference > 5% then turn fan on for one hour. BTW, I would use LUA for this.

Regards,
Martin

Re: Need some inteligence..

Posted: Wednesday 19 July 2017 8:05
by leoncornelissen
I created a Lua script to overcome this. Next to that, if the humidity is 50% and you take a shower, you also want the fan to work

I check each minute what the delta is, If I have a raise of 2% in 2 minutes it is definitely someone in the shower or at least in the bathroom. The script saves the lowest value of the last two minutes and each time the script runs it checks if the current value is lower than the previous to determine the highest humidity.
If the peak of the humidity is determined the script will calculate the target humidity (min + 0,4 *(max - min)). So it should at least reduce the humidity increase by 60%.

It is possible to make it in a blocky but I'm not fancy about it.