Science Score: 85.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    1 of 1 committers (100.0%) from academic institutions
  • Institutional organization owner
    Organization tum-esm has institutional domain (www.ei.tum.de)
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.9%) to scientific vocabulary

Keywords

download downloader iot sensor-data thingsboard
Last synced: 6 months ago · JSON representation ·

Repository

Basic Info
  • Host: GitHub
  • Owner: tum-esm
  • License: gpl-3.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 111 KB
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 2
Topics
download downloader iot sensor-data thingsboard
Created about 1 year ago · Last pushed 6 months ago
Metadata Files
Readme License Citation

README.md

ThingsBoard Downloader

License: GPL v3 Python Version DOI mypy

Project Description

ThingsBoard Downloader is a Python-based tool that retrieves telemetry data from a ThingsBoard instance. It authenticates using a JWT token, fetches available telemetry keys, and downloads device-specific data for local storage and analysis. The downloaded data is stored in Parquet files, ensuring efficient storage and fast querying. The project supports configuration through JSON files and logs its operations for tracking purposes.

The project is part of ICOS Cities, funded by the European Union's Horizon 2020 Research and Innovation Programme under grant agreement No. 101037319.

Key Features

  • Secure authentication using JWT tokens
  • Automatic key retrieval from ThingsBoard
  • Efficient storage using Parquet files for fast querying
  • Customizable data selection via JSON configuration
  • Error logging and monitoring for troubleshooting

Installation

Prerequisites

  • Python 3.12 or later
  • Poetry installed (pip install poetry)

Set up the virtual environment and install dependencies

bash python3 -m venv .venv # Create virtual environment source .venv/bin/activate # Activate it poetry install --with dev # Install dependencies


Initial Setup

  1. Configure the JSON files:
  • Copy config.template.json → Rename it to config.json
  • Modify config.json with your ThingsBoard details
  1. Retrieve available telemetry keys:
  • Run:

bash python update_local_keys.py

  • This will create config/keys.json, listing all available remote keys.
  1. Select the telemetry keys you want:
    • Open keys.json and include/exclude the keys you want to download.

Running the Downloader

After setting up config.json and keys.json, start the download process:

bash python main.py

  • Logs will be generated in the logs/ folder.
  • Downloaded data will be saved as Parquet files in the data/ directory.

Determining Start and Stop Timestamps

The tool determines the time range for retrieving telemetry data based on the following rules:

  1. Custom Timestamp (Highest Priority)

    • If a custom timestamp is set in config.json, it is used as startTS.
  2. Existing Local Data

    • If previous data exists, the latest stored timestamp is used as startTS.
  3. ThingsBoard Query (If No Local Data)

    • If no local data is found, the tool requests the first available timestamp from ThingsBoard per device.
  4. Stop Timestamp (stopTS)

    • Defaults to the current system time unless a custom value is set.

This ensures efficient data retrieval while avoiding redundant downloads. 🚀


Running Type Checks (MyPy)

To ensure type safety and catch potential errors, run:

bash bash scripts/run_mypy.sh


Troubleshooting

Common Issues and Fixes

1. Poetry is not installed

If you get an error related to poetry, install it using:

bash pip install poetry

2. Virtual environment issues

If source .venv/bin/activate doesn’t work, try:

bash .venv\Scripts\activate # for Windows (PowerShell or CMD)

3. ThingsBoard API authentication failure

  • Ensure your config.json contains the correct host URL, username, and password.

Owner

  • Name: TUM - Environmental Sensing and Modeling
  • Login: tum-esm
  • Kind: organization
  • Location: Germany

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Aigner"
  given-names: "Patrick"
  orcid: "https://orcid.org/0000-0002-1530-415X"
- family-names: "Chen"
  given-names: "Jia"
  orcid: "https://orcid.org/0000-0002-6350-6610"
title: "ThingsBoard-Downloader"
version: 1.0.1
doi: 10.5281/zenodo.15847934
date-released: 2025-07-09
url: "https://github.com/tum-esm/ThingsBoard-Downloader"

GitHub Events

Total
  • Release event: 2
  • Push event: 7
  • Public event: 1
  • Create event: 2
Last Year
  • Release event: 2
  • Push event: 7
  • Public event: 1
  • Create event: 2

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 84
  • Total Committers: 1
  • Avg Commits per committer: 84.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 84
  • Committers: 1
  • Avg Commits per committer: 84.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Patrick Aigner p****r@t****e 84
Committer Domains (Top 20 + Academic)
tum.de: 1

Issues and Pull Requests

Last synced: 7 months ago