Math experts wanted: analyse humidity curve and distinguish between bath and shower

WOW, that’s clearly an extrem mathematical approach :+1:
I’m impressed by the hit rate you achieved in a couple of hours, I’m spending days if not weeks on this problem already. never heard about Lua before, let me see if I find out how to feed live data into this script. might cost me another weeks, but it’s all about a hobby for me :rofl: thanks!!

Visualization of the points of detection (threshold 20):

For threshold 20:

CNP due to upload limit …

Threshold 10 is too low - false positives:

SVG files for threshold 15 and 10: (526.2 KB)

gnuplot source code:

set autoscale
set terminal svg size 15000x500
set output 'test1.svg'
set xtics 0, 0.1
set style circle radius 0.025
#set xrange [2.8:2.9]
#set xrange [1.25:1.55]
#plot 'ts1.csv'  every ::1::4000 using (dx=$4-x0,x0=$4,$4-dx/2):(dy=$5-y0,y0=$5,dy/dx/1000) w l t 'dy/dx/1000',\
#        'ts1.csv'  every ::1::4000 using 4:5 with lines 
plot 'ts1.csv'   using (dx=$4-x0,x0=$4,$4-dx/2):(dy=$5-y0,y0=$5,dy/dx/1000) w l t 'dy/dx/1000',\
'ts1.csv'  using 4:5 with lines,\
'th20.txt' using 1:2 with circles lc rgb 'red' t 'shower event'

Hi, actually the rise between samples will become larger (relativeChange / time). Increase the time will increase the relativeChange. For example twice the time.

To retain the amplitude you half the Derative value (D/2) which will also resuce the impact of noise (half).

If that’s the case, I think we’re putting too much focus on the bath when the question is, “has the shower turned on?” A humidity/temperature sensor in/above the shower would spike almost immediately due to the steam funneling up to the ceiling. The bath doesn’t actually matter since you don’t want to trigger any rules based on it.

Nope, but I’m sure that I ALWAYS left the water running when I was a kid (keeping in mind that we didn’t think about water conservation nearly as much in the 80’s). I had to retrain myself to turn off the tap when I started brushing, and now it seems weird to leave it on. So, there’s hope for your daughter. :wink:


in the initial graphs you dont specify when the bath/shower ends and it might be helpful. how long do you need the towel heated for during a shower? it’s obviously pointless to run it anytime after the end of the shower but maybe its ok to run it for a little at the start of a spike in humidity but switch off when it realizes its a bath instead then focus on predicting the end of the bath.

i’m curious if the drop in humidity during shower is caused by fan or end of shower. can you note when fan turns on also as it might be useful.