Rooms Manager: Smarter Rooms: Personalized home automation with Occupancy

gotcha. i see what you are saying. let me see if i can fix the timeout to trigger only after the power stays below that many seconds when there is no motion sensor.

will work on this tomorrow if thats ok?

That's fantastic. Thank you for taking the time to help me out!

1 Like

actually shouldnt need a code change … try setting the checking state settings to:

Dim timer ・ ・ ・ ・ ・ ・ ・ ・ 120 seconds
By level ・ ・ ・ ・ ・ ・ ・ ・ 50%
To level ・ ・ ・ ・ ・ ・ ・ ・ 20%

and see if that does what you are looking for.

That would probably do it, but the same problem is happening in another room that does have a motion sensor as well as a power meter on a TV. The countdown timer always starts, even if the TV power draw is above the threshold. I removed everything and reinstalled last night and the behavior still persists.

Is the timer supposed to be paused while the power level is above the threshold? Or does it always require motion to reset?

just clear the timeout setting in engaged settings and save the room settings. you didnt need to reinstall the software :slight_smile:

that particular timeout is for motion triggered timeout. whats happening is when there is no motion sensor and motion timeout value is specified its always triggering the timeout when the room changes to engaged. i should probably block that timeout value from being set when there is no motion sensor or use that timeout value for any kind of engaged device. but if you make the change above that will do what you need without waiting for any code change.

When trying to update a room i get a error. Can't see anything in logging.
image

image

@woobins i was thinking about why the logic is the way it is here … its been a while since i finalized those portions of the code so needed to think about it a bit. :slight_smile:

so heres the difference:

  1. motion is an intermittent event in that people could be in a room and move only in certain intervals. so i wanted to allow for that countdown before triggering the checking state to give the person a chance to move in that timeout interval without causing the light to dim because it moved directly to the checking state.
  2. any other triggering event like power is treated as a continuous event as in once the power goes down and stays below the defined threshold its presumed that the person has left the room and the checking state is triggered immediately which dims the lights then changes the room to vacant.

hopefully that makes some sense :slight_smile:

1 Like

may be do a soft restart of the hub and see if anything shows up on the hub log afterwards when saving the room?

Can I request a code mod please?

I have a mode setting which is 'Sleep'. Would it be possible to have 'Asleep' mode set when the mode is set to sleep? Currently I am using rule machine to set a virtual switch when in sleep mode, which then switches the bedroom into Asleep mode in Room Occupancy.

good idea. would need both asleep and awake. also needs a flag to only use the mode to set asleep for certain rooms.

Already tried, don't see anything. I guess ill redo that room.

ok. the only clue i see in that snippet is before the second updated message the motion active event handler gets triggered. are you in the room while updating the settings and are triggering the motion sensors while saving the settings and in turn that is causing some sort of glitch?

updated to github with the following change:

Version: 0.99.6

DONE:   5/5/2019

1) added mode trigger for asleep state 

@dwspmail that change was updated to github with the true confidence of a dev … even though one would think one would know better. (translation: released without testing … please test the change :stuck_out_tongue_winking_eye:)

Thanks @bangali. I'll give it a test.

1 Like

I seem to be having issues.

I implemented the updates and now I have a mode setting to set the Kitchen Occupancy into Asleep mode. Great.

However I know find that when I select the location mode to Sleep, it does not place the room into Asleep mode. Also I found that my timer countdown had frozen at 5s. When manually forcing it to vacant the lights turned off, as they should, but then they would not turn back on when motion was detected.

My hall occupancy is still functioning correctly. I just seem to have broken the Kitchen Occupancy.

Have you been able to test yourself?

any error in the logs when you change the location mode to sleep?

Good evening @Bangali, I've carried out some testing and also had a look at the logs. I found that I was getting an error when switching to sleep mode. However i'm not sure whether it would cause any problems as it was only down to the version number of the child app and device driver being different versions. They weren't in actual fact different versions, I just thought I would be clever and change the version number in your code from 99.5 to 99.6 (which I guess you forgot to do). I did update the app and driver code to the latest incorporating your mod. So does this cause problems when running a child app that is indicating a different version number to the device driver? Anyway, I just changed the version, in the code of the device driver to 99.6 and I no longer get an error.

To simplify my investigations I decided to disable all the child apps apart from the Hall Occupancy and applied the Sleep mode to Asleep occupancy mode. This worked fine. I then set the Hall light to turn on when in Asleep mode, using it as a night light, but to turn off after 30 seconds rather than 5 minutes of activity. I discovered some further issues in doing this.

  1. I am using the Original Aqara Motion Sensors, but didn't realise that even if you set in the driver for the Active state to reset to inactive after 15 seconds, it doesn't recognise further motion until after 60 seconds. Therefore I was finding that even though there was continued motion after 15 seconds the light was turning off and then turning back on after 60 seconds when further motion was detected. Therefore I have realised that I can't set a timeout which is less than 60 seconds. I believe there is a hardware mod that can be made to get around this, which I will look into later.

  2. I have discovered that you can't allocate the night light to be the same light used for occupancy. When I was in Asleep mode and motion was detected, I saw the light being very briefly turned on but then turned off again. When I set the night light to another light it turned on and stayed on for the correct time out period. Can you possibly do another mod where if you select the same lights for night lights then it won't turn them off when changing to Asleep mode?

strange i forgot to change all of the version numbers. so they should all have been at 0.99.5 and not thrown the error in the logs.

yes it does cause issues when they are different.

i think your code itself still may not be in sync. i am pushing an update in the next few minutes with the version number change. please update the code for the driver and all 4 apps.

  1. right the timeout cant be lower than the hardware timeout.
  2. might be a bit tricky because when switching away from one room state to another it finds all lights not reference in the current state and turns them off. these are done in different routines. i will take a look.

I'm trying to create dashboard buttons to change a rooms mode using the button template. But I don't see button actions being logged when I hit buttons in the device page. The only button that triggers a log entry is PING and that throws an error.

[dev:1954](https://192.168.1.10/logs#dev1954)2019-06-03 09:59:39.764 pm [error](https://192.168.1.10/device/edit/1954)groovy.lang.MissingMethodException: No signature of method: user_driver_bangali_rooms_occupancy_1093.ping() is applicable for argument types: () values: [] Possible solutions: find(), print(java.lang.Object), print(java.io.PrintWriter), find(groovy.lang.Closure), print(java.lang.Object), run() (ping)

When I create a button on dashboard I can use attributes to grab your icons for a background button while the assigned button number does nothing upon a dashboard tile press.

Am I doing something wrong or is that feature no longer supported (It worked under the old dashboards)?

Is it possible to have acceleration (multipurpose sensor) trigger busy? This would be the most ideal sensor in the case of my office. When I'm sitting in a chair the sensor would easily detect me vs. a motion sensor.