How would you create this condition set

This forum is for questions about conditions.
srkinard
Posts: 320
Joined: Sun Apr 10, 2016 5:55 pm
Location: Austin, Texas

How would you create this condition set

Post by srkinard »

I've barely started on this, so it's not a scenario I've fully developed and have issues with...but I figured I would describe what I aim to do and see what methods different folks with previous experience using Indigo would do to solve for it.

What I want to achieve is to have a motion sensor in the bathroom detect motion and turn the lights on, then after I leave it would turn them off.
But it will have some other conditions.

Depending on the time of day I want the brightness level to vary. Mid-day it should be fairly bright. After 10pm it would be lower lighting, with dependency on if I've gone to bed or not.
If my bedroom lamps are still on, then a normal brightness of say 30% since those lamps will determine that I'm still basically "awake" at the time. If the lamps are off, I'd go for like 5% so if I go in there it's probably half-asleep and don't want bright lights blasting me.

Now, this I've been able to achieve without issue since it's pretty basic logic.

What adds complications are this...if I set the off time for a short delay (desirable for the 2am "gotta pee" scenario) then it turns off the lights too fast if I'm in the closet, tub, etc and outside the range of the sensor. I don't want to turn the sensitivity up a lot because the cat would then trigger when she goes in to get food/water from her bowls.

I kind of want it to be configured where the motion sensor only turns the lights off if it was the one that actually switched them on. Meaning if I turn them on via switch or Indigo Touch, the motion sensor logic will leave them alone...unless there has been no motion detected for say 30 minutes (i.e. I forgot to turn them off and left.)

I'm just curious how others have set up assorted motion-triggered event handling...maybe learn about some of the "gotcha" points from their experiences.

Thoughts?
howartp
Posts: 4559
Joined: Thu Jan 09, 2014 4:43 pm
Location: West Yorkshire, UK

Re: How would you create this condition set

Post by howartp »

I have a wireless door sensor on my bathroom door, in conjunction with the motion sensor.

If the door is closed (someone is on the loo or in bath) then light never goes off; otherwise it goes off 1 minute after motion stops, by a schedule. (Condition: light is on, motion is off, door is off).

My motion sensor (Fibaro) send 'off' 30 seconds after no-motion from memory.

Instead of door sensor, you could have the 'off' triggers/schedule disabled (so they don't turn off if you manually turn on light) then enable them within your motion trigger.

Also have a trigger on 'light on' that sets 30 minute delayed off, and an extra action on motion that resets this delay to 30 again.

Some thoughts to mull over there. :-)


Sent from my iPhone using Tapatalk
User avatar
Colorado4Wheeler
Posts: 2794
Joined: Mon Jul 20, 2009 10:48 am
Location: Colorado

Re: How would you create this condition set

Post by Colorado4Wheeler »

Doing what you want to do with a single motion sensor would be difficult and may end up being a constant source of frustration in trying to get it to work. I've done similar things in my house and can tell you that even with multiple motion sensors the algorithm is tricky and if you have more than one person in the house then it can get really complicated.

The suggestion of the door sensor is probably your best option since there is a definitive "opened" and "closed" state - but this relies on the fact that you close the door entirely each time you use the restroom (which if you are just going in to wash your hands may not be intuitive).

How I have achieved something similar (I do what you are requesting but on a scale of every major room in my house) is to basically have an action for the rooms motion sensor to turn on but auto off after X minutes if there is no further motion.

In an active room this is pretty easy as each subsequent motion continues the "trigger" that the light should remain on.

In an inactive room (such as an office where you may stay relatively motionless for periods of time) I incorporate sensing that someone entered the room and the light goes on and use an algorithm for motion sensors in adjacent rooms using a modifier of how many people are currently present in the house to determine if either the person who triggered the light is now leaving or if a second person has entered that same room.

For example, my office has a motion sensor that turns the light on. If motion is detected in the hallway BEFORE my office and THEN my office then I know another person came in my office because it would be impossible to trip the hallway sensor without tripping the office sensor. Likewise if the office sensor is tripped and shortly thereafter the hallway sensor is also tripped and there is just one person home then I know I left the office - however if another person is home then I have to know the state of yet another motion sensor to determine if THAT person may have entered the hallway shortly after I made some motion in my office (that would result in a false positive of me leaving). Like i said, the algorithm can get very tricky and I spent many frustrating hours writing hundreds of lines of python code getting it done.
My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here
howartp
Posts: 4559
Joined: Thu Jan 09, 2014 4:43 pm
Location: West Yorkshire, UK

How would you create this condition set

Post by howartp »

Colorado4Wheeler wrote:The suggestion of the door sensor is probably your best option since there is a definitive "opened" and "closed" state - but this relies on the fact that you close the door entirely each time you use the restroom (which if you are just going in to wash your hands may not be intuitive).
Not at all.

If just washing hands, or a bloke standing at the toilet, the light still comes on by motion but goes off after 1 minute of no-motion because the door isn't closed.

It's only when you're long-term in there (sat on loo or in bath/shower) that you need to shut the door, which prevents the light going off.
Post Reply

Return to “Conditions”