{"id":32517175,"url":"https://github.com/phil8192/switchbot-reader","last_synced_at":"2025-10-28T02:50:14.677Z","repository":{"id":314593046,"uuid":"1056063497","full_name":"phil8192/switchbot-reader","owner":"phil8192","description":"read switchbot hub and sensors via bluetooth","archived":false,"fork":false,"pushed_at":"2025-09-13T11:36:52.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-13T13:51:30.934Z","etag":null,"topics":["iot","switchbot"],"latest_commit_sha":null,"homepage":"","language":"Python","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/phil8192.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-13T10:07:48.000Z","updated_at":"2025-09-13T12:00:24.000Z","dependencies_parsed_at":"2025-09-13T13:51:34.059Z","dependency_job_id":"1ea12b29-e894-4c37-8ad2-c043c7c470d7","html_url":"https://github.com/phil8192/switchbot-reader","commit_stats":null,"previous_names":["phil8192/switchbot-reader"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/phil8192/switchbot-reader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phil8192%2Fswitchbot-reader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phil8192%2Fswitchbot-reader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phil8192%2Fswitchbot-reader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phil8192%2Fswitchbot-reader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phil8192","download_url":"https://codeload.github.com/phil8192/switchbot-reader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phil8192%2Fswitchbot-reader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281376666,"owners_count":26490317,"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","status":"online","status_checked_at":"2025-10-28T02:00:06.022Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["iot","switchbot"],"created_at":"2025-10-28T02:50:12.510Z","updated_at":"2025-10-28T02:50:14.672Z","avatar_url":"https://github.com/phil8192.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# switchbot reader\n\nreading data from switchbot sensors.\n\n## synopsis\n```\n[phil@arasaka switchbot]$ python switchbot.py -h\nusage: switchbot.py [-h] [-o {pp,csv,json}] [-a]\n\nread switchbot sensors over bluetooth\n\noptions:\n  -h, --help            show this help message and exit\n  -o, --output {pp,csv,json}\n                        pretty print (default), (csv or json. so you can |pipe)\n  -a, --all             print all readings, regardless of state change. expect every 5 seconds.\n\nwill run forever. \u003ccrtl-c\u003e to exit.\n```\n\n## conf\n\n```cp example-devices.yaml devices.yaml```\n...edit.\n\n## examples\n\n### pretty print\njust watch.\n\n```bash\n[phil@arasaka switchbot]$ python switchbot.py\n2025-09-13 11:00:24\toffice          sensor-1   ( -42dBm)\ttemp = 21.7c humidity = 62% \n2025-09-13 11:00:25\tliving room     sensor-0   ( -78dBm)\ttemp = 19.4c humidity = 61% light level = 1\n2025-09-13 11:00:25\tattic           sensor-8   ( -76dBm)\ttemp = 18.4c humidity = 81% \n2025-09-13 11:00:26\tgarden          sensor-6   ( -86dBm)\ttemp = 14.7c humidity = 79% \n2025-09-13 11:00:26\tgarden          sensor-7   ( -78dBm)\ttemp = 14.9c humidity = 77% \n2025-09-13 11:00:30\tkitchen         sensor-3   ( -82dBm)\ttemp = 18.8c humidity = 64%\n2025-09-13 11:02:42\tgarden          sensor-6   ( -84dBm)\ttemp = 14.4c humidity = 81% \n2025-09-13 11:03:26\tgarden          sensor-7   ( -80dBm)\ttemp = 14.5c humidity = 77% \n2025-09-13 11:04:47\tgarden          sensor-6   ( -88dBm)\ttemp = 14.1c humidity = 81% \n2025-09-13 11:05:14\tgarden          sensor-7   ( -82dBm)\ttemp = 14.1c humidity = 78% \n2025-09-13 11:06:46\tattic           sensor-8   ( -76dBm)\ttemp = 18.5c humidity = 78% \n2025-09-13 11:07:29\tgarden          sensor-6   ( -94dBm)\ttemp = 13.8c humidity = 81% \n2025-09-13 11:08:07\tgarden          sensor-7   ( -80dBm)\ttemp = 13.8c humidity = 78% \n2025-09-13 11:09:18\tgarden          sensor-6   ( -78dBm)\ttemp = 13.5c humidity = 82% \n2025-09-13 11:10:59\tgarden          sensor-7   ( -96dBm)\ttemp = 13.5c humidity = 80% \n2025-09-13 11:13:37\tkitchen         sensor-3   ( -90dBm)\ttemp = 18.7c humidity = 64% \n2025-09-13 11:14:44\tgarden          sensor-6   ( -82dBm)\ttemp = 13.2c humidity = 82% \n2025-09-13 11:15:28\tgarden          sensor-7   ( -90dBm)\ttemp = 13.2c humidity = 80% \n2025-09-13 11:15:59\tliving room     sensor-0   ( -80dBm)\ttemp = 19.4c humidity = 61% light level = 2\n2025-09-13 11:16:54\tattic           sensor-8   ( -86dBm)\ttemp = 18.3c humidity = 77% \n2025-09-13 11:16:54\tliving room     sensor-0   ( -80dBm)\ttemp = 19.4c humidity = 61% light level = 3\n2025-09-13 11:17:14\tliving room     sensor-0   ( -80dBm)\ttemp = 19.4c humidity = 61% light level = 4\n2025-09-13 11:17:26\tliving room     sensor-0   ( -82dBm)\ttemp = 19.4c humidity = 61% light level = 5\n2025-09-13 11:17:38\tliving room     sensor-0   ( -88dBm)\ttemp = 19.4c humidity = 61% light level = 8\n2025-09-13 11:17:47\tliving room     sensor-0   ( -80dBm)\ttemp = 19.4c humidity = 61% light level = 6\n2025-09-13 11:17:58\tliving room     sensor-0   ( -80dBm)\ttemp = 19.4c humidity = 61% light level = 10\n2025-09-13 11:18:08\tliving room     sensor-0   ( -88dBm)\ttemp = 19.4c humidity = 61% light level = 11\n2025-09-13 11:18:30\tliving room     sensor-0   ( -80dBm)\ttemp = 19.4c humidity = 61% light level = 12\n2025-09-13 11:21:00\tliving room     sensor-0   ( -80dBm)\ttemp = 19.4c humidity = 61% light level = 11\n2025-09-13 11:21:22\tliving room     sensor-0   ( -80dBm)\ttemp = 19.4c humidity = 61% light level = 12\n2025-09-13 11:21:58\tgarden          sensor-7   ( -74dBm)\ttemp = 13.6c humidity = 82%\n...\n```\n\n### json\npipe it to something.\n\n```bash\n[phil@arasaka switchbot]$ python -u switchbot.py -a -o json |jq\n{\n  \"time\": 1757762346,\n  \"location\": \"garden\",\n  \"id\": \"sensor-6\",\n  \"rssi\": -80,\n  \"temp\": 14.0,\n  \"humidity\": 82\n}\n{\n  \"time\": 1757762400,\n  \"location\": \"office\",\n  \"id\": \"sensor-1\",\n  \"rssi\": -46,\n  \"temp\": 21.7,\n  \"humidity\": 62\n}\n...\n```\n\n### csv\ndump it to something.\n\n```bash\n[phil@arasaka switchbot]$ python -u switchbot.py -o csv \u003e/tmp/dump.csv\n[phil@arasaka switchbot]$ cat /tmp/dump.csv \n1757762656,living room,sensor-0,-86,19.6,61,3\n1757762659,garden,sensor-7,-80,15.7,75,\n1757762659,office,sensor-1,-46,21.7,62,\n1757762659,garden,sensor-6,-82,14.2,84,\n...\n```\n\n### pipe to a dashboard\nexample ai generated.\n```bash\nSB_STALE_SECS=300 python -u switchbot.py -a -o json | tools/ai_generated_console_dash_ncurses\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphil8192%2Fswitchbot-reader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphil8192%2Fswitchbot-reader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphil8192%2Fswitchbot-reader/lists"}