Unifi Controller SSL (HTTPS)

Unifi

If like me you are running a Unifi system at home then you will probably want to connect to the controller via HTTPS. This also applies to the Guest Portal, providing them with a Trusted Certificate and not a self signed one.

This guide is for machines running Windows, but has some similarities for other OS.

Pre-Requisites

  • Unifi Controller installed and running either by a service or the app
  • A Trusted Certificate and private.key If you havent already done so, check out my post on how to get a certificate for free Easy Let's Encrypt Certificate

Also you can find out how to install and configure a Unifi Controller here. (Coming Soon!)

Step 1 - Key Store Explorer

Head over to Keystore Explorer and download the program and install it. This is used to import our certificates to the keystore unifi uses.

enter image description here

Step 2 - Creating a PKCS #12

If you are familiar with creating a PKCS #12 certificate then please create one with your unifi controllers domain name and the guest portals domain name with the password of aircontrolenterprise.

If you arent familiar with creating a PKCS #12 file, see below.

Step 3 - Importing the Certificates

Find the location of the Unifi Controller directory. On Windows the default directory is

C:\Users\%USER NAME%\Ubiquiti UniFi

In the folder 'data' there is a file called keystore. Open the keystore file with key store explorer.

enter image description here

The password is aircontrolenterprise

You should now see the below

enter image description here

Select the unifi key in keystore explorer then click on 'tools' and import key pair and choose 'PKCS #12'.

Decryption password is aircontrolenterprise

Enter the alias 'unifi' in lower case

enter image description here

If it asks to overwrite click 'YES'

Save the Keystore file.

Finally restart your unifi controller and it should now have a working certificate!

Harmony Skills and Alexa (Blue and Red)

enter image description here You've probably stumbled across this page if like me you live in the UK and don't have access to the Harmony Blue Skill.

If you're lucky enough to live in the US then this doesn't really apply to you as the US has 2 Echo Skills available for the Harmony, I will explain the difference below and how I over came the limitations in the UK.

enter image description here

Harmony (Red Skill)

The Red skill is a basic Echo Skill available in both the US and UK. This skill links your Harmony Hub to Alexa. To control the hub you say commands such as "alexa, ask harmony to turn on...." alexa, ask harmony to turn the volume up"

Straight away you will notice that you have to use the INVOCATION name harmony to get it to do anything like many other basic skills. However Smart Home Skills like Phillips Hue or Samsungs Smarttthings allow you to use more natural speech such as:- "alexa, turn on living room lights" There's no need for an INVOCATION word.

enter image description here

Harmony (Blue Skill)

This leads onto the Harmony Blue Skill. Available only in the US, this skills is a Smart Home Skill which links Harmony and the Echo. With the Blue Skill it drops the INVOCATION word allowing you to say:- "alexa, turn on the TV" "alexa, turn up the volume" This is a much easier and cleaner way to interact with your new digital assistant don't you agree?

Unfortunately in the UK we don't have access to the Blue Skill however Harmony links with Smartthings and Smartthings is classed as a Smart Home Skill.

So my work around involves you already having or willing to purchase a Smartthings Hub.

  • Set up your Harmony Hub like normal with Activities
  • I had Activities called 'Watch Tv', 'Watch Emby', 'Play Xbox' and 'CCTV'.
  • Smartthings App - Open up the App and go to 'Automation' then '+ Add a Smart App' install the Logitech Harmony (Connect) app.
  • The Smart app will search and find your Harmony Hub and Activities.
  • The Activities will now be show as 'Things' which can be turned on/off within Smartthings.
  • They will be call {Activity Name} Harmony Hub. Rename them to something more appropriate, I called my 'Watch TV'
  • Head over to the Alexa App and then into 'Smart Home'. Click on Devices and run a Discover.
  • Alexa should find the new Smartthings Device called 'Watch TV' etc.

And that's it. Now in the UK you can say:- "Alexa, turn on the TV" This will activate the Smartthings Switch which in turn runs the Harmony Activity.


Limitations

Ok so this doesnt give you the full functionality of the BLue Skill but it's a start. You still cant control Volume or Favourites with out using the invocation name.


Issues

I ran into a few issues with my install, most noteably was that if any other device in your Smartthings App has the word TV in it then Alexa cant differentiate them. So when I said "Alexa, turn on the TV" she relied "there is more than one device called TV, which do you want?" But she didnt list them. Even after I deleted the other device called TV from Smartthings Alexa still thinks there is 2 devices called TV and there is no way to set one as default (that I could find). Even unlinking Smarttings from Alexa and re-linking didnt fix the issue.