Category Archives: DomotiGa

CurrentCost Script

Until now I used DomotiGa to get the date off my CurrentCost EnviR energy sensor.

Since I’ve moved all my automations to Home-Assistant, the only bit that was not supported by HA was the CurrentCost device. I didn’t want to run DomotiGa just to get the data off the EnviR and then send it to HA via MQTT.

I’ve finally finished a script thanks to Robin Wilson that gets the EnviR data from the serial port and sends it to HA. DomotiGa can now truly rest in peace.

The final script is this one:

 

Goodbye DomotiGa, Long Live Home-Assistant

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:

H801

H801

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 LEDStripXmas.py (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

Syncing Home-Assistant.io and DomotiGa

Having tried Home-Assistant I can see how it can be really powerful once setup (and that’s probably where the issue lies, configuration is too much code driven with no UI at all).

However there are devices that are not yet supported by Home-Assistant (e.g. CurrentCost) and in addition, I can’t have both Home-Assistant and DomotiGa connected to my RFXTrx.

This means I’m looking to use both platforms and find a way to get them to talk to each other.
I already know how to send commands/updates to DomotiGa via JSON-RPC so that will be my first approach.

I’ve created a simple shell command that I use to update devices in DomotiGa:

then in my automations, I call this function with the correct parameters. See below example for my Nest Thermostat (virtual) Device on DomotiGa:

I’ve also tried to install Home-Assistant on my Raspberry Pi as I do like the Web interface, but it’s overkill and take too much overhead when I only need to monitor my GPIO ports. My own script is better in that effect.

Panasonic Smart TV

I’ve finally upgraded my TV. My previous 42” Plasma was very nice, but only HD ready (so 720p) and not smart.

I’ve now got a 4K 58” Panasonic TX58DX700B which has the advantage of having a network interface.

Panasonic Viera TX58DX700B

Panasonic Viera TX58DX700B

And the bonus is that there is already a plugin in DomotiGa that supports Panasonic Viera TVs.

This means I can now receive the mute status (on/off) and the TV volume, but more important I also get the TV status (on/off) and I can switch off the TV from DomotiGa.

This is very handy for my home automation, i.e. dim the lights when the TV in on, and don’t switch the lights off if there is no motion detected on the PIRs AND the TV is on.

Nest Thermostat

My old “dumb” thermostat packed up while doing some redecorating, so I upgraded to a smart one: the Nest Thermostat:

Nest Thermostat 3rd Gen

Nest Thermostat 3rd Gen

One of the cool features of this thermostat is that it can be remotely controlled via the web (http://home.nest.com) or via an app on a smart phone.

Now what would be even better is if I could integrate this with the rest of my home automation setup. And so I went looking online for ways to connect with the intent of 1) extracting data such as temperature and humidity and 2) control the target temperature remotely from DomotiGa.

My first connection attempt was via gboudreau’s unofficial API on GitHub

Although it works perfectly fine, there is some sort of limit on the number of times you can poll the info and eventually the connection gets closed.

I then looked at Google’s official API, and I’ve even followed their tutorial and managed to connect to my Nest, but it’s a little bit too much out of my area of expertise, plus I think the Google codelabs example is intended to be ran on mobile devices rather than a simple web interface. So for now I’ve parked this project for later.

[26th Jan 2017]

Edit: home-assistant.io supports Nest natively, using Google Nest official API. I’m currently working through integrating my Nest with home-assistant.io and get it to talk to DomotiGa. Watch this space.

Google TTS is dead. Long Live Voice RSS

Google changed once again the way their translate_TTS service works 🙁

Having trawled the interweb for an answer, having even signed up for an API key on the new Google Translate API V2, it’s just become impossible to download the text-to-speech audio files.

I have tried various free TTS options – see previous post here – and none were really “fit for purpose” as they really sounded metallic computerised voices, but I’ve just found Voice RSS.

Now Voice RSS is really nowhere as good as Google’s TTS quality, but in the grand scheme of things, it’s probably the next best thing, especially as it can be used almost as a direct replacement using wget.

You’ll have to sign up for an API key first, but provided you need less than 350 requests / day (with each request being smaller than 100kb), it’s free 🙂

The command goes as follows:

It’s also a bit slower than Google to return the audio files so I’ll probably review my commands to do the complete download and play them all one after the other.