{"id":16926034,"url":"https://github.com/databus23/sml-exporter","last_synced_at":"2026-04-12T22:15:45.482Z","repository":{"id":145456491,"uuid":"489090611","full_name":"databus23/sml-exporter","owner":"databus23","description":"A prometheus exporter for sml enabled power meters","archived":false,"fork":false,"pushed_at":"2024-04-03T10:21:42.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-25T22:34:47.706Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/databus23.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-05-05T18:48:37.000Z","updated_at":"2022-05-05T18:48:58.000Z","dependencies_parsed_at":"2024-04-03T11:42:34.854Z","dependency_job_id":null,"html_url":"https://github.com/databus23/sml-exporter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/databus23%2Fsml-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/databus23%2Fsml-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/databus23%2Fsml-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/databus23%2Fsml-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/databus23","download_url":"https://codeload.github.com/databus23/sml-exporter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244722657,"owners_count":20499153,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-13T20:28:50.201Z","updated_at":"2026-04-12T22:15:45.477Z","avatar_url":"https://github.com/databus23.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sml-exporter\n\nsml-exporter is an exporter for SML-enabled smart meters.\nIt currently supports exposing SML data in the following ways:\n\n* Prometheus metrics\n* MQTT\n\n## Usage\n\n```\nUsage of sml-exporter:\n  -config string\n    \tConfig file with OBIS code mappings\n  -debug\n    \tEnable debug logging\n  -health-timeout duration\n    \tTimeout duration for health check (default 10s)\n  -metrics-address string\n    \tThe address to listen on for HTTP requests (default \":9761\")\n  -mqtt-password string\n    \tMQTT password\n  -mqtt-server string\n    \tMQTT server to publish values to as they are received\n  -mqtt-topic-prefix string\n    \tMQTT topic prefix for publishing values (default \"smartmeter\")\n  -mqtt-username string\n    \tMQTT username\n  -serial string\n    \tSerial device to read from\n```\n\nA health check endpoint is available at `/healthz`. It returns 200 if data has been received within the configured `-health-timeout`, and 503 otherwise.\n\n## OBIS code mapping\n\nHow individual OBIS codes are exposed is configurable via a YAML configuration file (see `example-config.yaml` for a full example).\n\nEach entry maps an OBIS code to an optional MQTT topic, Prometheus metric, or named variable:\n\n```yaml\n1-0:96.1.0*255:\n  type: string\n  var: server_id\n1-0:1.8.0*255:\n  mqtt:\n    topic: \"smartmeter/wirkarbeit-verbrauch\"\n  metric:\n    name: \"smartmeter_wirkarbeit_verbrauch_wh_total\"\n    help: \"Total active energy consumed in Wh\"\n1-0:2.8.0*255:\n  mqtt:\n    topic: \"smartmeter/wirkarbeit-einspeisung\"\n  metric:\n    name: \"smartmeter_wirkarbeit_einspeisung_wh_total\"\n    help: \"Total active energy fed back in Wh\"\n1-0:16.7.0*255:\n  mqtt:\n    topic: \"smartmeter/momentane-wirkleistung\"\n  metric:\n    name: \"smartmeter_leistung_gesamt_w\"\n    help: \"Current total active power in W\"\n```\n\nEntries with `type: string` and `var` store the value as a named variable instead of exporting it. These variables can be referenced elsewhere — for example, `server_id` is automatically added as a label to all Prometheus metrics, identifying which smart meter the readings came from.\n\n## Docker\n\nPre-built multi-arch Docker images (linux/amd64, linux/arm64) are published to Docker Hub:\n\n```\ndocker pull databus23/sml-exporter\n```\n\n```bash\ndocker run --device /dev/ttyUSB0 -v ./config.yaml:/etc/sml-exporter/config.yaml \\\n  databus23/sml-exporter -serial /dev/ttyUSB0 -config /etc/sml-exporter/config.yaml\n```\n\n## Kubernetes\n\nExample Kubernetes manifests are provided in [`examples/kubernetes/`](examples/kubernetes/). The example uses Kustomize to deploy the exporter with a ConfigMap-based configuration:\n\n```bash\n# Review and adjust examples/kubernetes/config.yaml for your meter\nkubectl apply -k examples/kubernetes/\n```\n\nThe deployment requires `privileged: true` to access the serial device on the host. Adjust the serial device path in the deployment if your device is not at `/dev/ttyUSB0`.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatabus23%2Fsml-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatabus23%2Fsml-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatabus23%2Fsml-exporter/lists"}