Automating shower/toilet light with a humidity sensor


#1

1) Give a description of the problem
I have a weird room that I’m trying to automate and need a little bit of help. It’s a room with a door leading into it, containing a shower, and a toilet. There is also a single light.

2) What is the expected behavior?
When I walk into the room, I want the light to turn on. This can be accomplished by the motion sensor. The light should stay on so long as the motion sensor can see me. After the motion sensor does not see activity for 5 minutes I want it to turn off the light, unless… The humidity sensor sees a rise in temperature. (this is when the shower is running). One of my challenges is getting it to turn off after the shower is off and there is no motion.

3) What is happening/not happening?
Nothing yet

**4) Post a Green Snapshot of the piston!
Nothing yet

**5) Attach any logs:
None yet, logic question.

Thank you in advance!

Shane


#2

How fast does the humidity drop after the shower (is there a fan)? Maybe you can view the device activity and go from there.


#3

Hi @smandrews

just a couple of quick questions,

  • The reason you want humidity sensor to be involved is because you want lights to remain ON longer (until you are done) when in the shower?

if yes,
Since it sounds like a small room, can the Motion sensor see you in the shower?


#4

I’m thinking that the humidity will start dropping as soon as I open the door and it starts to equalize with the room on the other side of the door.


#5

You should set up a simple piston that logs the humidity values so you can figure out the normal and the highs and how fast it drops.


#6

Fantastic point Ike!
You would be correct as to why I want the humidity sensor involved.

As to the size of the room, you are also correct. I too had the thought of aiming the motion sensor over all of the room, but it occurred after the humidity sensor arrived. At this point, your solution is more practical. I’m just wanting to learn how I would accomplish it with the humidity sensor. This lets me learn a bit more about webCoRE.


#7

If you want to do this with humidity sensor,
Here is how I would do it…

I would use a global variable (local also would work - I always prefer globals)

something like this:

IF humidity sensor rises to or above 60 (lets say) meaning shower is ON
—Set global variable to 1
IF humidity sensor drops down to or below 59 (lets say) meaning shower is OFF
—Set global variable to 0

Lights part would go like this:
#This part is when no shower…
IF motion sensor x changes to ACTIVE
Then Turn the lights ON

IF motion sensor x stays inactive 2 minutes
and
Global variable is 0
then
Turn the lights OFF

So light will turn on at all times when action…
but it will only turn OFF if the global variable is 0
as long as humidity sensor is or above 60 (numbers are made up, you have to test it) lights will never go OFF

I wrote this really fast, it may need some adjustment but just wanted give you an idea


#8

opsss @eibyer is in the house:)))
When a minion helps you, @smandrews tell us noobs to shut up and listen to them:)))))


#9

Put all the ideas together and arrive at a good solution :smiley:


#10

@eibyer @ike2018
Thank you both for the responses! I will update this as soon as I am able to put it into a piston. Really appreciate it!


#11

Please excuse my ignorance but I am unsure of how to actually “flip” or set the variable after defining it.

Maybe I’m looking in the wrong place but when I click “then” then “action” I don’t see global variables. Only my physical devices and system variables.


#12

Click on add new statement
Click Add an action
You will see device list…DO NOT choose any
just click on ADD A TASK
Click on DO
scroll down and choose
SET VARIABLE STATUS


#13

Just curious @smandrews, do you have a contact sensor on the bathroom door?