{"id":21178056,"url":"https://github.com/reynico/dreams","last_synced_at":"2026-04-13T10:32:16.332Z","repository":{"id":151690073,"uuid":"209158419","full_name":"reynico/dreams","owner":"reynico","description":"Sleep better","archived":false,"fork":false,"pushed_at":"2019-10-06T19:28:43.000Z","size":209,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-14T18:48:30.585Z","etag":null,"topics":["arduino","esp32","esp8266","grafana","prometheus"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reynico.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-17T21:18:49.000Z","updated_at":"2022-12-21T17:58:05.000Z","dependencies_parsed_at":"2023-06-04T00:15:38.789Z","dependency_job_id":null,"html_url":"https://github.com/reynico/dreams","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/reynico/dreams","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reynico%2Fdreams","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reynico%2Fdreams/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reynico%2Fdreams/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reynico%2Fdreams/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reynico","download_url":"https://codeload.github.com/reynico/dreams/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reynico%2Fdreams/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31749038,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T09:16:15.125Z","status":"ssl_error","status_checked_at":"2026-04-13T09:16:05.023Z","response_time":93,"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":["arduino","esp32","esp8266","grafana","prometheus"],"created_at":"2024-11-20T17:19:36.246Z","updated_at":"2026-04-13T10:32:16.312Z","avatar_url":"https://github.com/reynico.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"Dreams uses temperature, humidity and CO2 concentration sensors to create a Prometheus exporter with consistent data about your environment. This repository also includes the server side stuff such as [Prometheus](https://prometheus.io/) and [Grafana](https://grafana.com/). Both are [Docker](https://docs.docker.com/install/) containers running with [docker-compose](https://docs.docker.com/compose/install/). Check the [prometheus server configuration](#prometheus-server-configuration) section.\n\n- [Shopping list](#shopping-list)\n- [Diagram](#diagram)\n- [Setup](#setup)\n  - [Setup the Arduino IDE](#setup-the-arduino-ide)\n  - [Setup the exporter](#setup-the-exporter)\n- [Prometheus exporter](#prometheus-exporter)\n- [Prometheus server configuration](#prometheus-server-configuration)\n\n## Shopping list\n* [0-5000ppm CO2 sensor](https://www.dfrobot.com/product-1549.html) ($58)\n* [DHT-22 temperature and humidity sensor](https://www.dfrobot.com/product-1102.html) ($5.90)\n* [FireBeetle ESP32 IoT microcontroller](https://www.dfrobot.com/product-1590.html) ($19)\n\n## Diagram\n![Wiring Diagram](https://raw.githubusercontent.com/reynico/dreams/master/wiring.png)\n* The CO2 concentration sensor uses the internal ADC located on A0. Connect the CO2 sensor analog output to A0. 5v power supply is required.\n* The DHT22 sensor uses a digital signal to send both temperature and humidity. Connect the digital output to D12. 3.3v power supply is required.\n\n## Setup\nEach [dreams.ino](dreams.ino), [dreams_bedroom.ino](dreams_bedroom.ino) and [dreams_kitchen.ino](dreams_kitchen.ino) belongs to your home exporters. \n\n### Setup the Arduino IDE\nFireBeetle is handled as an extra board for Arduino\n* Go to File -\u003e Preferences -\u003e Additional board URL, paste https://raw.githubusercontent.com/DFRobot/FireBeetle-ESP8266/master/package_firebeetle8266_index.json\n* Go to Tools -\u003e Boards -\u003e Boards manager. Install `FireBeetle-ESP8266`\n\nDHT22 needs an special library as well\n* Go to Sketch -\u003e Include library -\u003e Library manager. Search for `DHT22`, install.\n\n### Setup the exporter\n* dreams*.ino contains:\n  * `host`: The exporter hostname exposed in your router's ARP table \n  * `ip_addr`: The exporter IP address\n  * `gw`: The gateway\n  * `subnet`: The network subnet\n \nNote: Each exporter needs to have a different IP address.\n* core.ino contains:\n  * `ssid`: The WiFi network name to connect\n  * `password`: The WiFi network password to connect\n\n## Prometheus exporter\nOnce powered up and connected to WiFi, each node serves a single HTML page with a Prometheus-like exporter format:\n```\n[nico@x220 ~]$ curl 192.168.1.6:9000/metrics\nco2_concentration 735.89\ntemperature_c 20.10\nhumidity 38.00\n```\n\n## Prometheus server configuration\n* Edit `server/prometheus.yml` to match your Dreams node IP addresses:\n```\nscrape_configs:\n  - job_name: 'dining'\n    scrape_interval: 5s\n    static_configs:\n            - targets: ['192.168.1.6:9000']\n\n  - job_name: 'bedroom'\n    scrape_interval: 5s\n    static_configs:\n            - targets: ['192.168.1.7:9000']\n\n  - job_name: 'kitchen'\n    scrape_interval: 5s\n    static_configs:\n            - targets: ['192.168.1.8:9000']\n```\n\n* `cd server/`\n* `docker-compose up`\n\nYour Prometheus + Grafana Docker server is now up and running, and accessible through [http://localhost:3000](http://localhost:3000). The datasource and dashboard is already configured, check [server/grafana/provisioning/](server/grafana/provisioning/).\n\n![Grafana Dashboard](https://raw.githubusercontent.com/reynico/dreams/master/grafana.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freynico%2Fdreams","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freynico%2Fdreams","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freynico%2Fdreams/lists"}