How to build a Linux-powered smart home

Add some intelligence to your home and offices

When you purchase through links on our site, we may earn an affiliate commission.Here’s how it works.

openHAB and Mycroft

openHAB and Mycroft

Use the power of Ubuntu’s openHAB appliance and the Mycroft Voice Assistant to voice-enable your home.

The open Home Automation Bus (openHAB) can connect all the diverseIoTappliances that may or may not be beginning to proliferate around your home.

Typically these devices all have their own, often proprietary applications, but often under the bonnet they use open source protocols – and when they don’t, people have figured them out enough to plug them into openHAB.

We covered installing it (and indeed Mycroft over the page) in the past, but this time around we’re going to do it a little differently, because Canonical recently released the openHAB Ubuntu Appliance for the Raspberry Pi.

This means we can write their SD card image, boot it and have a fully functional web-based home automation server.

In order to use these Ubuntu Appliances (there are currently four others besides openHAB, and more are on the way), you’ll need to sign up forUbuntu SSO (Single Sign On). It’s free and you can use it all over the Ubuntu web ecosystem.

Once you’ve done this you’ll want to generate an SSH keypair and upload the public key, so that you can use your SSH-reinforced SSO to login to your appliance.

Are you a pro? Subscribe to our newsletter

Are you a pro? Subscribe to our newsletter

Sign up to the TechRadar Pro newsletter to get all the top news, opinion, features and guidance your business needs to succeed!

You may already have generated an SSH key, in which case you probably don’t want to overwrite it. Check by running:

If no such file exists, generate it with:

and press Enter to accept the default location. Once the key is generated, run:

and copy the contents to the clipboard.

Log into Ubuntu SSO and go to the SSH keys section. Paste the contents into thePublic SSH Keybox and hit theimportbutton.

You can now SSH into Ubuntu services and appliances (from this machine only) using this key. But we still need to log our appliance into Ubuntu’s cloud to fetch it, so follow the three steps below and do that.

Install openHAB

Step 1. Download

Download the image. It’s about 500MB, but compressed. You’ll need to decompress it withxz -d openhab-core18-pi.img.xzif you’re going to write it out manually withddin the next step, but the officialRaspberry Pi Imagerprogram can do this for you.

Step 2. Write the image to SD card

At least a 4GB card will be required, and possibly more if you go all out with extensions. On a Debian-based distro (including Ubuntu) you candownload the Pi Imagerand install it withdpkg -ior graphically withGdebi. Use this to write out the image file.

Step 3. Boot your Pi

Connect amonitor,keyboardand network cable (optional) to your Pi, insert the freshly minted card, and fire it up. You will see some configuration choices and eventually will be asked for your Ubuntu cloud email address (see above) so that the appliance can be authenticated against your SSH keys.

Once setup is complete, take a note of your Pi’s IP address and connect to it from a browser by entering, for example,http://192.168.0.2:8080.

The openHAB interface is a little confusing at first, especially given that the first step ischoose an interface. You can always return to this index page to explore the others. ChoosePaperUIand peruse whatBindings(in theAdd-onssection) are available, and if any of them match your hardware.

From here, your best friend is theopenHAB documentation.

You can customise your appliance however you like. It’s running Ubuntu Core so you can add Snaps from the repos.

Instead of following our later section on Nextcloud, you can get a working install by SSHing into the appliance (the username is the first part of your Ubuntu SSO email) and running:

Visit theSnapcraft storeand let us know how you augmented your appliance. Oh and do check out the others; currently Plex, Nextcloud, Mosquitto and AdGuard have been applianced, and more will surely follow.

Current page:openHAB and Mycroft

Best Usenet client of 2024

Best secure file transfer solution of 2024

7 myths about email security everyone should stop believing