thingsboard-downloader
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
Repository
Basic Info
Statistics
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 2
Topics
Metadata Files
README.md
ThingsBoard Downloader
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
- Configure the JSON files:
- Copy
config.template.json→ Rename it toconfig.json - Modify
config.jsonwith your ThingsBoard details
- Retrieve available telemetry keys:
- Run:
bash
python update_local_keys.py
- This will create
config/keys.json, listing all available remote keys.
- Select the telemetry keys you want:
- Open
keys.jsonand include/exclude the keys you want to download.
- Open
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:
Custom Timestamp (Highest Priority)
- If a custom timestamp is set in
config.json, it is used asstartTS.
- If a custom timestamp is set in
Existing Local Data
- If previous data exists, the latest stored timestamp is used as
startTS.
- If previous data exists, the latest stored timestamp is used as
ThingsBoard Query (If No Local Data)
- If no local data is found, the tool requests the first available timestamp from ThingsBoard per device.
- If no local data is found, the tool requests the first available timestamp from ThingsBoard per device.
Stop Timestamp (
stopTS)- Defaults to the current system time unless a custom value is set.
- 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.jsoncontains the correct host URL, username, and password.
Owner
- Name: TUM - Environmental Sensing and Modeling
- Login: tum-esm
- Kind: organization
- Location: Germany
- Website: https://www.ei.tum.de/esm
- Repositories: 10
- Profile: https://github.com/tum-esm
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
Top Committers
| Name | Commits | |
|---|---|---|
| Patrick Aigner | p****r@t****e | 84 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 7 months ago