The purpose of a domotica system is to make life easier, so to start with, let’s not make things too complicated for the end user.
Here’s a diagram which imo contains already a lot of functionality:
Let me explain:
The Domotica Server Application
This is the brain of the system. It takes care of about everything, and should be easily extendable through plugins with a plugins repository. It should also be able to update itself (Update repository). A script engine would also be nice to extend the system.
The rules engine will be used for things like “When value of X >(<,=,>=,<=) Y, do Z” where X,Y and Z can be a plugin, script, actor, email, fixed value, whatever.
The scheduler speaks for itself I think. “At xx:yy do Z” where Z can be plugin, script, actor, email, …
I mentioned twice the word “actor”, what is this exactly? An actor is an endpoint in a domotica system, like a remote controllable switch to turn on/off lights. Or a remote controllable module to lower/rise your blinds, curtains. Example:
The Message Parser will parse the messages coming from the plugins, rules engine, scheduler or the Cobra, and act upon them.
The Data layer does nothing else then handling the data in the database. Should be as generic as possible to allow other databases than MS SQL to be used (like mySQL, …).
The WCF Webservice will be responsible for the interaction between the various GUI’s (Web frontend, Touchscreens, PDA’s, Smart Phones, Mediaportal plugin, …)
The logging engine, what do you think, indeed, log various system events (no data from sensors). Things like error logging, and should be user configurable for the severity.
The hardware side of things
Here we can go every direction, but we should start somewhere and a good start is the fantastic Cobra board provided by GHI Electronics. It is powerful, has a lot of memory, build in network, SD Card and has a lot of IO’s. It will be the nerve center on the hardware side.
Fez Cobra:
This can control RF(315, 434, 868, 2.4Ghz), talk to the Panda over serial (see below), control your heating, open your garage door, do whatever you like.
Fez Panda
This board will be used to monitor Electricity, Gas and Water consumption by means of a KWh meter with open collector output, and Hall-effect sensors for Gas and Water usage. The data will be send to the Cobra using JSON messages over Serial. (Why JSON and not XML or a plain string? Easy, JSON is very lightweight and can easily be converted to an Object again.) Another question that comes up is why use a Panda only for logging, if the same can be done on the Cobra. Well, I didn’t wanted to loose logging information as I extend/update the Cobra.
How do you measure Electricity usage? That brings 2 options: Whole house consumption and individual consumption. For whole house consumption you need something that sits between your meter box and your fuse box. Here again some options. You can go for a digital kWh meter with a pulse S0 output:
or you can go for:
The first one is invasive, meaning you have to connect the wires coming from your utility meter box to the kwh meter, and then again to your fuse box.
The second one is non-invasive and just clamps over the wire going from your meter box to the fuse box. This is less dangerous, and less accurate, and all calculations need to be done in the Panda.
Then if you want individual measurements (like what is my server rack consuming) there are also various options, though will mention here only one for now, and that is called Plugwise:
Simply put, you plug a plug between the devices you want to monitor, and the data get send wireless to the pc over ZigBee. It has a lot more functionality like standby killer, but that out of this blog’s scope.
The water consumption is another story. I was fortunate to have a water meter installed by the water company that had an opening to install their sensor. I used this setup for about a year, but it became less and less accurate due to the reed contact they used. I canceled this subscription, and after they took the reed contact out, I installed an allegro hall effect sensor. Since then I never missed a pulse.
Same for the Gas consumption. My meter was also prepared to have a pulse counter installed. Again, I figured out that there was a magnet turning when there was gas consumption, and it took me less then 10 minutes to figure out that a hall effect sensor was the way to go again. (picture will follow)
We will also need remote sensors. Here we are still not clear which route to go. Shall we go for XBee (expensive), or maybe JeeNodes, or something custom with a NRF24L01 or RFM12B transceivers. Both are pretty cheap and keep your nodes at a reasonable price.
Jeenodes:
NRF24L01:
RFM12B:
XBee: