{"id":36970625,"url":"https://github.com/hardwario/sinqtt","last_synced_at":"2026-01-13T21:49:31.230Z","repository":{"id":331113076,"uuid":"1124537634","full_name":"hardwario/sinqtt","owner":"hardwario","description":"MQTT to InfluxDB v3 bridge with flexible JSONPath transformation","archived":false,"fork":false,"pushed_at":"2025-12-30T14:51:40.000Z","size":126,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-03T08:04:31.099Z","etag":null,"topics":["bridge","influxdb","iot","mqtt","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hardwario.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-29T07:26:36.000Z","updated_at":"2025-12-30T14:28:25.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/hardwario/sinqtt","commit_stats":null,"previous_names":["hardwario/sinqtt"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/hardwario/sinqtt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardwario%2Fsinqtt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardwario%2Fsinqtt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardwario%2Fsinqtt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardwario%2Fsinqtt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hardwario","download_url":"https://codeload.github.com/hardwario/sinqtt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardwario%2Fsinqtt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28401098,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bridge","influxdb","iot","mqtt","rust"],"created_at":"2026-01-13T21:49:30.673Z","updated_at":"2026-01-13T21:49:31.222Z","avatar_url":"https://github.com/hardwario.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sinqtt\n\n[![CI](https://img.shields.io/github/actions/workflow/status/hardwario/sinqtt/ci.yml)](https://github.com/hardwario/sinqtt/actions)\n[![GitHub Release](https://img.shields.io/github/v/release/hardwario/sinqtt?sort=semver)](https://github.com/hardwario/sinqtt/releases)\n[![GitHub License](https://img.shields.io/github/license/hardwario/sinqtt)](https://github.com/hardwario/sinqtt/blob/main/LICENSE)\n\nA high-performance MQTT to InfluxDB v3 bridge for IoT applications, written in Rust. Subscribe to MQTT topics, process incoming messages, and write data points to InfluxDB.\n\n\u003e The name `sinqtt` is derived from a combination of \"Sink\" and \"MQTT\".\n\n---\n\n## Features\n\n- Subscribe to multiple MQTT topics with wildcard support (`+`, `#`)\n- Write data to InfluxDB v3 with tags and fields\n- Support for both JSON and raw string payloads\n- JSONPath extraction from message payloads\n- Mathematical expressions for computed fields\n- Cron-based scheduling for conditional writes\n- HTTP forwarding of processed data\n- Base64 decoding support\n- Environment variable substitution in configuration\n- Optional TLS/SSL for MQTT connections\n- Gzip compression for InfluxDB writes\n- Daemon mode with automatic reconnection\n\n---\n\n## Requirements\n\n- Rust 1.70+ (for building from source)\n- InfluxDB v3 instance (Cloud or self-hosted)\n- MQTT broker (Mosquitto, etc.)\n\n---\n\n## Installation\n\n### From source\n\n```bash\ngit clone https://github.com/hardwario/sinqtt.git\ncd sinqtt\ncargo build --release\n```\n\nThe binary will be available at `./target/release/sinqtt`.\n\n### With TLS support\n\n```bash\ncargo build --release --features tls\n```\n\n---\n\n## Quick Start\n\n1. Create a configuration file `config.yml`:\n\n```yaml\nmqtt:\n  host: localhost\n  port: 1883\n\ninfluxdb:\n  host: localhost\n  port: 8181\n  token: your-api-token\n  org: your-organization\n  bucket: your-bucket\n\npoints:\n  - measurement: temperature\n    topic: sensors/+/temperature\n    fields:\n      value: $.payload\n    tags:\n      sensor_id: $.topic[1]\n```\n\n2. Run the bridge:\n\n```bash\nsinqtt -c config.yml\n```\n\n---\n\n## CLI Usage\n\n```\nsinqtt [OPTIONS]\n\nOptions:\n  -c, --config \u003cFILE\u003e  Path to configuration file (YAML)  [required]\n  -D, --debug          Enable debug logging\n  -t, --test           Validate configuration without running\n  -d, --daemon         Daemon mode: retry on error\n  -h, --help           Print help\n  -V, --version        Print version\n```\n\n---\n\n## Configuration Reference\n\n### MQTT Section\n\n```yaml\nmqtt:\n  host: localhost          # Broker hostname\n  port: 1883               # Broker port\n  username: user           # Optional authentication\n  password: pass\n  cafile: /path/to/ca.crt  # Optional TLS (requires --features tls)\n  certfile: /path/to/cert\n  keyfile: /path/to/key\n```\n\n### InfluxDB Section\n\n```yaml\ninfluxdb:\n  host: localhost          # InfluxDB hostname\n  port: 8181               # InfluxDB port\n  token: your-api-token    # API token\n  org: your-organization   # Organization name\n  bucket: your-bucket      # Default bucket\n  enable_gzip: false       # Optional gzip compression\n```\n\n### Points Section\n\n```yaml\npoints:\n  - measurement: temperature\n    topic: node/+/thermometer/+/temperature\n    bucket: custom_bucket   # Optional: override default bucket\n    schedule: '0 * * * *'   # Optional: cron filter\n    fields:\n      value: $.payload\n      converted:\n        value: $.payload.raw\n        type: float\n      calculated: = 32 + ($.payload.celsius * 9 / 5)\n    tags:\n      id: $.topic[1]\n      channel: $.topic[3]\n    httpcontent:            # Optional: fields to forward via HTTP\n      temp: $.payload.temperature\n```\n\n### Type Conversion\n\nFields support optional type conversion:\n\n```yaml\nfields:\n  temperature:\n    value: $.payload.temp\n    type: float\n```\n\n| Type | Description | Example |\n|------|-------------|---------|\n| `float` | Floating-point number | `\"123\"` -\u003e `123.0` |\n| `int` | Integer number | `\"42\"` -\u003e `42` |\n| `str` | String | `123` -\u003e `\"123\"` |\n| `bool` | Boolean | `1` -\u003e `true` |\n| `booltoint` | Boolean converted to 0/1 | `true` -\u003e `1` |\n\n### Payload Formats\n\nBoth JSON and raw string payloads are supported:\n\n| Payload | Parsed As | `$.payload` Value |\n|---------|-----------|-------------------|\n| `25.5` | JSON number | `25.5` (float) |\n| `{\"temp\": 25}` | JSON object | `{\"temp\": 25}` |\n| `[1, 2, 3]` | JSON array | `[1, 2, 3]` |\n| `\"hello\"` | JSON string | `\"hello\"` |\n| `ON` | Raw string | `\"ON\"` |\n| `Device ready` | Raw string | `\"Device ready\"` |\n\nRaw strings are useful for simple MQTT messages like Tasmota power states (`ON`/`OFF`) or status messages.\n\n### JSONPath Syntax\n\n- `$.payload` - Entire payload (JSON or raw string)\n- `$.payload.temperature` - Nested field (JSON only)\n- `$.payload.data[0]` - Array index (JSON only)\n- `$.topic[n]` - Topic segment (0-indexed)\n- `$.payload['pm2.5']` - Field with special characters (dot, space, etc.)\n\n**Special Characters:** Use bracket notation with quotes for field names containing dots, spaces, or other reserved characters:\n\n```yaml\n# For payload: {\"air_quality_sensor\": {\"pm2.5\": 5}}\nfields:\n  pm25: $.payload.air_quality_sensor['pm2.5']\n```\n\n### Mathematical Expressions\n\nFields starting with `=` are evaluated as mathematical expressions:\n\n```yaml\nfields:\n  fahrenheit: = 32 + ($.payload * 9 / 5)\n  doubled: = $.payload.value * 2\n  power: = $.payload.base ^ $.payload.exponent\n```\n\nSupported operators:\n- Arithmetic: `+`, `-`, `*`, `/`, `%`\n- Power: `^`\n- Parentheses for grouping\n\n### Environment Variables\n\nUse `${VAR}` or `${VAR:default}` syntax to substitute environment variables in any string value.\n\n```yaml\nmqtt:\n  host: ${SINQTT_MQTT_HOST:localhost}\n  port: ${SINQTT_MQTT_PORT:1883}\n  username: ${SINQTT_MQTT_USERNAME:}\n  password: ${SINQTT_MQTT_PASSWORD:}\n\ninfluxdb:\n  host: ${SINQTT_INFLUXDB_HOST:localhost}\n  port: ${SINQTT_INFLUXDB_PORT:8181}\n  token: ${SINQTT_INFLUXDB_TOKEN}\n  org: ${SINQTT_INFLUXDB_ORG:default}\n  bucket: ${SINQTT_INFLUXDB_BUCKET:metrics}\n```\n\n- `${VAR}` - Required variable (error if not set)\n- `${VAR:default}` - Optional variable with default value\n- `${VAR:}` - Optional variable with empty default\n\n### Optional HTTP Forwarding\n\n```yaml\nhttp:\n  destination: https://example.com/api\n  action: post    # Values post, put, or patch\n  username: user  # Optional basic auth\n  password: pass\n```\n\n### Optional Base64 Decoding\n\n```yaml\nbase64decode:\n  source: $.payload.data\n  target: data\n```\n\n---\n\n## Complete Example\n\n```yaml\nmqtt:\n  host: ${MQTT_HOST:localhost}\n  port: 1883\n  username: ${MQTT_USER:}\n  password: ${MQTT_PASS:}\n\ninfluxdb:\n  host: ${INFLUXDB_HOST:localhost}\n  port: 8181\n  token: ${INFLUXDB_TOKEN}\n  org: my-org\n  bucket: iot-data\n  enable_gzip: true\n\nhttp:\n  destination: https://webhook.example.com/data\n  action: post\n\npoints:\n  # Simple numeric sensor\n  - measurement: temperature\n    topic: sensors/+/temperature\n    fields:\n      value: $.payload\n    tags:\n      sensor_id: $.topic[1]\n\n  # JSON telemetry with multiple fields\n  - measurement: environment\n    topic: devices/+/telemetry\n    fields:\n      temperature: $.payload.temperature\n      humidity: $.payload.humidity\n      pressure:\n        value: $.payload.pressure\n        type: float\n    tags:\n      device_id: $.topic[1]\n\n  # Computed field (Celsius to Fahrenheit)\n  - measurement: temperature_fahrenheit\n    topic: sensors/+/temperature\n    fields:\n      celsius: $.payload\n      fahrenheit: = 32 + ($.payload * 9 / 5)\n    tags:\n      location: $.topic[1]\n\n  # Tasmota power state (raw string)\n  - measurement: power_state\n    topic: stat/+/power\n    fields:\n      state: $.payload\n    tags:\n      device: $.topic[1]\n\n  # Scheduled write (every 5 minutes)\n  - measurement: periodic_reading\n    topic: sensors/#\n    schedule: '0 */5 * * * *'\n    fields:\n      value: $.payload\n```\n\n---\n\n## Development\n\n```bash\ngit clone https://github.com/hardwario/sinqtt.git\ncd sinqtt\ncargo build\ncargo test\ncargo run -- -c tests/fixtures/sample-config.yml --debug\n```\n\n### Running Tests\n\n```bash\n# Unit tests\ncargo test\n\n# With output\ncargo test -- --nocapture\n```\n\n---\n\n## License\n\nThis project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.\n\n---\n\nMade with ❤ by [**HARDWARIO a.s.**](https://www.hardwario.com/) in the heart of Europe.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhardwario%2Fsinqtt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhardwario%2Fsinqtt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhardwario%2Fsinqtt/lists"}