Right now (September 2017), there is no native OH2 EnOcean binding available, which is due to some license issues (as discussed here). As I used to use FHEM, which supports EnOcean without any problems, my workaround so far has been to use FHEM’s MQTT bridge in order to pass EnOcean signals/states to OH2. However, I would like to completely avoid using FHEM.
Recently, I set up Homegear in order to incorporate my HomeMatic devices into OH2. That worked flawlessly, including auto-discovery. While informing about Homegear, I read several times that the software is also supposed to support the EnOcean protocol. However, if you do a Google search for ‘Homegear EnOcean’, you basically don’t find any information about setting up the whole thing. The official Homegear documentation at www.docs.homegear.eu doesn’t even mention EnOcean at all. However, over at a German speaking forum, @sathya and @pmayer helped me to set it up. At the end of the day, using Homegear in order to get EnOcean support in OH2 isn’t that complicated at all. It even features auto-discovery in Paper-UI.
The following short tutorial is meant to be a first introduction for all users who are struggling with the current situation regarding EnOcean. It’s pretty brief and is mainly based on the introduction of @sathya and @pmayer.
Step 1: Installing Homegear
@ThomDietrich’s openHABian distribution for raspberry pi makes installing Homegear quite easy. Just use his configuration tool and you should be good to go.
sudo openhabian-config
As an alternative, you can follow the official instructions on the Homegear documentation website. Here you’ll find instructions for different operating systems. Make sure that you install the EnOcean family module after installing the main Homegear components.
sudo apt install homegear-enocean
Step 2: Set up your gateway
The EnOcean protocol will be set up via a configuration file at /etc/homegear/families/enocean.conf. This file is pretty staightforward. It contains three settings:
- Gateway ID
- Device type
- Interface device name
If you are using an USB 300 stick or an EnOcean Pi 868 GPIO (as I do), you should be good to go. My enocean.conf file:
sudo nano /etc/homegear/families/enocean.conf
--------------------------------- EnOcean ---------------------------------
___________________________________________________________________________
#[USB 300 / TCM310]
# Works with any device using EnOcean's TCM310 module.
## Specify an unique id here to identify this device in Homegear
## After devices are paired to Homegear don't rename the interface
## as the ID is used to assign it to the peers!
id = EnOcean_Pi_Gateway
## Options: usb300
deviceType = usb300
## Device name of your interface
device = /dev/ttyAMA0
Using the EnOcean Pi 868 GPIO, you need to set up the serial port. You can use the openhabian-config tool, again.
After these steps, if your gateway is not working properly, you may want to think about freeing up the serial line and enable UART. You can follow these instructions: Free Up Serial Line and Enable UART. Don’t worry about HomeMatic, it’s the same process.
Step 3: Pair your devices
First, log into Homegear.
sudo homegear -r
If you are not familiar with Homegear, simply type help
.
In order to pair your EnOcean devices, you need to select the EnOcean family module. ls
will list all device families that you previously installed (see above). With fs 15
you can select the EnOcean device family. Again, help
will list all device familiy specific commands. With peers create
you can pair your devices.
pc help
brings up the concrete syntax for this command. You basically need three pieces of information.
- Your gateway ID (that’s what you set up in /etc/homegear/families/enocean.conf).
- The EnOcean Equipment Profile (EEP) of the EnOcean device that you would like to pair.
- The device address. This is usually some kind of serial number that you’ll find on your device.
General syntax:
peers create <Interface-ID> <EEP> <Address>
In my case, I do have a bunch of Hoppe SecuSignal FHFS-vw window handles (EEP F61000) as well as an Eltako FT55-rw switch (EEP F60201). That is, the commands to pair a window handle and the rocker switch may look like this:
pc EnOcean_Pi_Gateway F61000 01A93E7E
pc EnOcean_Pi_Gateway F60201 FEF9EB23
After pairing your devices, ls
will list all your devices.You may find the column ‘name’ to be empty. You have the possibility to apply some telling names to all of your devices within Homegear, which I highly recommend. It will make your life easier further down the road. You can do that with peers setname
or short pn
.
pn PeerID Name
For example, you can see my devices after I paired them all:
Step 4: Incorporate it all into openHAB
Using Paper UI, this step is quite straightforward.
- Install the HomeMatic Binding (YES, HomeMatic!)
- Go to your inbox and scan for new HomeMatic devices
- Go to Configuration/Things in order to configure your devices.
That’s it. You’re good to go
Any suggestions for improvements? Let me know!