Category Archives: 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.




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"
print "Off"

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) }}



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 🙂