Relative Humidity Analysis as Occupancy Indicator

A brief analysis of some extant room sensor data was done looking for how relative humidity (RH%) may serve as an indicator of occupancy.

A month of data was used because there was an extended (10-day) absence in that month. Other months have been separately examined and seem similar, even in other seasons.

The existing notion of occupancy as built in to the sensor is shown/compared. That notion is based on manual interaction with the unit's controls, and ambient light levels.

The main files are:

Initial Analysis

A graph was prepared of the sensor data for occupancy and relative humidity for the entire month of August, consisting of 22930 raw stats data frames. (Not all frames carry all pertient data points.) Other data is present alongside those items graphed, but light levels were omitted from the data gathered (fixed for this sensor as of today, 2015/10/31).

Time stamps are UTC, and data may be sampled up to about 1 minute before the transmission, whereupon the UTC timestamp is applied and the data is logged,

Relative humidity is graphed as-is.

Occupancy is scaled such that a strong confidence of occupancy (3 in the stats) is shown as 100% (does not occur in this data set), reasonable confidence (2 in the stats) is shown as 50%, and vacancy as 0%.

occupancy/humdity

It is clear from the graph that the existing built-in notion of occupancy correctly avoids triggering when the room is not in use.

Possible Occupancy Measure

Inspection of the data suggests that a feature absent during the vacant period is a rise in relative humidity of >2%/hour. This won't detect completely continuous occupation, as a ceiling RH% will be reached, though may be more robust than light changes/levels alone, and in particular may detect sleeping occupants. Nor will this likely work in rooms with management of humidity such as with MHVR or (de)humidifiers.

Applying a crude filter as above with this script, comparing the current RH% with the last from the previous hour interval (eg such as in OpenTRV's stats history mechanism) yields this output for the August data set:

2015-08-03T01:26:55Z 399601 49 3
2015-08-04T19:22:59Z 399643 49 3
2015-08-05T16:43:02Z 399665 56 4
2015-08-05T16:51:01Z 399665 55 3
2015-08-06T23:07:05Z 399695 59 3
2015-08-19T18:15:38Z 400002 60 3
2015-08-19T20:23:38Z 400004 63 3
2015-08-20T16:23:41Z 400024 66 3
2015-08-21T13:23:43Z 400045 64 3
2015-08-23T11:03:48Z 400091 59 3
2015-08-23T20:11:49Z 400100 54 3
2015-08-24T08:43:50Z 400113 64 3
2015-08-24T08:59:50Z 400113 65 4
2015-08-24T09:03:50Z 400113 66 5
2015-08-24T09:27:50Z 400113 67 6
2015-08-27T17:58:59Z 400194 58 3
2015-08-28T19:16:02Z 400219 54 3
2015-08-29T15:18:04Z 400239 59 3
2015-08-29T15:28:04Z 400239 60 4
2015-08-31T09:29:08Z 400281 72 3
none of which are in the vacancy period, and most of which are plausible times. These are crudely inserted as green crosses in the graph below:

with occupancy detected by humdity

Some of those points look genuinely like occupancy (starts) missed by the existing mechanism.

For this month (October) these times are flagged:

2015-10-01T17:37:31Z 401034 58 3
2015-10-01T17:45:31Z 401034 61 6
2015-10-01T17:53:31Z 401034 60 5
2015-10-01T18:05:31Z 401034 59 4
2015-10-01T18:17:31Z 401034 60 5
2015-10-01T18:25:31Z 401034 59 4
2015-10-04T12:25:39Z 401100 65 3
2015-10-04T18:09:39Z 401106 65 3
2015-10-04T18:19:39Z 401106 66 4
2015-10-09T18:13:53Z 401226 68 3
2015-10-17T15:14:14Z 401415 63 3
2015-10-18T16:15:16Z 401440 70 3
2015-10-21T16:26:25Z 401512 77 3
2015-10-21T18:26:25Z 401514 81 3
2015-10-22T16:18:27Z 401536 69 3
2015-10-26T10:30:37Z 401627 76 3
2015-10-26T10:38:37Z 401627 77 4
2015-10-26T11:06:37Z 401627 79 6
2015-10-26T11:11:37Z 401627 80 7
2015-10-26T11:23:37Z 401627 81 8
2015-10-29T07:30:45Z 401696 81 3
Again, all pretty plausible.

January of 2015 shows rather more triggerings in the night that might warrant suppression of some responses to avoid nuisance (eg starting a boiler in the middle of the night) by being ignored if the room is dark or if the temperature is falling (which would make RH% rise of itself):

2015-01-01T14:18:09Z 394478 67 3
2015-01-04T12:06:30Z 394548 83 4
2015-01-05T01:22:29Z 394561 78 3
2015-01-06T00:26:32Z 394584 79 3
2015-01-07T01:26:36Z 394609 78 3
2015-01-11T11:51:55Z 394716 85 5
2015-01-11T12:18:55Z 394716 84 4
2015-01-13T17:39:03Z 394770 84 3
2015-01-15T01:21:04Z 394801 80 3
2015-01-16T17:13:08Z 394841 81 4
2015-01-16T17:17:08Z 394841 82 5
2015-01-17T17:48:11Z 394866 83 3
2015-01-19T18:27:02Z 394914 83 5
2015-01-23T01:23:44Z 394993 76 3
2015-01-23T01:27:44Z 394993 77 4
2015-01-23T17:30:46Z 395010 82 4
2015-01-23T17:35:46Z 395010 83 5
2015-01-23T17:43:46Z 395010 82 4
2015-01-23T17:53:48Z 395010 81 3
2015-01-23T17:55:46Z 395010 82 4
2015-01-23T18:21:48Z 395010 81 3
2015-01-23T18:27:46Z 395010 82 4
2015-01-24T18:30:49Z 395035 84 3
2015-01-24T18:33:49Z 395035 85 4
2015-01-24T18:51:49Z 395035 87 6
2015-01-24T19:19:49Z 395035 86 5
2015-01-24T19:23:49Z 395035 85 4
2015-01-25T13:23:51Z 395053 80 3
2015-01-27T15:27:56Z 395103 81 3
2015-01-28T00:23:57Z 395112 80 3
2015-01-29T17:04:01Z 395153 82 5
2015-01-29T17:12:01Z 395153 81 4
2015-01-30T01:20:02Z 395161 79 3
2015-01-30T17:12:04Z 395177 77 3
2015-01-30T17:16:04Z 395177 78 4
2015-01-30T19:27:04Z 395179 82 3
2015-01-31T17:36:08Z 395202 79 3
2015-01-31T17:40:06Z 395202 80 4
2015-01-31T18:28:08Z 395202 79 3

More Data

Continuing this thought, here's a graph that I've jammed a lot into, but it's tricky getting an overview when there are many sensors!

Basically it shows external temperature, boiler run-time and a scatter of all the relative humidity, computed occupancy, and valve positions over the first week of November 2015. I was testing and tweaking various software components, and the house was having work done and so I had the heating off entirely until 1st November when my family returned from a break!

ext temp / occupancy / humdity / valves

Home