{"id":13582222,"url":"https://github.com/jckuester/weather-station","last_synced_at":"2025-03-22T18:33:32.623Z","repository":{"id":57583908,"uuid":"119722735","full_name":"jckuester/weather-station","owner":"jckuester","description":"A Prometheus exporter for 433 MHz temperature and humidity sensors","archived":false,"fork":false,"pushed_at":"2023-02-23T23:49:45.000Z","size":5512,"stargazers_count":64,"open_issues_count":8,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T13:51:28.195Z","etag":null,"topics":["arduino","golang","grafana","prometheus-exporter","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jckuester.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-01-31T17:56:14.000Z","updated_at":"2024-04-04T16:09:12.000Z","dependencies_parsed_at":"2024-01-19T08:08:53.535Z","dependency_job_id":"a55f3cf0-1c91-4d75-b413-a50eedf44640","html_url":"https://github.com/jckuester/weather-station","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jckuester%2Fweather-station","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jckuester%2Fweather-station/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jckuester%2Fweather-station/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jckuester%2Fweather-station/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jckuester","download_url":"https://codeload.github.com/jckuester/weather-station/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245003333,"owners_count":20545596,"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":["arduino","golang","grafana","prometheus-exporter","raspberry-pi"],"created_at":"2024-08-01T15:02:30.295Z","updated_at":"2025-03-22T18:33:31.984Z","avatar_url":"https://github.com/jckuester.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"\u003cimg alt=\"Weather Station\" src=\"img/logo_banner.png\" /\u003e\n \n---\n \n\u003cp align=\"right\"\u003e\n  \u003ca href=\"https://github.com/jckuester/weather-station/releases/latest\"\u003e\n    \u003cimg alt=\"Release\" src=\"https://img.shields.io/github/release/jckuester/weather-station.svg?style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/jckuester/weather-station/master\"\u003e\n    \u003cimg alt=\"Travis\" src=\"https://img.shields.io/travis/jckuester/weather-station/master.svg?style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://goreportcard.com/report/github.com/jckuester/weather-station\"\u003e\n    \u003cimg alt=\"Go Report\" src=\"https://goreportcard.com/badge/github.com/jckuester/weather-station?style=flat-square\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/jckuester/weather-station\"\u003e\n    \u003cimg alt=\"Codecov branch\" src=\"https://codecov.io/gh/jckuester/weather-station/branch/master/graph/badge.svg?style=flat-square\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://godoc.org/github.com/jckuester/weather-station\"\u003e\n    \u003cimg alt=\"Go Doc\" src=\"https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/jckuester/weather-station/blob/master/LICENSE\"\u003e\n    \u003cimg alt=\"Software License\" src=\"https://img.shields.io/github/license/jckuester/weather-station.svg?style=flat-square\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp\u003e\n  \u003cimg src=\"img/hardware.jpg\" alt=\"Hardware of the weather station\"\u003e\n  \u003cem\u003eFigure 1: Hardware in use: Raspberry Pi, Arduino Nano, RXB6 433Mhz receiver,\n  and as many GT-WT-01 temperature/humidity sensors as you like.\u003c/em\u003e\n\u003c/p\u003e\n\n\u003cp\u003e\n  \u003cimg src=\"img/gauges.png\" alt=\"Grafana dashboard\"\u003e\n  \u003cem\u003eFigure 2: Grafana dashboard showing an overview of current\n  temperatures and humidities around my house as well as the status of alerts\n  (e.g., I will get notified when my piano is too cold or humid so that I can assure it stays longer tuned).\u003c/em\u003e\n\u003c/p\u003e\n\n\u003cp\u003e\n  \u003cimg src=\"img/fridge.png\" alt=\"Fridge temperature and humidity (last 24h)\"\u003e\n  \u003cem\u003eFigure 3: Temperature and humidity of the fridge within the last 24h (the upper red line defines a threshold of \n  9° Celsius; so if my old fridge gets too warm I will get notified in Slack).\u003c/em\u003e\n\u003c/p\u003e\n\n\u003cp\u003e\n  \u003cimg src=\"img/humidity.png\" alt=\"Humidity inside (last 24h)\"\u003e\n  \u003cem\u003eFigure 4: Humidity inside rooms and piano.\u003c/em\u003e\n\u003c/p\u003e\n\n  \nThis is an opinionated and affordable setup to measure and log temperature and humidity around the house. Opinionated \nbecause I like Go, Prometheus, and Grafana. Affordable because each sensor costs around 10 Euros.\n \nIn a nutshell, this repo offers you a prometheus exporter for 433 MHz temperature/humidity sensors, where\nsignals are received via an Arduino ([with this software flashed to it](https://github.com/pimatic/homeduino#flashing))\nconnected to (in my case) a Raspberry Pi.\n\nHappy measuring!\n\n## Hardware\n\nYou see it all in Figure 1:\n\n* Raspberry Pi\n* Arduino Nano\n* [RF unit](https://www.amazon.de/gp/product/B06XHJMC82/ref=oh_aui_detailpage_o00_s00?ie=UTF8\u0026psc=1) for the Arduino\n (don't try to save a few dollars by buying a cheap one; it has a very tiny range)\n* [GT-WT-01 temperature/humidity sensors](https://www.teknihall.be/en/node/1430)\n(get as many as you like; I bought six on [eBay](https://www.ebay.com/itm/361435018543): one for outside, one for every room, one for the fridge, one for inside my piano, etc.)\n\n***Note:*** I realised that the GT-WT-01 sensors seem to be purchasable only in the EU and UK.\nHowever, [protocols for other sensors](https://github.com/pimatic/rfcontroljs/blob/master/protocols.md) \ncan easily be added to the [supported protocols](pulse/protocol.go) of this project, too. I would be happy to see your contribution.\n\n## Software\n\n* [Prometheus](https://prometheus.io/)\n* [Grafana](https://grafana.com/) (you can download the newest Deb packages for the Pi [here](https://github.com/fg2it/grafana-on-raspberry/releases))\n* [Flash Arduino to recieve signals](https://github.com/pimatic/homeduino#flashing)\n* [Slack](https://slack.com/) (if you want to get notified about alerts)\n\n## Download\n\nGet the binary for the Raspberry Pi (ARM) or other platforms [here](https://github.com/jckuester/weather-station/releases).\n\n## Usage\n\nTo see options available run `$ ./weather-station --help`:\n```\nusage: weather-station [\u003cflags\u003e] [\u003cconfig.yaml\u003e]\n\nFlags:\n  --help                    Show context-sensitive help (also try --help-long and --help-man).\n  --device=\"/dev/ttyUSB0\"   Arduino connected to USB\n  --listen-address=\":8080\"  The address to listen on for HTTP requests\n\nArgs:\n  [\u003cconfig.yaml\u003e]  Path to config file.\n```\n\n### Scanning mode (find your sensors)\n\nIf this is your first time using the exporter, simply start it without any parameters (i.e. in scanning mode). \nIn this case, logs will show all signals that the exporter is able to decode, but nothing is exported yet:\n\n```\n$ ./weather-station\n2019/10/06 21:29:08 Config File \"weather-station\" Not Found in \"[/etc/weather-station /home/jan/.config/weather-station /home/jan/git/github.com/weather-station]\" Error reading config file. Running in scanning mode.\n2019/10/06 21:29:08 Setting up serial port to use 115200 baud\n2019/10/06 21:29:08 Serial port prepared\n2019/10/06 21:29:08 Device '/dev/ttyUSB0' opened\n2019/10/06 21:29:08 Wrote command 'RESET' to '/dev/ttyUSB0' (6 bytes)\n2019/10/06 21:29:09 Line Scanned: ready\n2019/10/06 21:29:09 Serving metrics at ':8080/metrics'\n2019/10/06 21:29:09 Wrote command 'RF receive 0' to '/dev/ttyUSB0' (13 bytes)\n2019/10/06 21:29:09 Write RF receive 0\n2019/10/06 21:29:09 Line Scanned: ACK\n2019/10/06 21:29:11 Line Scanned: RF receive 1008 576 7880 4064 1856 16004 0 0 00000000121313141313131413141413141414141414131413141313141314141314131314131414141414141315\n2019/10/06 21:29:12 Unsupported protocol or error decoding the pulse\n2019/10/06 21:29:28 Line Scanned: RF receive 560 4112 2068 9080 0 0 0 0 0102020102020201020202020102020102020202010102020201020202020101020101020103\n2019/10/06 21:29:28 Sensor has no matching configuration, potential protocols:\n2019/10/06 21:29:28 weather12: {ID:145 Name:145 Channel:1 Temperature:-178 Humidity:33 LowBattery:false}\n2019/10/06 21:29:28 weather15: {ID:2320 Name:2320 Channel:2 Temperature:19.6 Humidity:54 LowBattery:true}\n...\n```\n\n### Export mode (use your sensors)\n\n1) To find your sensors in the logs, look for lines with `Sensor has no matching configuration, potential protocols`. The exporter tries to \n   decode every received signal with all currently supported protocols. However, not all decodings make sense. For example,\n   the decoded signal using protocol `weather12` makes no sense (`Temperature: -178`), but using `weather15` does\n   (as these decoded temperature/humidity values are also shown on the little sensor's display in front of me).\n\n2) Then, write all the IDs of sensors you'd like export to Prometheus into a config file (e.g. `my-sensors.yml`):\n\n    ```\n    sensors:\n      2320:\n        location: kitchen\n        protocol: weather15\n      \u003canother-id\u003e:\n        location: \u003csome-location\u003e\n        protocol: \u003ca-supported-protocol\u003e        \n    ```\n\n3) Restart the weather station and use the config: `$ ./weather-station my-sensors.yml`\n\n## Currently supported devices\n\n* GT-WT-01 temperature/humidity sensor (use `weather15` protocol)\n* GT-WT-01 non-variant temperature/humidity sensor (use `weather12` protocol)\n\nFeel free to support more devices!\n\n## Dashboards\n\nHere is [my version of the Grafana dashboard](./grafana-dashboard.json) that you see above. Feel free to use\n it as a starting point for customizing yours (of course, sensor IDs need to be adapted accordingly).\n\n## Credits\n\n* Thanks for contributing the logo, [ssnjrthegr8](https://github.com/ssnjrthegr8).\n\n* Idea of this [CO2 Prometheus exporter](https://github.com/larsp/co2monitor)\nhas been an inspiration and starting point for this project.\n\n* All the hard work of reverse engineering various protocols and finding the correct decodings has been already\ndone by the [Pimatic project](https://github.com/pimatic/rfcontroljs).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjckuester%2Fweather-station","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjckuester%2Fweather-station","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjckuester%2Fweather-station/lists"}