Having got a room sensor up and running on the bench, I now want to log the values somewhere. I’m still searching for a Home Automation server that ticks all the boxes, so for now I’ll use HouseMon from Jeelabs. The birds-eye view of how it works is here, and the source can be found on GitHub here.
On my Linux server I cloned the github repo, installed the prerequisites and ran it up to check it worked. To customise HouseMon for my room node I created a local nodeMap, briqs/nodeMap-local.coffee, that maps the RF12 group and node ID (5 and 22 respectively) to the airwickNode driver, and also names the current location of the sensor. I then created a new driver, drivers/airwickNode.coffee, that describes how to extract the data from the rf12 packet transmitted by the airwick node.
The local nodeMap is relatively self-explanatory:
1 2 3 4 5 6
but the driver is more interesting:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
Each field in the packet is given a description, and where appropriate some units, min and max values and scale and factor values. Scale and factor are used to convert the fixed point integer value from the driver into a decimal value for display. For example, a temperature value of 226 is 22.6°C, so this requires a scale of 1 to divide it by 10. The Vcc values require both scale and factor and an offset to turn a value of 117 into 3.34V. The offset is supplied by the decode function where 50 is added to the raw packet value, giving 167, a factor of 2 gives 334, and a scale of 2 divides it by 100 to give 3.34.
With these additions, the Housemon instance is then configured from the admin page:
Note the items I’ve installed, the only item that required a configuration setting was the rf12demo briq and that requires the serial port that I’ve attached the JeeNode to, in my case ttyUSB0.
The following images show the HouseMon Readings, Status and Graphs pages, with the temperature selected on the Graph and the timespan set to 24 hours.