I have guest room with motorized blinds. The blinds are set to auto open at sunrise. If we have guests, however, I want this to be skipped.
My planned solution motion sensor in the room. Have it look at the time window from 8p-11p. If during that time it sees more than 15 mins of motion, skip the auto open. If it sees less than 15 mins of motion, continue with auto open.
(the room does get entered by me and my family at times when we don't have guests, so a simple "if any motion from 8-11" wouldn't work....I need to set it above a threeshold so that if I walk in and out it will still do the auto open in the morning.
My current thought: Hub Variable of a number. Then a RM where when motion is sensed, it saves the time in a local rule variable. Then a wait for event "no motion". Once no motion, capture that time stamp and subtract if from the origional one.....and add that to the hub variable. (There would be a separate rule for every day 1am set the hub variable to zero).
Then in my auto blinds open rule, have it look at the hub variable as a condition: If less than xx mins, continue. If more than xx min skip auto open.
This is a working solution, but is also a bit of a clunky one. Before I go through all this effort I wanted to make sure there wasn't a better/more efficient/more creative way to tackle this.
My device has already been chosen....i'm going to use a zooz zen12. I wanted that so that I could have a mains powered device that was "part of the room" an not a alone sensor mounted in the corner.
I would probably do this with two rules
Rule 1 -
Trigger - Motion Sensor Active
Actions -
Set Private Boolean False {Your Rule Name} Rule
Wait for Motion sensor Inactive AND STAYS for 15 minutes
Set Private Boolean True {Your Rule Name} Rule
Second Rule (which is the automation for blinds up/down), just add a required expression that Private Boolean is true
Cool....yeah similar to what I was proposing but more compact. This would require the occupant to be in the room for a full 15 mins in a single event rather mine would account for, say x3 5min visits......
Which to be honest, mine would more likely trigger a false event. There could definately be secnarios where i'm in and out a quickly a handful of times and those could all add up to 15......but I would rarely just be in the room for 15 mins. However, any guest, would forsure have at least a one 15 min long event (likely more).
Your proposal is inline with what I was thinking but more efficnetn and more accurate. Thanks!
My rule doesn't require someone to be in there for 15 minutes. It only requires that they not be active for 15 consecutive minutes if they are initially detected. You could also use a conditional trigger between two times (like the 8-11). I would not use required expression for the first rule, as that could cause an issue if someone is detected at anytime after 10:45 in not resetting the rule.
I didn't know Rule A can control the private boolian (local variable) in Rule B. I thought the local variables were not visible by other rules....super cool
Does it have to be a motion sensor? I just use a virtual switch for the guest room. On means guests are staying with us, Off means no guests. The virtual switch is a Required Expression so your normal rule to open the blinds would require the virtual switch to be off.
Also, if you are trying to automate opening of the blinds while guests are visiting, I would look to use a contact sensor on the door instead of or in addition to the motion sensor. You could trigger the guest visiting rule based on contact being open and stays for 20 minutes during the morning time period. Basically, if the door opens and stays open for 20 minutes during the morning, then open the blinds.
One for Company and that delays lights and the such from operating at early and late times in guest spaces.
The other adds/removes a presence sensor to all my pistons so I can give a guest the 'you live here' treatment when the come and go; locks, alarm, furnace etc.
That is how I would do it. If the guest goes in the room 10 times for about a minute, you want to capture that as the room being active for ten minutes.
I'm not an RM guy, but here is a Webcore piston that does that. I tested it and it works great. The sensor I tested with times out in 30 seconds, so I have it track cumulative seconds, and then convert that to minutes to add it to the hub variable.