Monday, 31 October 2016

Authentication for Amazon Voice Services

In an effort to have my new Echo Dot announce incoming telephone calls, I would need to have it do push notifications. Sadly, this is not yet available on the echo platform. Happily, there is a workaround via custom skills that relies on leveraging Amazon Voice Services - essentially building parts of an echo in software.

To do so, it's necessary to obtain an access token to facilitate calls to the voice services api. This is not a straightforward process - and it's just a prerequisite for the push notifications themselves. I'm logging the process here for future reference!

Friday, 28 October 2016

Securing Skills

Having got a basic setup working with an Alexa Skill calling to Node-Red on my unRaid server, I was a little worried about the security of this setup long term. I was also unhappy with going through a Lamba function to bypass the HTTPS requirement for Alexa endpoints. I decided to set up better security.

Thursday, 27 October 2016

Skilling Up

In anticipation of an Amazon Echo Dot arriving, I've been looking at ways of integrating voice control into home automation. There's a certain amount that Alexa can do by herself but to really tailor things, it's necessary to build custom skills. To get these integrated with my emerging openHAB / Node-RED infrastructure, I set about setting up MediaServer8 to act as a host for the skills logic, thereby allowing me to hook sensors and devices into the skills via Node-RED. (My design objective is to run as much code and services as I can locally to minimise reliances on web services and allow everything to be glued together on my local server).

The idea was to run the core skill logic on my Node-RED install running on my unRAID server. To acheive this, I largely followed this excellent guide which required me to set up an Amazon Developer account. Alexa skills can be configured to process on either the Amazon Lambda service or on a user-defined https endpoint.

Monday, 24 October 2016

unRAID Node-RED Docker with HTTPS

I'm knee-deep in setting up a bunch of automation stuff and was very interested to come across a blog article from Nathan Chantrell outlining how to set up an amazon Echo skill to allow voice commands such as 'Alexa, tell the house to....'. This allows Echo be extended beyond just the basic 'turn on, turn off commands' and permits custom responses as well.

Nathan uses Node-RED at the core of his automation system and I've been gravitating towards this as well, having previously set it up as an unRAID docker for helping openHab communicate with my legacy Comfort controller. It's a very flexible system and, when combined with MQTT, really does offer a great solution for managing automation messaging.

However, to implement this skill, it's necessary to allow Amazon development servers have access to my Node-RED instance running on my unRAID. The first step in this is getting Node-RED running in HTTPS mode.

Thursday, 20 October 2016

openHAB debugger

Having previously set up the infrastructure for connecting my legacy Comfort system to openHab, I've started working with openHab items, sitemaps and rules to respond to sensor status updates. In doing so, I've ben working with scripts in openHAB and have been a bit frustrated by the level of debugging available. With MQTT and Node-Red in place, I wrote a simple facility to easily trace code objects and values.

Tuesday, 18 October 2016

Setting up a VPN on unRAID

Occasionally, I need access to files on my unRAID server when I'm away from home. Now that I'm setting up more home automation, I can also envisage needing increased access to utilities etc. I figured it was about time to connect my unRAID server to the interweb, but how to do so securely? openVPN looks like the answer.

I have a decent fibre broadband connection, but don't have a fixed IP address. The first thing I needed to do set up a dynamic DNS whereby I could use a fixed URL to access my changing IP address.

Monday, 10 October 2016

Seeking Comfort



Embarking on the great home automation project of 2016, I wanted to get my openHAB installation talking to my legacy Comfort system.

I'd installed the comfort system 15 years ago, (it's a Comfort Pro), and it's been very reliable if somewhat basic since. At it's core, it's a home automation system that can function as a security system, telephone answering machine, lighting controller, infra-red blaster and a number of other tasks.

It's got a range of modular input and output systems and in my case, connects to the outside world via an RS232 serial interface. (USB and Ethernet options are also available but I don't have them). The system can be programmed and works on the basis of zones/inputs and responses so can be set up to, say, switch a light on if a particular sensor is tripped after dark.

I have window and door sensors connected up as well as a few PIRs as well as an X-10 interface for lighting control. There's a doorphone at the front door and the system is connected to the telephone line. This means that if we're not at home and the doorbell rings, we can set the system to call a mobile and we can speak to the person at the door. Neat.

Comfort has been updated over the years and version 2 has been out for a while with support for more modern protocols etc. but as an upgrade would require me to replace the entire system, I didn't bother.

Now with a renewed interest in home automation and a decision to pursue openHAB as the core, I needed to find a way to get Comfort and openHab linked up. I really don't want to throw out a perfectly good alarm system and have to rebuild it all again with new components just to get the same functionality. My ambition is to reuse and recycle what I have if it's fit for purpose.

A Winter Project


When we renovated our house over 15 years ago, we put in some automation systems. The brain was a Comfort system from Cytech. This is fundamentally an alarm system that does a few other things such as offering a voicemail system and has expansions for IR blasters and the like. It's accessible via a serial interface and programmable via 'comfigurtor' software. Connected to the comfort system are a set of window and door contacts, a doorphone, keypads and some PIRs.

Also installed were a number of hard wired X10 controllers (LD11 din-rail dimmers) which were set to control various lights via wireless switches and could be addressed via the comfort system (when coming home and entering the system disarm code, switch on the lights if it's after dark etc.)

In recent times, the X10 systems have been gradually degrading. Lights would switch on by themselves or fail to operate on command. It was time to start looking for options.

Sunday, 9 October 2016

MQTT bi-directional communications in PERL

In attempting to interface openHab with my Comfort system, I needed to adapt an existing Perl linux driver for Comfort to work in Windows. The idea is that a small Perl program manages serial communications with the Comfort system and uses the IoT protocol MQTT to pass messages back and forth with openHab.

In doing so, I found that there was a very limited amount of information on integrating MQTT with Perl. There is a minimal MQTT interface for Perl that does the trick but the sample code was not obvious to me and there's very little else out there.

I've written a vey basic Perl <-> MQTT program to show how basic input and output is achieved.

Wednesday, 5 October 2016

Google Stuff

So I was thinking about buying an Amazon Echo . Just to play around with. I also need a new phone and was seriously looking at the new Sony Xperia XZ . Then Google had their product announcements yesterday.

Pixel Phone
Google Home
Daydream
Chromecast Ultra
Google WiFi
Google Assistant

I'm right in the middle of researching a new smart home platform to implement over the winter. Right now, it looks like it's going to be based around OpenHab and I'm looking for technology that will integrate with that. The Amazon Echo Dot is super cheap and provides some level of voice control and integration but has a few rough edges and limitations. I think I'll wait a little to see what the developer APIs will be like for Google Home. If I can instruct it to say things from OpenHab, it could be the one!

Now, Sony XZ or Google Pixel. Decisions, Decisions...


Tuesday, 4 October 2016

unRAID 6.2 Update

The 6.2 update came out a few weeks ago following a couple of months of public beta. I usually dive right in to the betas but my unRAID system has become so fundamental to our house that I couldn't risk downtime and general family wrath.

However, with all parties out working or playing sports this weekend, I had a couple of hours so, after backing up my unRAID stick, I ran the update.