Site Overlay

Home automation 5 – the cloud

Next up on the home automation agenda, is the ability to control my home remotely over the internet. Luckily openHAB has a Cloud Connector plugin which is perfect for this task.

Connecting the cloud

First off, let's install the Cloud Connector plugin.

installing the plugin

Next, we need to configure it. We can go to Configuration > Services > IO tab > openHAB Cloud, and enable all the Items we want exposed. In my case, it's just the Josh_Bedroom_Lamp item.

Next, we go to myopenhab.org and register a new account. We need the UUID and Secret, which we can find inside the files at <openhab>/userdata/uuid and <openhab>/userdata/openhabcloud/secret. We can open these files with notepad (or any text editor) to get their contents.

myopenhab register page

And we're done! Now we can login to myopenhab.org from any device anywhere in the world, and we have full access to our openHAB dashboard.

Setting up the Android app

Next step is to set up the Android app. I'm using the Android app since I have an Android phone, but there is an iOS app as well.

After installing it from the Play Store and opening it (and skipping the welcome screen), it automatically detects the openHAB instance running on the network. Cool! We need to manually approve the certificate, since openHAB uses a SSL certificate with the name openhab.org, and our server is on a local IP address. And now we're linked! But only locally over WiFi.

connected, but no content

Next we can link it to myopenhab.org, so that the app will work even when my phone is not on my home WiFi. We can do that in Settings > Remote. The server will be https://home.myopenhab.org, and the username (email) and password will be the same as what we used to register our account.

setup remote connection

As it turns out, the reason that the content was blank was because connecting locally failed. This app does not have good error alerting. So once I entered the remote details, and cleared out the fields in the Local section, my Josh_Bedroom_Lamp item appears and can be controlled by selecting any device paired to it (in my case either the "Bedroom Table Lamp" smart bulb or the Dimmer Switch). This is working over the internet instead of my local network, but that's ok for now.

things are connected!

This app can also send your phone's alarm to openHAB for automation, which is an interesting idea. It would be cool if the lights could come on and the house can wake up at the same time I do in the morning 🙂

< Part 4            Part 6 >