Category Archives: SmartVISU

Goodbye DomotiGa, Long Live Home-Assistant

Notice: Undefined variable: amazondisplaywidget in /var/www/html/wordpress/wp-content/plugins/wp-auto-affiliate-links/aal_engine.php on line 503

Following what I think is due to a general OS update, SmartVISU no longer connects to DomotiGa. I’ve tried to fix it, but I’ve thought for a while now to transfer everything over to Home-Assistant since support for IoT devices is much better and update are a lot more frequent

So I’ve finally taken the plunge. One of the main hubs that was used in DomotiGa was the RFXTrx433 Transceiver. I’ve disconnected it from DomotiGa and added it to Home-Assistant. I’ve spend the best part of 2 weekends and several weekday evenings recreating the devices and events that were in DomotiGa.

Home-Assistant Main Page

Home-Assistant Main Page

There’s still a lot of work to be done, but I’ve done the most important bits. I’ve also broken down the content on several pages unlike cramming almost everything in one page like I did in SmartVISU.

I’ve also used this an opportunity to save my config to GitHub for back up and in case it helps someone else.

The only thing I’ll be missing as not built-in is the data from my CurrentCost Sensors, but I’ll be running a light version of DomotiGa to send that data to my Home-Assistant setup.

LED Strip Lights

For a while now I’ve been wanting to add some LED Strips to my setup.

I wanted to get colour changeable strips that I could remotely control via DomotiGa.

I ended up getting 2 controllers based on the customisable H801 chip from AliExpress:



The downside is that I needed an Android Phone to set it up (Connect to my WiFi network), but once done, I no longer need the Android Phone.

In the future I’ll update the firmware to customise it and make it more secure, but for now it works relatively easy.

With advice taken from this post, I managed to create a simple script to send commands to the controller:

  • The first IP address is the address the command is sent from
  • The second IP address is the address of the H801 controller
  • The actual command is made of several parts: 0xfbeb 0000000000 79979d 00:
    • 0xfbeb is constant
    • Next come the hex values for the colours R G B W1 W2 (0000000000)
    • Then comes part of the controller’s MAC Address, in reverse order. The MAC Address is 18:fe:34:9d:97:79
    • The last bit (00) is again constant

This simple method allows me to easily switch the strip on and off and change its colour, and the results are quite impressive:

LED Strip Under TV Cabinet

LED Strip Under TV Cabinet

LED Strip Staircase

LED Strip Staircase


Because I have 2 controllers, I wanted to use a single script and parse as an argument the controller number that I wanted to communicate with.

The end result is the below script:

Note: I only soldered the RGB and Vcc pins as I’m not looking to use the white channels, hence the hard coded 0000 in the above script

All I need to do now to change the colour [to purple on the 1st controller) is to call the script as follows:


Now to take it to the next level, I created a separate script to slowly run through the colour spectrum. I mainly run it at Christmas so called it (hence the command in previous script to kill this one if running):

For the below movie, I’ve reduced the wait time (normal cycle takes about 1 min)

I then added the strips as devices in DomotiGa.

They are added as virtual devices, with Value1 being the strip’s status (on|off) and values 2,3,4 carrying the decimal value of the R G B colours respectively:

LED Strips - DomotiGa

LED Strips – DomotiGa

Then all I had to do is to call an action when one of the values of the device changes:

And finally in SmartVISU I added a device:

LED Strip SmartVisu

LED Strip SmartVisu

Clicking on the colour brings the colour picker:

ED Strip SmartVisu Colour Picker

ED Strip SmartVisu Colour Picker

New version of DomotiGa & SmartVISU = New Plots

DomotiGa was upgraded over the Easter weekend as well as a new version of SmartVISU bringing an improvement on plots.

Whereas before the plot function would pull the complete list of values to build the chart (and therefore would just time out, especially with my CurrentCost power consumption as it updates every 5 sec), the revised version has a new parameter for the maximum number of points to return.

This means I can now plot ANY of my devices’ values:

SmartVISU Plots

SmartVISU Plots

The easiest way to know where to put that new value (mine’s set to 2500 as any higher seems to time out) is to open widgets\plot.html


Calendar Widget with SmartVISU is back!

On 17th November 2014, Google closed its V1 and V2 APIs:

