Skip to content

Instantly share code, notes, and snippets.

Created January 29, 2019 20:54
What would you like to do?


Notes on setup openhab supporting receiving multicasts from remote xiaomi gateway endpoints

Network setup

Xiaomi smarthome gateways after recent firmware update no longer provides REST interface for updates. Instead, it provides updates purely in local network using multicast to group and port 9898.

This requires us to

a) Connect to remote site using L2 layer, using vpn that supports that scenario (for example openvpn)

b) As OpenHab does not support multicast listening on multiple interfaces, and can't be routed using igmpproxy, pimd or smcroute - the only choice is configuring Bridge Networking on opehab server, combining local ethernet (eth0) together with VPN interface (tap0)

Openhab Server - Bridge Networking

Note, in some systems, like Raspbian necessary package might not be installed. Check additionally.


Openhab Server - Openvpn Client


Openhab Server - Validating setup

Openhab Server - Persisting configuration changes

I am running home automation on simple Raspberry PI 3. It has one drawback - for 24/7 work termals are not good even with passive cooling. SD card potentially might die quite soon, hardware - depends on plate cooling quality.

Thus I prefer to configure openhab via file configuration, with set of deployment batches, that provision openhab server with updates. All configuration changes are stored in a private git repository.

Additionally, ansible plays are used for initial box configuration (zsh shell, docker daemon, prometheus exporters, openvpn configuration and so on)

This allows me

Remote site - OpenVPN server

Ideally, you might have router that already supports L2 OpenVPN. Routers supporting custom firmwares (Padawan, Openwrt, Tomato - for sure), Microtics and so on.

If for any reason you don't have such router, this means you would need to place one more box on remote site (possible - the same raspberry pi) and install OpenVPN there.

Tips and tricks

Design patterns

VS Code extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment