Skip to main content

dooblr logo

dooblr - The Data Doubler

Build Status

Utility for duplicating data received over MQTT to InfluxDB.

Installation

In the very near future, dooblr will be able to be installed via pypi/pip. Until then, or if you want the latest, bleeding-edge version, you can install it by cloning or downloading the repo and running pip install inside the root directory:

pip install ./

You should then be able to run dooblr:

dooblr

Docker

dooblr has also been conveniently Dockerized!

You will want to mount or copy your configs into the container at the `/root/.dooblr` directory. An example of how Makers Local 256 uses dooblr can be found in the [makerslocal/dooblr-prod](https://github.com/makerslocal/dooblr-prod) repo.

Example:

docker run -v $(pwd)/config:/root/.dooblr makerslocal/dooblr:latest

Configuration

dooblr is configured using YAML files, and these files are stored in the user’s home directory. On Linux-based systems they’ll need to be in a directory like:

/home/<username>/.dooblr/

On Windows they’re loaded from somewhere like:

C:\Users\<username>\.dooblr\

After the first run of dooblr, this directory will be created, and some default configuration files will be there. dooblr requires a main dooblr.yml that defines MQTT and InfluxDB connections, and one or more measurement configs.

A default-settings dooblr.yml config file will look like:

# dooblr.yaml
global:
    config-dir: /home/<username>/.dooblr/measurements  # Directory that contains dooblr's measurement configs

mqtt:
    host: localhost  # Host, domain name, or IP address of the MQTT broker
    port: 1883       # Port number of the MQTT broker

influxdb:
    host: localhost   # Host, domain name, or IP address of the InfluxDB instance
    port: 8086        # Port number of the InfluxDB instance
    username: root    # Username for the InfluxDB instance
    password: root    # Password for the InfluxDB instance
    database: dooblr  # Database to use in InfluxDB (will be created if it doesn't exist already)

By default, dooblr looks for *.yml measurement configs in the .dooblr/measurements/ directory. Measurement configs are used to tell dooblr which topics and pieces of data need to be pulled from MQTT and pushed to InfluxDB. dooblr expects the MQTT message to contain either a single value or simple JSON data in its payload.

Single Value MQTT Message

If you have a device that publishes to the home/garage/humidity topic with single float values like 12.3, you would want to create a measurement like humidity.yml:

# humidity.yml
humidity:
    parser: single-value
    value_type: float     # Valid value_types are integer, float, boolean, and string
    field_name: humidity  # If no field_name is provided, the default is 'value'
    topics:
    - home/garage/humidity

Simple JSON MQTT Message

Let’s say you have a device that publishes to the home/kitchen/fridge/temperature and home/kitchen/freezer/temperature topics with the data:

{"temperature": 40.1, "units":"F", "humidity": 0.12, "label": "blue"}

You would probably want to create a measurement config called temperature.yml that looks like:

# temperature.yml
temperature:
    topics:
    - home/kitchen/fridge/temperature
    - home/kitchen/freezer/temperature
    - home/kitchen/+/temperature  # Standard MQTT wildcards also apply here
    fields:
    - temperature
    - humidity
    tags:
    - units
    optional_tags:
    - label  # Maybe not every message on these topics have a "label" property!

Notice that there can be multiple topics, fields, and tags. Tags and fields refer to the tags and fields used in InfluxDB. Optional tags will not raise an error if they weren’t defined in the MQTT message, while regular tags will.

Metadata

Release files for dooblr 3.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dooblr 3.1.0
File Size Uploaded
dooblr-3.1.0.zip 15.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dooblr 3.1.0
File Interpreter ABI Platform
dooblr-3.1.0-py2-none-any.whl Python 2 none any Details

Total release size: 25.1 kB

Release files / dooblr-3.1.0.zip

Download URL dooblr-3.1.0.zip
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2f7ab0d3b0753cfc40eaa085cf4e5f38fa0e1b48850349e31061d7d8f9f4911c
BLAKE2b-256 checksum
How to use checksums
e839b189d4161c575f1bc5e4a86819aa3d4ad7b058cb5f941dca1774d28cd886
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / dooblr-3.1.0-py2-none-any.whl

Download URL dooblr-3.1.0-py2-none-any.whl
Size 10.0 kB
Tags Python 2
SHA-256 checksum
How to use checksums
44ae210368d38a0c314e39a1304bf5d27ed0df6cff5624825060ff4b50e51f3e
BLAKE2b-256 checksum
How to use checksums
67f2d1e4140ddd4c4573f2d737b3da34eb7298efcdc0bf88a75bb0b58e3a97ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

3.1.0 This release

2 release files

2.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page