Jump to content

Motion sensor program for ceiling fan help


TomL

Recommended Posts

Posted

I have gotten some great advice and help in the past, so here goes one more request.  Trying to create a programming routine to run a ceiling fan using a MS as a controller.  Have no problem getting it to run when MS is activated and staying on in the occupancy state.  What I want is to delay the fan from coming on if you just are walking through the room.  Can't figure out how to make it wait 5 minutes before activating fan if no one is room.  Tried IF MS ON then wait 5 minutes and then a second program that check for an on command and starts the fan but all I do is create a loop and the fan still comes on immediately.  Anyone doing something like this or have an idea how to make it happen.  Again remember I am a neophyte at ISY programming.

Posted
Quote

It might help to think through the logic in a little more detail.  Specifically, how are you going to determine if someone is in the room after a 5-min wait period?  Assuming that all you have is the motion sensor, do you want to define "occupied" as sensing motion every minute?  Every two minutes?  Something else?  How do you define occupied based upon a motion sensor?

 

 

Posted

The logic for keeping the fan on is the same logic for keeping the lights on.  I turn the fan on when motion is detected and wait a given amount of time, 1 hour for example, depending on room, so if it senses motion during that period it resets the the time and continues to run, keeping them from turning on if someone just walks through the room, that is the part I can not seem to work out.  The walk through scenario would also be attributable to some lighting.

I can just tell Alexa to turn it on or use a HMI, such as a tablet or smartphone or just let it turn on when it senses motion, which is currently the scenarios used, but I am trying to make the smart home system an intelligent home system.  Through collecting, parsing and analyzing specific data it has become possible to anticipate events and program them so there is no interaction needed, such as how long someone is usually in the kitchen to prepare dinner, which lights are usually on, etc., so based on the parameters of what time of day it is and how long the lights are normally on in the kitchen,  I can program them to stay on for that period of time during a set period of hours. Example if motion detected between five and 7 then turn lights on for 48 minutes, else use the standard motion sense for the kitchen.

Thanks

Tom

Posted (edited)

I remember those days of trying to program everything. The one lesson I learned was that it caused more problems than it solved. The thing I learned was when stuff worked great it was the best thing in the world. However when it didn't, (even if 10% of the time) it was the most aggravating thing out there.

There's no perfect way to accomplish what you're trying to do and long term it'll probably be a bigger headache than simply using a button as you walk into a room or voice control. The system simply cannot account for intentions. Passing through the room multiple times in a 5 minute period will end up turning the fan on as the countdown would be extended. The times you (or someone else) may not want the fan on it would still trigger

With that said, I would change the time out on the sensor to something like 4 minutes. Then I would say if sensor was switched on and not switched off wait 5 minutes then set fan on.

The long delay allows the sensor to stay on just in case a person isn't moving alot while in the room. If it picks them up then It would continue to stay in the on position which would then trigger the fan on

Edited by lilyoyo1
Posted
10 hours ago, TomL said:

The logic for keeping the fan on is the same logic for keeping the lights on.  I turn the fan on when motion is detected and wait a given amount of time, 1 hour for example, depending on room, so if it senses motion during that period it resets the the time and continues to run, keeping them from turning on if someone just walks through the room, that is the part I can not seem to work out.  The walk through scenario would also be attributable to some lighting.

I can just tell Alexa to turn it on or use a HMI, such as a tablet or smartphone or just let it turn on when it senses motion, which is currently the scenarios used, but I am trying to make the smart home system an intelligent home system.  Through collecting, parsing and analyzing specific data it has become possible to anticipate events and program them so there is no interaction needed, such as how long someone is usually in the kitchen to prepare dinner, which lights are usually on, etc., so based on the parameters of what time of day it is and how long the lights are normally on in the kitchen,  I can program them to stay on for that period of time during a set period of hours. Example if motion detected between five and 7 then turn lights on for 48 minutes, else use the standard motion sense for the kitchen.

Sorry that I was not clear.  I was not questioning the logic of WHY you are trying to do it...I intended to suggest thinking a little deeper about the logic of HOW you want to do it.  Specifically, HOW do you want to determine whether a room is occupied versus simply passing through.  What are your thoughts on this?  Motion sensed every minute?   Every two minutes?  What constitutes "occupied" in your mind.  To me, and assuming that all I have is a motion sensor, I would tend to assume that occupied would be based upon regular motion triggers at some time period (and I will assume at least once per minute in this example).

To continue to the next stage, I would also reverse the order of your thought process.  Rather than thinking in terms of motion triggering a 5 minute wait, then (if "occupied") turn the fan on, what about first determining whether the room is occupied, then (after five minutes of occupation) turning the fan on.  Does that change things?  Does this give you any ideas?

Were this me, I would probably write a program that runs true when occupied and false when not.  Assuming an occupied state would trigger a motion detection every minute or less, an "occupied" program could be something like:

 

if

control motion sensor is switched on

then

wait one minute

run this program (else path)

else

nothing

 

If there are detections before a minute wait period, the program will re-trigger and start the countdown again.  After a minute of no motion detections, this program would run the ELSE path (and be false).  So long that motion is detected at least once per minute, this program remains true (THEN path running) the room is treated as occupied.

Given this first program, create a second program to wait for the 5-minute period to start the fan.  How about something like:

 

if status "occupied" program is TRUE

then

wait 5 minutes

turn on fan

else

turn off fan

 

I have not tried this, so you may have to experiment with the correct program steps and syntax, but I hope the logic is clear.  Of course, this all assumes that an "occupied" room will cause regular motion hits, which may not be true if someone is simply taking a nap or otherwise not moving around too much.  But given the assumption that all you have is a motion sensor, you may have to live with that limitation.

 

Guest
This topic is now closed to further replies.

×
×
  • Create New...