The Google Calendar API moved to version 3 months ago; however, many developers have continued to hang on to v1 and v2 integrations. In less than a month, on Nov. 17, Google will shut down v1 and v2 in accordance with itsDeprecation Policy. Google has published an entire Migration Guide to assist developers’ transition, and many third-party solution providers have released packages to further streamline the process.
This meant that the Calendar widget on SmartVISU was no longer working.
CarGo kindly created a guide on how to create a V3 API so the calendar would work with SmartVISU.
Trouble is, CarGo wrote it in German, so I’ve translated it below. It may sound complicated, but then it’s only required once 🙂

  1. Log in to the Google Developer console:
  2. Create a “Project” -> You can simply enter “Project API”, unless you’re planning on creating many APIs / Apps, it does not matter at this stage
  3. On the left menu, select “APIs” then “Calendar API” on the main page.
  4. On the left menu, select “Credentials” then click on  “Create new Client ID”
  5. Important: Select “Installed applications”, NOT Web Application – otherwise you’ll have to grant access each time in a pop-up…
  6. On the left menu, select “Consent screen”. The main info to provide here is the Product Name. I called mine SmartVISU.
  7. Select “Installed Application” then “Other” for application type, and finally “Create Client ID” .
  8. Now under “Credentials” from the left menu, “Client ID”, “Client Secret” and “Redirect URIs” are displayed. We’ll need these in the next steps

The access details are now configured. The trick is to create an “Authorization Code” and “Refresh token”.

To do so, download and extract it in “[path]/smartvisu/lib/calendar/service”.  (Replace [path] with the path to access your SmartVISU folder)

Make sure the file owner is www-data else you’ll get errors. To make www-data the owner, simply enter the below in a terminal:

  1. Getting the “Authorization Code” and “Refresh token”:
    1. Enter the values ​​for “ClientID” and “redirect URI” in “google_1.php”
    2. Paste the below command in the terminal
    3. Click on the link in the terminal (you may need to hold CTRL while you click)
    4. Confirm you want to grant access to your Google Account
    5. Copy the “Authorisation Code” displayed
    6. Enter the values ​​for “ClientID”, “Client Secret”, “redirect URI” and the code copied from above step in “google_2.php”
    7. Paste the below command in the terminal
    8. Keep note of the provided “Refresh Token”.
    9. Edit “googleV3.php” and replace the blanks for:
      1. “ClientID”
      2. “Client Secret”
      3. “Redirect URI”
      4. “Refresh Token”

Last but not least, edit config.php in your main SmartVISU folder and add replace your google calendar line with the new script:


Save,  Et Voilà !

Massive thanks to CarGo for the original work and guide.

Google Calendar Widget V3 API

Google Calendar Widget V3 API

PS. There may be a need to refresh the token in the future. I’ll post an update as and when it occurs. If this happens, Ideally the refresh should be automated, but that’s a story for another time 😉

SmartVISU Plot Charts

With the release of DomotiGa v1.0.020, it is now possible to use SmartVISU plot charts directly instead of importing a 3rd party tool like HighCharts (see previous article about HighCharts).


  1. Make sure you use the correct DomotiGa drivers for SmartVISU (you can get them here: io_domotiga.js and io_domotiga.min.js)
  2. If not yet done, you’ll also need to ensure you are tracking the value changes by enabling Log value history to database under the Options tab
  3. Name your device values correctly: the device name ideally has no spaces, the datasource name will be made of devicename_plotx where x is the device’s value (1 to 4). In my example, HDDRoot is the name, the Hard Drive’s temperature is in value1 so the datasource name is hddroot_plot1:

    datasource name

    datasource name

  4. Use this command in your SmartVISU page:
  5. Explanation of what each parameter means is provided by SmartVISU HERE

The result of my setup is this:

SmartVISU Plots

SmartVISU Plots

Note: I just added 2 hard drives to my server for storage and backup purposes (see this article), so there has not been enough time yet to track their temperature changes in the above charts.

Current Cost’s IAM

Having moved one of my PIR‘s in the living room to automate the lights in here too, I quickly realised there was a major flaw: when I watch the TV, I tend to move very little. This results in the lights turning off when I want them to stay on.

I had to find a better solution than waving my arms every 5 min or so to keep the lights on.

I found out Current Cost do IAMs or Individual Appliance Monitors. They look like this (I ended up with a European version with a couple of adapters to get it to work here in the UK):

Current Cost IAM

Current Cost IAM

Since my Current Cost Classic monitor did not support this, I bought a 2nd hand one that does from eBay: the EnviR:

Current Cost EnviR

Current Cost EnviR

The neat result is that the IAM, although not natively supported by DomotiGa (at the time of writing), is actually correctly detected since Current Cost use the same format on the serial port 🙂

It was then very simple to add an event in DomotiGa to check IF there is no motion detected on the PIR AND the power consumption of the TV is less than 20 watts (the TV uses about 12-14watts in standby), THEN I switch the light off.

SmartVISU - TV Monitor

SmartVISU – TV Monitor (screenshot from mobile interface)

For the record, the Current Cost returns a string, not a number, in the format ‘00000‘, so in DomotiGa I had to convert this to a number for my IF statement:



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