Post

Tracking Tilt Fermentation with InfluxDB

A simpler follow up to my Tilt InfluxDB setup, cutting out Telegraf and reading BLE directly. Plus my first Dockerhub image!

Tracking Tilt Fermentation with InfluxDB

Introduction

This is a follow-up to my previous Tilt logging setup, which used Telegraf as a middleman. This approach cuts that out entirely. The container reads the Tilt BLE signal directly and writes to InfluxDB using Python. Both standard Tilt and Tilt Pro are handled automatically. Values are normalized before they hit InfluxDB, so you’ll always get consistent temp_f and sg fields regardless of model. Temperature is in Fahrenheit to stay as close to the raw Tilt output as possible. Rather than writing every BLE packet to InfluxDB, the container batches readings and flushes on a configurable interval (SEND_INTERVAL_SEC, default 60s). Only the latest reading per device is kept, so you get one clean data point per flush. I considered making it record and process all the packets into an average and then flush that, but I went for simple and lightweight instead, the gains in “accuracy” just weren’t worth it. I also added logging so it is easier to see what is going on, and if points are being flushed. This is also my first image on Docker Hub. Building it taught me about multi-arch builds using docker buildx, so the image supports both amd64 and arm64.

Check it out on GitHub or Docker Hub.

This assumes you already have InfluxDB running. If not, you’ll need to set that up first.

Aioblescan with InfluxDB Integration

This project provides a self-contained Docker image for scanning Bluetooth signals using aioblescan and forwarding the data to InfluxDB.

Features

  • Uses aioblescan with the Tilt plugin to scan for Bluetooth signals.
  • Parses the output and sends the data to an InfluxDB bucket.
  • Configurable using environment variables.

Usage

Run the Container

1
2
3
4
5
6
7
8
9
10
11
12
13
14
docker run --rm \
  --name aioblescan-influx \
  --network host \
  --cap-add=NET_ADMIN \
  --cap-add=NET_RAW \
  -e INFLUXDB_URL="https://influx.example.com" \
  -e INFLUXDB_TOKEN="your-influxdb-token" \
  -e INFLUXDB_ORG="your-org" \
  -e INFLUXDB_BUCKET="your-bucket" \
  -e SEND_INTERVAL_SEC="60" \
  -e DEVICE_KEY_FIELD="mac" \
  -e LOG_LEVEL=INFO \
  stianjosok/aioblescan-influxdb:latest

Docker Compose

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
services:
  aioblescan-influx:
    image: stianjosok/aioblescan-influxdb:latest
    container_name: aioblescan-influx
    network_mode: host
    cap_add:
      - NET_ADMIN
      - NET_RAW
    environment:
      - INFLUXDB_URL=${INFLUXDB_URL}
      - INFLUXDB_TOKEN=${INFLUXDB_TOKEN}
      - INFLUXDB_ORG=${INFLUXDB_ORG}
      - INFLUXDB_BUCKET=${INFLUXDB_BUCKET}
      - SEND_INTERVAL_SEC=60
      - DEVICE_KEY_FIELD=mac   # or uuid/addr/peer
      - LOG_LEVEL=INFO
    restart: unless-stopped

.env File

1
2
3
4
INFLUXDB_URL=http://<INFLUXDB_HOST>:8086
INFLUXDB_TOKEN=your-influxdb-token
INFLUXDB_ORG=your-org
INFLUXDB_BUCKET=your-bucket
This post is licensed under CC BY-NC-ND 4.0 by the author.