{"id":21333795,"url":"https://github.com/rostrovsky/blexy","last_synced_at":"2025-03-16T01:22:08.453Z","repository":{"id":45095346,"uuid":"439886091","full_name":"rostrovsky/blexy","owner":"rostrovsky","description":"Simple OpenMetrics exporter for BLE devices","archived":false,"fork":false,"pushed_at":"2022-01-09T00:47:26.000Z","size":29,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T19:12:32.384Z","etag":null,"topics":["ble","bluetooth","iot","openmetrics","pi","prometheus","prometheus-exporter","python","raspberry","sensors"],"latest_commit_sha":null,"homepage":"","language":"Python","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/rostrovsky.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}},"created_at":"2021-12-19T14:34:30.000Z","updated_at":"2024-09-01T19:20:19.000Z","dependencies_parsed_at":"2022-09-04T15:40:58.651Z","dependency_job_id":null,"html_url":"https://github.com/rostrovsky/blexy","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rostrovsky%2Fblexy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rostrovsky%2Fblexy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rostrovsky%2Fblexy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rostrovsky%2Fblexy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rostrovsky","download_url":"https://codeload.github.com/rostrovsky/blexy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243811058,"owners_count":20351645,"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":["ble","bluetooth","iot","openmetrics","pi","prometheus","prometheus-exporter","python","raspberry","sensors"],"created_at":"2024-11-21T23:16:15.746Z","updated_at":"2025-03-16T01:22:08.427Z","avatar_url":"https://github.com/rostrovsky.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# blexy\nSimple [OpenMetrics](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md) exporter for BLE devices.\n\n## Requirements\n* device with BLE compliant transceiver (e.g. RPi 3+)\n* Python 3.7+\n\n## Running\n```\npip install blexy\nblexy --port 8888 --config-file ~/.blexy.yaml\n```\n\n## Endpoints\n* `/` - returns list of connected devices in JSON format.\n* `/metrics` - returns values read from connected BLE devices in [OpenMetrics format](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md).\n\n## Config\n* Device \u0026 server configuration is by default expected to be placed in  `./config.yaml`.\n* Custom config file path can be specified via `-c / --config-file` command line option.\n* `port` and `log_level` can be either specified in config file or through command line options (see `blexy -h` for exact option names). \n\n### Example config file\nBelow file will make blexy connect to two Xiaomi temperature / humidity sensors and listen on port 8080:\n```yaml\nport: 8080\nlog_level: info\nble:\n  devices:\n    - name: living room sensor\n      model: LYWSD03MMC\n      address: xx:xx:xx:xx:xx:xx\n    - name: bedroom sensor\n      model: LYWSD03MMC\n      address: xx:xx:xx:xx:xx:xx\n```\n\n## Example output\n```\n$ curl localhost:8080/metrics\n# TYPE battery_level_percentage gauge\n# UNIT battery_level_percentage percentage\nbattery_level_percentage_gauge{name=\"living room sensor\",model=\"LYWSD03MMC\",manufacturer=\"Xiaomi\",address=\"xx:xx:xx:xx:xx:xx\",interface=\"0\"} 77\nbattery_level_percentage_gauge{name=\"bedroom sensor\",model=\"LYWSD03MMC\",manufacturer=\"Xiaomi\",address=\"xx:xx:xx:xx:xx:xx\",interface=\"0\"} 88\n# TYPE humidity_percentage gauge\n# UNIT humidity_percentage percentage\nhumidity_percentage_gauge{name=\"living room sensor\",model=\"LYWSD03MMC\",manufacturer=\"Xiaomi\",address=\"xx:xx:xx:xx:xx:xx\",interface=\"0\"} 48\nhumidity_percentage_gauge{name=\"bedroom sensor\",model=\"LYWSD03MMC\",manufacturer=\"Xiaomi\",address=\"xx:xx:xx:xx:xx:xx\",interface=\"0\"} 51\n# TYPE temperature_celsius gauge\n# UNIT temperature_celsius celsius\ntemperature_celsius_gauge{name=\"living room sensor\",model=\"LYWSD03MMC\",manufacturer=\"Xiaomi\",address=\"xx:xx:xx:xx:xx:xx\",interface=\"0\"} 22.33\ntemperature_celsius_gauge{name=\"bedroom sensor\",model=\"LYWSD03MMC\",manufacturer=\"Xiaomi\",address=\"xx:xx:xx:xx:xx:xx\",interface=\"0\"} 25.11\n# TYPE voltage_volts gauge\n# UNIT voltage_volts volts\nvoltage_volts_gauge{name=\"living room sensor\",model=\"LYWSD03MMC\",manufacturer=\"Xiaomi\",address=\"xx:xx:xx:xx:xx:xx\",interface=\"0\"} 3.11\nvoltage_volts_gauge{name=\"bedroom sensor\",model=\"LYWSD03MMC\",manufacturer=\"Xiaomi\",address=\"xx:xx:xx:xx:xx:xx\",interface=\"0\"} 3.03\n# EOF\n```\n\n## Supported devices\n* `LYWSD03MMC` (Xiaomi)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frostrovsky%2Fblexy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frostrovsky%2Fblexy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frostrovsky%2Fblexy/lists"}