Talk to your Smart Home via SEPIA Open Assistant

Florian Quirin
SEPIA Framework
Published in
7 min readJan 6, 2020

How to connect SEPIA to a smart home HUB and get a self-hosted, open-source home automation system + voice-control

This article is part of the SEPIA tutorial series. If you want to learn more about SEPIA in general, please visit: https://sepia-framework.github.io/

Did you ever dream of controlling your home just with your voice? Or are you using devices like Amazon Echo, Google Home or Siri already but don’t feel 100% comfortable with the idea of streaming your data to some unknown cloud server? Maybe you have been using openHAB or FHEM for quite some time now and want to try a new type of interface?

If the answer to any of these questions is “yes” then you’ve found the right blog :-) In this article you will learn how to set up SEPIA to talk to a smart home HUB and how to control your smart home system via voice using 100% open-source software.

Why use a smart home HUB?

Via the services module of SEPIA users can connect to basically any device that has a network interface (HTTP, WebSocket, MQTT, …) and communicate with it via voice commands (and buttons and text messages of course ^_^), but in the smart home world you will find hundreds of different systems and standards. Supporting all of them can become a never ending task. Thankfully there are great open-source projects like openHAB or FHEM that can work as an abstraction layer between all these systems and SEPIA. We usually call them smart home HUBs since they function as a central control unit for your home automation. They are community driven, support an ever-growing list of devices from various manufacturers and offer a common interface that greatly simplifies the integration of those devices into SEPIA. Besides that, they have a lot of interesting additional features to organize your smart home and let your devices talk to each other creating for example conditional rules like: when the sun goes down → lower the temperature in the living room.

Since the rest of this article will require a smart home HUB, it’s time to familiarize yourself with one of them now if you haven’t done so already. Installation guides are available by the creators themselves for example HERE for openHAB or HERE for FHEM. A quick web search will give you dozens of tutorials as well including guides about adding your specific smart devices to your HUB (lights, thermostats, window blinds, sensors etc.).

Get started

Requirements

  • SEPIA-Home v2.4.0 or newer (6min installation guide)
  • Access to a smart home HUB (e.g. openHAB or FHEM). If you just want to experiment a bit there is an integrated Test-HUB available as well.

1) Test access to your smart home HUB and SEPIA

The first step is to make sure that your HUB and SEPIA are in the same network (suppose they have no public addresses) and that you can access both. By default the web interfaces will be available at http://localhost:8080 (openHAB) or http://localhost:8083/fhem (FHEM) and http://localhost:20721/tools/ (SEPIA Control HUB) while localhost is just a placeholder for the server host name or IP address.

Simple openHAB setup with 2 smart lamps (Paper UI)

On the page of your smart home HUB check if you see all the devices that you want to control with SEPIA later and quickly test if they work. In the picture above you see an example setup with 2 Philips Hue lamps in openHAB.

If everything looks good log-in to your SEPIA Control HUB using your administrator account.

2) Connect SEPIA to your smart home HUB and set up devices

The next step is to tell SEPIA where to find your smart home HUB. If you have any issues with the following part check out the more detailed tutorial in the SEPIA docs as well (it has some examples for non-default configurations, basic authentication and more).

In your SEPIA Control HUB open the page called Core Settings (as admin) and press the “GET” button at the top to load the SEPIA Assist-Server settings. Look for the entries smarthome_hub_host and smarthome_hub_name. Add the URL to your smart home HUB as host and enter either openhab, fhem or test as name (more HUBs might be added soon).

SEPIA settings example for openHAB

Confirm the changes by pressing the check button (the little hook) and then press “reload server” a little bit further down on the same page.

Give the server a few seconds to reload (~5s) then switch to the Smart Home page of the SEPIA Control HUB and press the “LOAD HUB INFO” button. System and server should show up with the values you’ve just defined. Now use the “GET DEVICES” selector to load “all” devices from your smart home HUB. Depending on the devices your HUB knows you should see a number of device-cards appearing. Before you can start editing the cards press the “REGISTER SEPIA” button once, this will write some SEPIA specific data to the smart home HUB if required.

NOTE: When using FHEM (with default settings) all the changes you make via the SEPIA Control HUB are written to the FHEM server BUT will only survive a server restart when you press the “Save config” button in your FHEM web interface.

The openHAB example shown in the picture above will look like this in your SEPIA Controls:

SEPIA Control HUB device-cards loaded from openHAB (same setup as above in Paper UI)

In the picture you can see 2 devices, let’s look at them a bit closer. Although SEPIA cards can be used to manually toggle the device state (e.g. on/off; button in the top right) their main purpose is to store the information required to properly control the represented device via voice (or chat/button in the client app). Some of the device properties can be identified automatically by SEPIA but usually it’s up to the user to set the correct ones.

The device on the right is set up as light located in the living room and the current state is 70 (aka 70% brightness). Its name has been changed to “Deckenlampe” (German for ceiling lamp) and it contains a number (“1”) that can be used to distinguish devices of the same type in the same room. Typical voice-commands for this device could be:

“Set lamp 1 in the living room to 30%” or “State of light 1 in the living room?”

The device on the left is set up as type hidden meaning SEPIA will completely ignore this item in any request to the smart home service which can be handy if you don’t want your SEPIA users to have access to it.

Some settings of the device-card are hidden by default. Simple items like lights (with states for on, off and brightness) will usually work out-of-the-box but if they don’t or you have more complex devices like thermostats you can tweak these settings by hand. For example a thermostat might require state-type = Temperature °C and custom devices might even require a special custom configuration. If you need help finding the correct properties for your device feel free to open an issue in the help section of SEPIA or in the SEPIA thread of the corresponding smart home community (openHAB, FHEM)!

Expanded device-card with “advanced” settings

3) Give your SEPIA users access rights to use the smart home service

The last remaining step is to choose the SEPIA users who are allowed to access the smart home service and (optionally) change the configuration as described in step 2.

This can be done quickly by navigating to the User Management page of the SEPIA Controls (still using the admin account) and is described in detail HERE and HERE. There are 2 relevant roles you can give your users:

  • smarthomeguest: User is allowed to control devices via a SEPIA client
  • smarthomeadmin: User is allowed to use the SEPIA Control HUB to change smart home configuration

That’s it! 😏

Some smart home voice commands for your inspiration:

  • “Switch on the light in the kitchen”
  • “Set the heater in bathroom 2 to 21 °C”
  • “Close the roller shutter in Room 212”
  • “Status of sensor 3 in the children’s room”
  • “Turn on the coffee machine”
  • “Start a rock radio” (technically a different service of SEPIA but … ^^)

Where to go from here?

If you’ve successfully managed to connect SEPIA to your smart home HUB and you are now able to control your devices via the voice interface there are a few things I recommend to do next:

More tutorials will be released soon. Stay up-to-date by following the SEPIA twitter feed and if you have any questions please click this link.

--

--

Florian Quirin
SEPIA Framework

Physicist, data scientist, Java and web developer, AI enthusiast, Raspberry Pi hacker and bot (framework) builder.