I guess you are thinking about a pressure pad or contact sensor under a seat… that would indeed work for some rooms but not all.
I was thinking simpler, basically leaving the current mechanism intact but changing the subscribed event.
So I tried this (after creating a list of room devices for adj rooms - granted this doesn’t take the previous state into account yet):
subscribe(adjRoomList, “occupancy.occupied”, adjMotionActiveEventHandler)
subscribe(adjRoomList, “occupancy.vacant”, adjMotionInactiveEventHandler)
nothing that esoteric just contact sensor on doors or music player playing in room or TV being on in room or … etc.
since occupancy is a custom capability that event subscription will not work.
if I change the subscribed event from motion to occupancy changing to occupied it will break things for other users. so can’t just change that.
I am happy to create an option in settings to use occupancy change instead of motion to trigger adjacent room checking state. but before implementIng that need to understand if that would actually work as you are thinking it should and would it work consistent with how other users might expect it to.
unfortunately right now I am missing something. I know you have something in mind with this change that would make things work better for your usage pattern. but I am not able to see it yet. sorry.
will give it some more thought and see if I can figure it out.
@bangali now that there is a screen for locked settings, would you Consider adding an (optional) setting for locked timeout (similar to the asleep timeout) so we can avoid having a room accidentally forgot in locked mode?
Works fine at a first pass. I don’t use adjRoomsPathway, so didn’t even think about that but it’s easy to leave that subscribed to motion sensors. One glitch is if I leave the room and come right back, it won’t turn off the newly occupied room, so ‘infinite timeouts’ won’t work. For now I have just long timeouts but need to think about that one…
that was what i pointing to in my email -1. figured once you went through it you would figure it out soon enough.
wondering if you would be willing to try an experiment with one room setup with adjacent room and another room setup with an engaged sensor and see which one works better for you?
@bangali I have been having some strange behavior from engaged contact sensor and am not sure if this is expected or not.
Here is the scenario:
Room starts vacant, I enter and it becomes occupied with motion. I close the door and it is engaged
Then I go out and the room goes into checking when the door opens. All good so far…
Then I return and close the door. If the checking timer expired while I was out, the room goes to vacant and the process starts over and all works as expected.
However, if I come back (and close the door) while the room is in checking state, it doesn’t change back to engaged. Is this expected or a bug?
Problem is I really don’t have anything I can use as an engaged sensor. No doors get opened or closed, TV is hardly on and computer is on 24/7
Here’s what I did to tweak it a bit more, and it’s awesome when there is 1 occupant per room (which happens pretty often apparently). I used the Welcome Home presence sensors with the idea that 1 presence sensor = 1 person. (with multiple presence sensors per person, you’d need to combine them with Reliable Presence or similar)
Then modified the handler, moving the previous state check after the population check:
if (adjRoomsMotion && roomState == 'occupied') {
if (parent.getNumberOfRoomsOccupied() > parent.getHomePopulation())
{
child.generateEvent('vacant')
return
}
if (data.previous != "vacant")
return
child.generateEvent('checking')
return
Net result is lights turn on and off instantly as I move around, and the usual check and long timeouts functions as a fallback when per room population > 1
Bug report: Cannot set asleep button to toggle asleep to another room’s occupancy state button:
Create Room 1
Create Room 2
In room 2 go to Asleep settings
Button to toggle ASLEEP MODE
Select another Room Occupancy Object
Generates Error
Back out,
Subsequent returns to the settings screen shows an error screen Something’s wrong We cannot load your screen right now:
Room Log: 07b7ee4f-cf74-4dbc-9755-991d066f659f 10:47:19 PM: error groovy.lang.MissingPropertyException: No such property: buttonNames for class: script_app_rooms_chil_a530bbb9_5b9b_4363_8fc5_a33ef77ce0a7_ver_1_5
07b7ee4f-cf74-4dbc-9755-991d066f659f 10:47:15 PM: debug childCreated
07b7ee4f-cf74-4dbc-9755-991d066f659f 10:47:15 PM: debug childCreated
In this case my rooms were Master Bedroom and Master Bathroom. I was trying to tie the asleep state of the master bathroom to follow the master bedroom and set asleep when the master bedroom went to ASLEEP mode. 07b7ee4f-cf74-4dbc-9755-991d066f659f is my Master Bathroom…
When I turn on my desktop, power meter : 45 to 65. Room A is MOTION > OCCUPIED > ENGAGED ( 5 minutes ) > CHECKING > VACANT ( light turn off ) . Everything run good .
But after VACANT state, when motion detect again , it’s only OCCUPIED , no ENGAGED ( power meter : 25 to 65 ) . If I turn off, then turn on my desktop ( power meter : 0 to 65 ) , now the app go to ENGAGED.
Am I missing something or the app did not check power value for next process ?
the app does not check power value on motion rather only when it gets a new power notification which is why its going to engaged when you restart the desktop but not when there is motion and the desktop is already on.
I’d be happy to send you a PR asap. Need to make both parts optional and also not clobber adjRoomsPathway. Doesn’t look like the DTH changes messed up anything but I’ll keep checking the logs too. (Note to self: add a semi-automatic visitor mode)
btw, what’s the reason for this?
if (mV && mD > evt.date) return
I’m reading it as if there is further motion activity after the event, don’t do anything?
sure checking logs is good. if you want try it for a couple more days to make sure you are happy with the behavior. i will probably apply it locally first and check out the behavior before applying.
this is checking the in room motion sensor not the adjacent motion sensor. so if there was in room motion after the adjacent room motion you dont want the room to be vacated.
Played with AL a little bit, settled on a four-zone approach
Sleep: min level, min kelvin
Morning (wake up time + 2 hours) reduced level, max kelvin
Daytime: max level, max kelvin
Night: (after sunset) reduced level, min or interpolated kelvin (interpolated is sexier probably )
Sleep: min level, min kelvin
Maybe this could be a second AL option like “Auto - Interpolated” & “Auto - Threshold” or “Auto - Quad Zone”?
Also just setting up temperature maintenance, and I totally misunderstood offset - it sounds like it’s a setting to compensate for different readings from different sensors. I think “Temp Range” would be better in the UI.
And rules page title says “Maintain Lighting Rules” still even though temperature rules have been added.