{"id":18563610,"url":"https://github.com/hoegaarden/go-bthome","last_synced_at":"2026-02-05T03:36:50.986Z","repository":{"id":260263634,"uuid":"880806938","full_name":"hoegaarden/go-bthome","owner":"hoegaarden","description":"Parse BTHome v2 sensor data","archived":false,"fork":false,"pushed_at":"2025-08-01T19:46:29.000Z","size":31,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-01T21:43:04.450Z","etag":null,"topics":["ble","bluetooth","bluetooth-low-energy","bthome","golang","iot","shelly"],"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/hoegaarden.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,"zenodo":null}},"created_at":"2024-10-30T11:55:37.000Z","updated_at":"2024-12-28T11:40:09.000Z","dependencies_parsed_at":"2025-04-28T15:53:41.238Z","dependency_job_id":"7380af83-2917-46e5-929b-410526d037f7","html_url":"https://github.com/hoegaarden/go-bthome","commit_stats":null,"previous_names":["hoegaarden/go-bthome"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hoegaarden/go-bthome","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoegaarden%2Fgo-bthome","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoegaarden%2Fgo-bthome/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoegaarden%2Fgo-bthome/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoegaarden%2Fgo-bthome/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hoegaarden","download_url":"https://codeload.github.com/hoegaarden/go-bthome/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoegaarden%2Fgo-bthome/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29109304,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T03:27:05.906Z","status":"ssl_error","status_checked_at":"2026-02-05T03:26:43.416Z","response_time":65,"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":["ble","bluetooth","bluetooth-low-energy","bthome","golang","iot","shelly"],"created_at":"2024-11-06T22:13:01.603Z","updated_at":"2026-02-05T03:36:50.974Z","avatar_url":"https://github.com/hoegaarden.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BTHome \u0026 golang\n\n## What\n\nThis allows you to parse advertisements from BTHome compatible devices, e.g. a\n[Shelly BLU H\u0026T sensor][blu-ht]. It is an (incomplete) implementation of the [BTHome v2\nformat][bthomev2]. It relies on other low-level bits to do the bluetooth / BLE\ncommunication, e.g. [go-ble].\n\n## Status\n\n- incomplete: I only implemented what I needed for my sensors\n- PoC: This is just a quick \u0026 dirty PoC, use at your on risk\n\n\n## Encryption\n\nEncrypted packets can be read, the decryption [as documented][crypt] has been implemented.\n\nFor Shelly devices you can use the [Shelly BLE Debug Android app][bleApp] to\nencrypt your sensor. The sensor will then be provisioned with a random\nencryption key. After encryption you can \"Read\" the device and can find the key\nin `settings.encryptionKey`, this should be a 32 character string (16 byte hex\nencoded). This key can then be used with this parser by adding it and the\nsensor's MAC via the `AddEncryptionKey` method.\n\nEncryption for one sensor is implemented in the [cmd/bluezScan][exampleBluez].\n\n\n## Examples\n\nIn the example in [cmd/readSensors][example] you find an implementation of a\ntool which listens for advertisements of sensors and just prints the parsed\nBTHome data:\n\n```terminal\n: sudo go run cmd/readSensors/main.go -mac 7c:c6:b6:71:9d:b5 -mac 7c:c6:b6:71:98:d7\n2024/11/01 15:40:14 Scan on default starting\n2024/11/01 15:40:28 [7c:c6:b6:71:9d:b5] BTHomePacket{Encrypted: false, Trigger: Button, BTHomeVersion: 2, ID: 222, Battery: [100], Humidity: [59], Temperature: [20.80], Button: [Press]}\n2024/11/01 15:40:37 [7c:c6:b6:71:98:d7] BTHomePacket{Encrypted: false, Trigger: Button, BTHomeVersion: 2, ID: 208, Battery: [100], Humidity: [53], Temperature: [22.00]}\n^C\n2024/11/01 15:40:39 Scan on device default stopped\n: \n```\n\nThere is another example in [cmd/bluezScan][exampleBluez], which uses\n[tiny-go/bluetooth][tgb] which in turn uses [BlueZ] under the hood (on Linux),\nand implements a similar tool as the example above:\n\n```terminal\n: go run cmd/bluezScan/main.go\n2024/11/02 11:31:20 scanning...\n2024/11/02 11:31:37 [7C:C6:B6:71:98:D7] BTHomePacket{Encrypted: false, Trigger: Button, BTHomeVersion: 2, ID: 119, Battery: [100], Humidity: [55], Temperature: [19.90]}\n2024/11/02 11:32:09 [7C:C6:B6:71:9D:B5] BTHomePacket{Encrypted: false, Trigger: Button, BTHomeVersion: 2, ID: 144, Battery: [100], Humidity: [56], Temperature: [20.10]}\n2024/11/02 11:32:11 [7C:C6:B6:76:58:CE] BTHomePacket{Encrypted: true, Trigger: Button, BTHomeVersion: 2, ID: 95, Battery: [100], Humidity: [54], Temperature: [21.20]}\n\n^Csignal: interrupt\n: \n```\n\n[blu-ht]: https://www.shelly.com/products/shelly-blu-h-t-black\n[example]: ./cmd/readSensors/main.go\n[go-ble]: https://github.com/go-ble/ble/\n[bthomev2]: https://bthome.io/format/\n[exampleBluez]: ./cmd/bluezScan/main.go\n[tgb]: https://github.com/tinygo-org/bluetooth\n[BlueZ]: https://www.bluez.org/\n[crypt]: https://bthome.io/encryption/\n[bleApp]: https://play.google.com/store/apps/details?id=cloud.shelly.bledebug\u0026hl=en\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoegaarden%2Fgo-bthome","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoegaarden%2Fgo-bthome","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoegaarden%2Fgo-bthome/lists"}