Adding control to emoncms: RFM12b Packet Generator

I've had many conversations with people recently about controlling things like radiator set points, boiler thermostat's, heatpump's and so on.

I visited John cantor of http://heatpumps.co.uk/ today who is implementing an impressive control and monitoring system for a heatpump central heating system which involves EmonGLCD's with relay's connected to radiator valve actuators in each room. The buttons on the EmonGLCD are used to set the target temperature for the room and information is displayed on the EmonGLCD about heatpump power input and outside temperature.


On the way back I stopped at the Centre for Alternative Technology where Marnoch who is on their student placement there is working on doing something similar but for a radiator system connected to a wood chip boiler.

Both Glyn and Ynyr are keen to get boiler thermostat controllers working in their houses and Ken Boak who designed the NanodeRF phoned up the other day suggesting we start an openenergymonitor sub project and discussion on this topic, Ken's been working on central heating control for quite some time.

Its something I have a growing interest in too as we will be soon installing a heatpump system at home which has a lot of opportunity for control and monitoring to make sure its running efficiently.

So I've been giving some thought to how control features could be added to emoncms in a more integrated way than initial efforts I've made before.

I like the simplicity of the way Jean Claude Wippler designed the jeelib library to use c structures as the method in which data is packaged and sent via the RFM12b radio's and so I thought that maybe a good basis for adding control functionality to emoncms would be to first make it possible for emoncms to easily generate RFM12b data packets in the format that can be easily decoded with a struct definition on the listening control nodes. Emoncms would then broadcast this control packet containing all the state information about the system at a regular interval in the same way as an emontx broadcasts it's readings. Listening nodes can then be programmed to selectively use variables in that control packet depending on what they need to do.

I've put together an initial working concept of a module that can be used to do this and its up on github here: https://github.com/emoncms/packetgen

Here's a screenshot of the main interface:


One of the nice things about it is that as you generate your control packet the module generates example Arduino code to make it easier to start coding a control node, you can just copy the code any drop it into the Arduino IDE and upload to a atmega+rfm12b based node and it should start receiving the control packet right away.

I see this module and control in general being run on a local installation of emoncms running on a raspberrypi + harddrive combination rather than emoncms.org. The next step is an image with all this installed and working out of the box.


To engage in discussion regarding this post, please post on our Community Forum.