switchbot-meter-exporter

command module
v0.0.0-...-a3d4d15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2023 License: MIT Imports: 11 Imported by: 0

README

switchbot-meter-exporter

Prometheus export for SwitchBot Meter

How to use

Usage
Usage:
  main [OPTIONS]

Application Options:
  -p, --port= Port number to listen, default: 8080

Help Options:
  -h, --help  Show this help message
Environment value
key description
SWITCHBOT_OPENTOKEN open token
SWITCHBOT_SECRETKEY secret key
Prometheus config
scrape_configs:
  - job_name: "switchbot-meter"
    scrape_interval: 1m
    metrics_path: /probe
    static_configs:
      - targets:
          - <device_id>
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: <address>:<port>

How to build

  • go mod download
  • go build

License

Copyright (c) 2023 Rokoucha

Released under the MIT license, see LICENSE.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