{"id":37166178,"url":"https://github.com/moikot/smartthings-metrics","last_synced_at":"2026-01-14T19:41:34.831Z","repository":{"id":57577410,"uuid":"187528215","full_name":"moikot/smartthings-metrics","owner":"moikot","description":"🔥Provides SmartThings metrics to Prometheus","archived":false,"fork":false,"pushed_at":"2023-02-25T00:47:07.000Z","size":97,"stargazers_count":16,"open_issues_count":4,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T17:30:58.007Z","etag":null,"topics":["helm","kubernetes","prometheus","smarthome","smartthings"],"latest_commit_sha":null,"homepage":"","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/moikot.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":"2019-05-19T21:07:40.000Z","updated_at":"2024-02-03T18:44:09.000Z","dependencies_parsed_at":"2024-06-20T17:13:12.947Z","dependency_job_id":"4aab8eba-5c57-4d31-a416-d5bf285a51c1","html_url":"https://github.com/moikot/smartthings-metrics","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/moikot/smartthings-metrics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moikot%2Fsmartthings-metrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moikot%2Fsmartthings-metrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moikot%2Fsmartthings-metrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moikot%2Fsmartthings-metrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moikot","download_url":"https://codeload.github.com/moikot/smartthings-metrics/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moikot%2Fsmartthings-metrics/sbom","scorecard":{"id":657112,"data":{"date":"2025-08-11","repo":{"name":"github.com/moikot/smartthings-metrics","commit":"60f81f0b190c31e00f300159d1d902972ac63692"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.4,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/22 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/release.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/moikot/smartthings-metrics/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/moikot/smartthings-metrics/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/moikot/smartthings-metrics/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/moikot/smartthings-metrics/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:66: update your workflow using https://app.stepsecurity.io/secureworkflow/moikot/smartthings-metrics/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:86: update your workflow using https://app.stepsecurity.io/secureworkflow/moikot/smartthings-metrics/release.yml/master?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:1","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   5 third-party GitHubAction dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"14 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2022-0322 / GHSA-cg3q-j54f-5p7p","Warn: Project is vulnerable to: GO-2022-0236 / GHSA-h86h-8ppg-mxmh","Warn: Project is vulnerable to: GO-2021-0238 / GHSA-83g2-8m93-v3w7","Warn: Project is vulnerable to: GO-2022-0288","Warn: Project is vulnerable to: GO-2022-0969 / GHSA-69cg-p879-7622","Warn: Project is vulnerable to: GO-2022-1144 / GHSA-xrjj-mj9h-534m","Warn: Project is vulnerable to: GO-2023-1571 / GHSA-vvpx-j8f3-3w6h","Warn: Project is vulnerable to: GO-2023-1988 / GHSA-2wrh-6pvc-2jm9","Warn: Project is vulnerable to: GO-2023-2102 / GHSA-4374-p667-p6c8","Warn: Project is vulnerable to: GHSA-qppj-fm5r-hxr3","Warn: Project is vulnerable to: GO-2024-2687 / GHSA-4v7x-pqxf-cx7m","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T14:58:58.947Z","repository_id":57577410,"created_at":"2025-08-21T14:58:58.947Z","updated_at":"2025-08-21T14:58:58.947Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28432680,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["helm","kubernetes","prometheus","smarthome","smartthings"],"created_at":"2026-01-14T19:41:34.145Z","updated_at":"2026-01-14T19:41:34.821Z","avatar_url":"https://github.com/moikot.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SmartThings metrics\n![ci](https://github.com/moikot/smartthings-metrics/workflows/ci/badge.svg)\n\nA micro-service that provides SmartThings metrics to Prometheus.\n\n## Run\n\nFor this service to have access to SmartThings API, you need to provide it with a personal access token (PAT). To generate a PAT, do the following:\n\n1. Open SmartThings [Personal access tokens](https://account.smartthings.com/tokens) page.\n2. Click | GENERATE NEW TOKEN|  button.\n3. Give it a name and enable | Devices/List all devices|  and | Devices/See all devices|  scopes.\n4. Click | GENERATE TOKEN|  button.\n\n### Run as a standalone app\n\n**Prerequisites:**\n  * [Golang \u003e=1.14](https://golang.org/doc/install)\n\n```bash\n$ go get github.com/moikot/smartthings-metrics\n$ smartthings-metrics -token [Smarthings-API-token]\n$ curl localhost:9153/metrics\n```\n\n**Note:** Using `-interval` you can define the refresh interval in seconds. The default value of the refresh interval is 60 seconds.\n\n### Run as a Docker container\n\n**Prerequisites:**\n  * [Docker](https://docs.docker.com/get-docker/)\n\n```bash\n$ docker run -d --rm -p 9153:9153 moikot/smartthings-metrics -token [Smarthings-API-token]\n$ curl localhost:9153/metrics\n```\n\n### Deploy to a Kubernetes cluster\n\n**Prerequisites:**\n  * [Kuberentes](https://kubernetes.io/)\n  * [Helm 3](https://helm.sh)\n\nSmartThing metrics service is installed to Kubernetes via its [Helm chart](https://github.com/moikot/helm-charts/tree/master/charts/smartthings-metrics).\n\n```\n$ helm repo add moikot https://moikot.github.io/helm-charts\n$ helm install smartthings-metrics moikot/smartthings-metrics --create-namespace --namespace smartthings --set token=[Smarthings-API-token]\n```\n\n## How it works\n\nThe service uses [SmartThings API](https://smartthings.developer.samsung.com/docs/api-ref/st-api.html) to obtain the current status of all connected devices periodically. It exposes the metrics received at `localhost:9153/metrics` so that [Prometheus](https://prometheus.io/) could scrape them.\n\n### Gauges\n\nMetric are exposed as Prometheus [gauges](https://prometheus.io/docs/concepts/metric_types/#gauge) their names are formed using pattern `smartthings_[component_name]_[capability_name]_[attribute_name]_[measurement_unit]` with all individual names converted to the snake case.\n\n**Examples:**\n * `smartthings_motion_sensor_motion`\n * `smartthings_battery_battery_percent`\n * `smartthings_power_meter_power_watt`\n\n**Note:**  \n  * The component name is used unless it the `main` component.\n  * The measurement unit is added for the values with units only.\n  * Gauge with the name  `smartthings_health_state` is used for the health probe.\n\n### Values\n\nAll the attributes of type `number` and `integer` are supported. Attributes of type `string` are supported only for enumerations. The service maps all of the enumeration identifiers to numbers and then uses them to translate a string value to a number. For example [switch](https://smartthings.developer.samsung.com/docs/api-ref/capabilities.html#Switch) capability defines two enumeration identifiers `on` and `off`. They will be mapped to `0.0` and `1.0`.\n\n**Note:** For `smartthings_health_state` gauge uses this static mapping:\n\n| Enumeration value | Numeric value |\n|-------------------|---------------|\n| OFFLINE |   0.0 |\n| UNHEALTHY | 1.0 |\n| ONLINE |    2.0 |\n\n### Labels\n\nSeveral labels are added for all measurements:\n\n| Label | Description |\n|-------|-------------|\n| `name` | The name of the device. |\n| `label` | The device name provided by a user (the device name by default). |\n| `device_id` | The unique identifier for the device instance. |\n| `location_id` | The identifier of the location the device is associated with. |\n| `device_manufacturer_code` | The device manufacturer code. |\n\nFor the devices with a Device Type Handler (DTH), several additional labels are provided:\n\n| Label | Description |\n|-------|-------------|\n| `device_type_name` | The name for the device type. |\n| `device_type_id` | The identifier of the device type. |\n| `device_network_type` | The device network type. |\n\n### Units\n\nThe units of measurement are mapped according to this table:\n\n| Symbol | Unit name |\n|-------|-------------|\n| % | percent |\n| lux | lux |\n| s | second |\n| W | watt |\n| C | degree_celsius |\n| K | degree_kelvin |\n| F | degree_fahrenheit |\n| V | volt |\n| kg | kilogram |\n| lbs | pound |\n| 斤 | catty |\n| CAQI | caqi |\n| dBm | decibel_milliwatt |\n| μg/m^3 | microgram_per_cubic_meter |\n| mg/m^3 | milligram_per_cubic_meter |\n| kg/m^2 | kilogram_per_square_meter |\n| kWh | kilowatt_hour |\n| ppm | parts_per_million |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoikot%2Fsmartthings-metrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoikot%2Fsmartthings-metrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoikot%2Fsmartthings-metrics/lists"}