{"id":22220702,"url":"https://github.com/giovannibaccichet/powermonitor","last_synced_at":"2026-05-04T22:43:25.226Z","repository":{"id":264864736,"uuid":"766232454","full_name":"GiovanniBaccichet/powermonitor","owner":"GiovanniBaccichet","description":"A cheap and easy solution to make your electricity meter smarter","archived":false,"fork":false,"pushed_at":"2024-11-26T13:55:51.000Z","size":3746,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-23T19:47:27.184Z","etag":null,"topics":["bh1750","home-assistant","iot","kwh","mqtt","power-meter","smart-home","smart-meter"],"latest_commit_sha":null,"homepage":"","language":"Python","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/GiovanniBaccichet.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":"2024-03-02T17:39:59.000Z","updated_at":"2024-11-26T13:55:54.000Z","dependencies_parsed_at":"2024-11-26T18:16:28.755Z","dependency_job_id":null,"html_url":"https://github.com/GiovanniBaccichet/powermonitor","commit_stats":null,"previous_names":["giovannibaccichet/powermonitor"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/GiovanniBaccichet/powermonitor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GiovanniBaccichet%2Fpowermonitor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GiovanniBaccichet%2Fpowermonitor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GiovanniBaccichet%2Fpowermonitor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GiovanniBaccichet%2Fpowermonitor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GiovanniBaccichet","download_url":"https://codeload.github.com/GiovanniBaccichet/powermonitor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GiovanniBaccichet%2Fpowermonitor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32628211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: 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":["bh1750","home-assistant","iot","kwh","mqtt","power-meter","smart-home","smart-meter"],"created_at":"2024-12-02T23:09:39.892Z","updated_at":"2026-05-04T22:43:25.210Z","avatar_url":"https://github.com/GiovanniBaccichet.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- Improved compatibility of back to top link: See: https://github.com/GiovanniBaccichet/powermonitor/pull/73 --\u003e\n\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n\u003c!--\n*** Thanks for checking out the powermonitor. If you have a suggestion\n*** that would make this better, please fork the repo and create a pull request\n*** or simply open an issue with the tag \"enhancement\".\n*** Don't forget to give the project a star!\n*** Thanks again! Now go create something AMAZING! :D\n--\u003e\n\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/GiovanniBaccichet/powermonitor\"\u003e\n    \u003cimg src=\"images/logo.png\" alt=\"Logo\" width=\"150\"\u003e\n  \u003c/a\u003e\n\n  \u003ch3 align=\"center\"\u003eSmart Power Monitor\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    A cheap and easy solution to make your electricity meter smarter\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://baccichet.org\"\u003eAuthor\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/GiovanniBaccichet/powermonitor/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/GiovanniBaccichet/powermonitor/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\n\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n## About The Project\n\nThere are many great README templates available on GitHub; however, I didn't find one that really suited my needs so I created this enhanced one. I want to create a README template so amazing that it'll be the last one you ever need -- I think this is it.\n\n[Electricity Meter Interface 2](https://frient.com/products/electricity-meter-interface-2-led/) electronic meters with LED indicating power consumption\n\n\n[Integrating your electricity grid](https://www.home-assistant.io/docs/energy/electricity-grid/#reading-the-meter-via-a-pulse-counter) reading the meter via pulse counter\n\n\u003cbr\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"images/assembled_sensor.png\" align=\"center\" height=\"400px\"\u003e\n\u003c/div\u003e\n\n\u003cbr\u003e\n\n\n\nHere's why:\n* Your time should be focused on creating something amazing. A project that solves a problem and helps others\n* You shouldn't be doing the same tasks over and over like creating a README from scratch\n* You should implement DRY principles to the rest of your life :smile:\n\nOf course, no one template will serve all projects since your needs may be different. So I'll be adding more in the near future. You may also suggest changes by forking this repo and creating a pull request or opening an issue. Thanks to all the people have contributed to expanding this template!\n\n\u003cbr\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"images/power_meter.png\" align=\"center\" height=\"400px\"\u003e\n\u003c/div\u003e\n\n\u003cbr\u003e\n\nUse the `BLANK_README.md` to get started.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\u003c!-- GETTING STARTED --\u003e\n## Getting Started\n\nThis is an example of how you may give instructions on setting up your project locally.\nTo get a local copy up and running follow these simple example steps.\n\n### Prerequisites\n\nThis is an example of how to list things you need to use the software and how to install them.\n* npm\n  ```sh\n  npm install npm@latest -g\n  ```\n\n\u003cbr\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"images/BH1750.png\" align=\"center\" height=\"150px\"\u003e\n\u003c/div\u003e\n\n\u003cbr\u003e\n\n### Assembly\n\nLooking at the BH1750 pinout, and reading its data sheet, we need 4 connections.\n\n\u003cbr\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"images/BH1750-pinout.png\" align=\"center\" height=\"200px\"\u003e\n\u003c/div\u003e\n\n\u003cbr\u003e\n\nOn the Raspberry Pi side, the GPIO header is well documented on their website. In particular we are interested in the I2C interface\n\n| **GPIO** | **BH1750** |\n| -------- | ---------- |\n| 1        | `VCC`      |\n| 3        | `SDA`      |\n| 5        | `SCL`      |\n| 9        | `GND`      |\n\n\n\nPlease **make your own considerations and read data sheets for the hardware you are using**. I am not responsible for any damages misconfigurations can cause to your hardware.\n\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- HOME ASSISTANT --\u003e\n## Home Assistant\n\nIn order to pass the data to Home Assistant, we are using an [MQTT Sensor](https://www.home-assistant.io/integrations/sensor.mqtt/), which is well documented on the project website. My configuration in `configuration.yaml` is the following.\n\n```yaml\nmqtt:\n  sensor:\n    - name: \"Power Meter\"\n      device_class: \"energy\"\n      state_class: \"total_increasing\"\n      state_topic: \"homeassistant/sensor/powermonitor/state\"\n      unit_of_measurement: \"Wh\"\n      unique_id: \"powermonitor\"\n```\n\nPlease notice that `state_topic` must match with the MQTT topic we defined \n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\u003c!-- CONTRIBUTING --\u003e\n## Contributing\n\nContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\nIf you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag \"enhancement\".\nDon't forget to give the project a star! Thanks again!\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- LICENSE --\u003e\n## License\n\nDistributed under the `GPLv3` License. See `LICENSE` for more information.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- CONTACT --\u003e\n## Contact\n\nGiovanni Baccichet - [@Giovanni_Bacci](https://twitter.com/Giovanni_Bacci) - `github [at] surname [dot] org`\n\nProject Link: [https://github.com/GiovanniBaccichet/powermonitor](https://github.com/GiovanniBaccichet/powermonitor)\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- ACKNOWLEDGMENTS --\u003e\n## Acknowledgments\n\nSome useful resources and documentation I used for the project.\n\n* [Power Monitoring with a Raspberry Pi Pico](https://blog.lidskialf.net/2023/12/30/power-monitoring-with-a-raspberry-pi-pico/)\n* [BH1750 – Ambient Light Sensor](https://components101.com/sensors/bh1750-ambient-light-sensor)\n* [BH1750 Data Sheet](https://www.mouser.com/datasheet/2/348/bh1750fvi-e-186247.pdf)\n* [GPIO and the 40-pin Header](https://www.raspberrypi.com/documentation/computers/raspberry-pi.html)\n* [Gehäuse für ESP32- und ESP8266-Boards, Raspberry Pi zero, Raspberry Pi pico, ESP32-CAM, diverse Sensoren und Displays](https://www.thingiverse.com/thing:4738646)\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiovannibaccichet%2Fpowermonitor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiovannibaccichet%2Fpowermonitor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiovannibaccichet%2Fpowermonitor/lists"}