{"id":13471633,"url":"https://github.com/larsp/co2monitor","last_synced_at":"2026-02-04T01:43:21.931Z","repository":{"id":48033198,"uuid":"117825645","full_name":"larsp/co2monitor","owner":"larsp","description":"CO₂ \u0026 Temperature monitor","archived":false,"fork":false,"pushed_at":"2021-08-10T18:21:35.000Z","size":286,"stargazers_count":346,"open_issues_count":3,"forks_count":26,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-10-30T02:59:50.520Z","etag":null,"topics":["co2","go","prometheus","temperature"],"latest_commit_sha":null,"homepage":"","language":"Go","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/larsp.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":"2018-01-17T11:11:18.000Z","updated_at":"2024-10-25T17:40:37.000Z","dependencies_parsed_at":"2022-08-12T17:10:42.521Z","dependency_job_id":null,"html_url":"https://github.com/larsp/co2monitor","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/larsp%2Fco2monitor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larsp%2Fco2monitor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larsp%2Fco2monitor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larsp%2Fco2monitor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/larsp","download_url":"https://codeload.github.com/larsp/co2monitor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245662866,"owners_count":20652097,"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":["co2","go","prometheus","temperature"],"created_at":"2024-07-31T16:00:47.648Z","updated_at":"2026-02-04T01:43:21.880Z","avatar_url":"https://github.com/larsp.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/larsp/co2monitor)](https://goreportcard.com/report/github.com/larsp/co2monitor)\n[![GoDoc](https://godoc.org/github.com/larsp/co2monitor/meter?status.svg)](https://godoc.org/github.com/larsp/co2monitor/meter)\n\n# CO₂ monitor\n\n## Setup \u0026 Example\n\u003cimg src=\"https://raw.githubusercontent.com/larsp/co2monitor/img/monitor.jpg\" alt=\"Setup\" width=\"700\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/larsp/co2monitor/img/dashboard.png\" alt=\"Dashboard\" width=\"700\"\u003e\n\n## Motivation\nSome time ago an [article](https://blog.wooga.com/woogas-office-weather-wow-67e24a5338) about a low cost CO₂ monitor \ncame to our attention. A colleague quickly adopted the python [code](https://github.com/wooga/office_weather)\nto fit in our prometheus setup. Since humans are sensitive to temperature and CO₂ level, we were now able to \noptimize HVAC settings in our office (Well, we mainly complained to our facility management).\n\nFor numerous reasons I wanted to replace the python code with a static Go binary.\n\n## Hardware\n- CO₂ meter: Can be found for around 70EUR/USD at [amazon.com](https://www.amazon.com/dp/B00H7HFINS) \n\u0026 [amazon.de](https://www.amazon.de/dp/B00TH3OW4Q/). Regardless of minor differences between both devices, both work.\n- Some machine which can run the compiled Go binary, has USB and is reachable from your prometheus collector. \nA very first version of a raspberry pi is already sufficient.\n\n## Software\nYou need prometheus to collect the metrics.\n\nIt might make things easier when you set up an `udev` rule e.g.\n```bash\n$ cat /etc/udev/rules.d/99-hidraw-permissions.rules \nKERNEL==\"hidraw*\", SUBSYSTEM==\"hidraw\", MODE=\"0664\", GROUP=\"plugdev\"\n```\n\n## Run \u0026 Collect\n\nHelp\n```bash\n$ ./co2monitor --help      \nusage: co2monitor [\u003cflags\u003e] \u003cdevice\u003e [\u003clisten-address\u003e]\n\nFlags:\n  --help  Show context-sensitive help (also try --help-long and --help-man).\n\nArgs:\n  \u003cdevice\u003e            CO2 Meter device, such as /dev/hidraw2\n  [\u003clisten-address\u003e]  The address to listen on for HTTP requests.\n```\n\nStarting the meter export\n```bash\n$ ./co2monitor /dev/hidraw2\n2018/01/18 13:09:31 Serving metrics at ':8080/metrics'\n2018/01/18 13:09:31 Device '/dev/hidraw2' opened\n\n```\n\n## Credit\n\n[Henryk Plötz](https://hackaday.io/project/5301-reverse-engineering-a-low-cost-usb-co-monitor/log/17909-all-your-base-are-belong-to-us)\n\u0026 [wooga](https://github.com/wooga/office_weather)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flarsp%2Fco2monitor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flarsp%2Fco2monitor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flarsp%2Fco2monitor/lists"}