Update 2023-01-21

The public URL for the repository has been updated. It now contains fluxcd kustomization examples to deploy on kubernetes.

Project

Simple docker image to export ruuvitags to an mqtt server

Code available here.

Motivation

RuuviTags are cool little devices that broadcast sensor data over BLE. This script will capture any broadcasted BLE beacons and publish them as MQTT topics to an MQTT broker. Using MQTT relays this can be collected to a central location. The base topic path ruuvitags is used, modify this by setting RUUVITAG_BASE_TOPIC environment variable.

Building

build and test using docker-compose

$ docker-compose build && docker-compose up

Configuring

The following environment variables are used to control the MQTT server to connect to, MQTT_HOST, MQTT_PORT and MQTT_BIND_ADDRESS.

The environment variable HCI_DEVICE can be used to provide which HCI device do use, default is hci0.

Human-friendly Topics

By default tags are identified by their MAC address, which is published sans ‘:’ as topics to identify each tag. If you need to customize the topic path with other names an optional file tag_names.yml can be provided, which will translate the MAC addresses to a readable name. See the provided example.

You can set the environment variables TAG_NAMES to override where this file lives.

Home Assistant Autodiscovery

If you use home assistant you can use the boolean HASS_AUTODISCOVERY to enable it. The default autodiscovery topic is homeassistant can be changed using the environment variable HASS_AUTODISCOVERY_TOPIC.

Check out the file entity_key_mappings.yml for how to override some aspects of this, KEY_MAPPINGS is the environment variable to override where the file is located.