Category Archives: DomotiGa

Charts

I’ve been collecting data from my different sensors:

  • Power consumption & kitchen room temperature from CurrentCost
  • Outdoor temperature & humidity via a DHT22 sensor connected to my Raspberry Pi
  • Server hard drive temperature via HDDTemp

Logging data is good but if you can’t look at it what’s the point?

I’ve therefore implemented charts on my SmartVISU page. This is achieved by using the adapted DomotiCharts script off the original Highcharts plugin.

The result is a nice chart that integrates really well with the look and feel of SmartVISU:

Temperature chart

Temperature chart




SmartVISU

With the recent additions of the RFXtrx, the LightWaveRF switches, the HomeEasy Remote Controlled sockets and the CurrentCost energy monitor, I have updated SmartVISU to take full advantage of these devices.

I’ve also updated the original template to use “my own” weather satellite images (as opposed to the original German ones):

And I’ve added a quick link to view my CCTV Camera feeds in real time.

To see the end result, click on the below pictures.

SmartVISU Control Center (Jan 2015)

SmartVISU Control Center (Jan 2015)

SmartVISU Weather Center

SmartVISU Weather Center

SmartVISU CCTV Stream

SmartVISU CCTV Stream




LightWaveRF Switches

OK I can make the buzzer beep if I forget the lights at night (see code from this post).

But that’s a little bit reactive, and still requires me to “move” and manually switch the light off. What would be better would be to switch the lights off altogether without requiring me to lift a finger.

This is where LightWaveRF comes into play. Not only they look really sleek, they fit in a standard connection box and are relatively cheap (when comparing with other standards).

I therefore bought a couple: 1 x 1 gang for the living room, 1 x 2 gang for the kitchen:

LightWaveRF 1 Gang Switch

LightWaveRF 1 Gang Switch

LightWaveRF 2 Gang Switch

LightWaveRF 2 Gang Switch

The way I chose to control them is to pair them with an RFXtrx transceiver via DomotiGa (see this post for more info).

I’ve still got to install the kitchen switch, but for now, I can control the living room lights from anywhere in the world !

LightWaveRF Switch via SmartVISU

LightWaveRF Switch via SmartVISU

I’ve also got some dimmable LEDs, but it turns out I can only dim them down to 50% instead of 0% (not much difference to be honest) so I might be looking for better ones soon. Watch this space 🙂




HomeEasy Remote Controlled Sockets

Next step in my Home Automation setup: remote controlled sockets.

I’ve therefore purchased a set of HomeEasy HE830s Remote Controlled Sockets (from Screwfix for those interested):

HomeEasy HE830s Remote Controlled Sockets

HomeEasy HE830s Remote Controlled Sockets

The first step is to get it working with the supplied remote. They’re fairly easy to pair (hold the button on the socket for 2 sec, then press the desired On button on the remote).

For the next step, since the HomeEasy sockets use a “standard” 433MHz frequency, they can be controlled by the RFXCom RFXtrx that I also purchased.

See this post for more information on what the RFXtrx is and how to pair a HomeEasy device with it.

The nice thing with the HomeEasy remote is that I can either pair it with a socket, or pair it with the RFXtrx to perform custom action within DomotiGa, or both.

For example I have set a Cinema mood scene: it dimms the living room lights, switches off the lights in the kitchen and switches on a floor standing light at the press of a single button 🙂




RFXCom RFXtrx Transceiver

Now that I have DomotiGa installed, I realise the potential for a much better home automation / smart home. I manage to convince the “boss” to agree to get some goodies, namely LightWaveRF smart light switches (see this post) and a RFXCom RFXtrx Transceiver (from HERE) to control them remotely from DomotiGa.

RFXCom RFXtrx Transceiver

RFXCom RFXtrx Transceiver

I specifically chose the RFXCom RFXtrx Transceiver instead of the LightWaveRF WiFi Link as it can control many other 433MHz based devices. The WiFi Link only controls LightWaveRF devices and is limited to 6 devices per room, 48 total devices (I’m not even sure if the RFXtrx has any such limitation).

To setup the RFXtrx in DomotiGa and pair it with a LightWaveRF Switch, this is what I did (under Ubuntu / DomotiGa):

  1. Connect the RFX
  2. run lsusb to make sure it’s correctly recognised
  3. Start DomogiGa
  4. Enable RFX Transceiver under Interfaces > RXFCom > Transceiver RFXTrx (note mine was listed under /dev/ttyUSB1, all other options left as default)

    RFXCom Setup

    RFXCom Setup

  5. Launch RFXCom Commander under Tools
  6. Make sure it shows Connected in green

    RFXCom Commander - Connected

    RFXCom Commander – Connected

  7. Go to Receiver and ensure AD/LightwaveRF is enabled

    RFXCom Commander - Modes selection

    RFXCom Commander – Modes selection

  8. Go to Lightning5 tab
  9. Select LightwaveRF for Type, select any ID (just remember what it is)

    RFXCom Commander - LightWaveRF

    RFXCom Commander – LightWaveRF

  10. On the switch, hold both On and Off buttons for ~2 sec until both amber and blue lights flash
  11. Quickly click on On to pair
  12. You can check it paired correctly by sending Off and On commands.
  13. Now you can add it as a Device, the address to enter for the dimmer switch in DomotiGa is in the form ” abcdef 1 “, being the 6 digit ID + the Unit Code. (in my example ” 010102 1 “)



CurrentCost Energy Monitor

I received a free energy monitor a few years ago.

CurrentCost Classic

CurrentCost Classic

At the time I did notice the socket underneath, but never got round to getting a cable and software to take full advantage of its use.

After the initial novelty (seeing on a screen how much energy I was using), I ended up putting it in a cupboard.

However since I started using DomotiGa for my home automation setup, and since it appeared to be supported, I started to think about it again. I eventually sourced a cable (HERE)

CurrentCost USB Cable

CurrentCost USB Cable

The setup with DomotiGa was fairly painless: after enabling the CurrentCost energy monitor option and selecting the correct ttyUSB, the data was captured, namely current consumption, max consumption and temperature.

I added this straight away to my SmartVISU page 🙂 :

CurrentCost data in SmartVISU

CurrentCost data in SmartVISU




DomotiGa, SmartVISU & Raspberry Pi

I’ve done it ! Finally completed installation of DomotiGa and SmartVISU. Below are only screenshots of draft setup as I still have to add some sensors and improvements, but it’s a start.

DomotiGa

DomotiGa

 

As DomogiGa is not directly compatible with GPIO ports (and since it’s installed on a different server anyway), my DomotiGa sensors are actually Shell devices which point to Python scripts (which connect to a MySQL DB and return the value of each sensor). Each Shell device gets automatically updated every 300 sec in DomotiGa by default, so to ensure I get live data I have added JSON-RPC calls in my GPIO script:

My GPIO Python script calls a bash file that contains the JSON-RPC Call:

curl -sS -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d '{"jsonrpc": "2.0", "method": "device.set", "params": {"device_id": 2, "value": "On"}, "id": 2}' [server_ip_address]:9090

(I always send the value “On” but since DomotiGa will run the Python script following the JSON-RPC call it doesn’t matter)

My Python script for DomotiGa Shell Device:

import MySQLdb as mdb

con = mdb.connect(sqlhost, sqlusername, sqlpassword, sqltable)
cur = con.cursor()
cur.execute("SELECT pinStatus FROM pinStatus WHERE pinNumber=22")
row = cur.fetchone()
if(row[0] == '1'):
print "On"
else:
print "Off"
con.close()

My SmartVISU page contains this type of script for each device:

{{ basic.symbol('PIR1_Off', 'PIR1_switch', 'PIR 1', icon1~'message_presence.png', 0) }}{{ basic.symbol('PIR1_On', 'PIR1_switch', 'PIR 1', icon1~'message_presence_active.png', 1) }}

 




Domotiga

I’m planning (although at this stage it still more like dreaming) to take a major step in my setup: go away from the do-it-yourself / reinventing the wheel and start using a ready-made solution.
I spent some time looking around for an open-source solution. I was looking for something simple, with a web interface and narrowed down the contestants to 3: DomotiGa, Domoticz, Domogik.

I eventually made up my mind and chose DomotiGa as it seems the most versatile, robust and hardware compatible. I’m currently installing it on a Ubuntu box (the one on which this server is hosted).

And I’ve just found out a visually stunning interface called SmartVISU that can be plugged onto DomotiGa:

SmartVISU Screenshot

SmartVISU Screenshot

Watch this space 🙂