{"id":28754808,"url":"https://github.com/notcoffee418/european_smart_meter","last_synced_at":"2025-07-11T08:41:22.211Z","repository":{"id":296401910,"uuid":"993168212","full_name":"NotCoffee418/european_smart_meter","owner":"NotCoffee418","description":"Consumable API for the Belgian and Netherlands smart meter P1 port for Raspberry Pi","archived":false,"fork":false,"pushed_at":"2025-06-05T09:24:55.000Z","size":74,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-17T01:44:23.993Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/NotCoffee418.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,"zenodo":null}},"created_at":"2025-05-30T10:29:57.000Z","updated_at":"2025-06-05T09:24:57.000Z","dependencies_parsed_at":"2025-05-30T18:43:54.301Z","dependency_job_id":"c5f56943-2c39-4023-9ab1-c4742d5f3c92","html_url":"https://github.com/NotCoffee418/european_smart_meter","commit_stats":null,"previous_names":["notcoffee418/belgian_smart_meter_api"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/NotCoffee418/european_smart_meter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotCoffee418%2Feuropean_smart_meter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotCoffee418%2Feuropean_smart_meter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotCoffee418%2Feuropean_smart_meter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotCoffee418%2Feuropean_smart_meter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NotCoffee418","download_url":"https://codeload.github.com/NotCoffee418/european_smart_meter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotCoffee418%2Feuropean_smart_meter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264767689,"owners_count":23661023,"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":[],"created_at":"2025-06-17T01:39:21.339Z","updated_at":"2025-07-11T08:41:22.206Z","avatar_url":"https://github.com/NotCoffee418.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Smart Meter API\n\nModular services to interact with the European smart meter designed to run on a Raspberry Pi.\n\n- Interpreter API: Read the meter and provides the values as an API.\n- Meter Collector: Get data from Interpreter API and store it in the database.\n\nThis was designed for Belgian meters but should work for other countries as well.\n\n## Requirements\n\n- Raspberry Pi 3+ (or other Linux machine)\n- [P1 Smart Meter Cable](https://webshop.cedel.nl/nl/Slimme-meter-kabel-P1-naar-USB)\n- [Activated P1 port on your smart meter](https://www.stroohm.be/en/help/using-and-accessing-the-p1-port-of-the-digital-meter-in-belgium/)\n\n## Installation\n\n1. [Set up Raspberry Pi](https://www.raspberrypi.com/documentation/computers/getting-started.html)\n2. Connect the cable to the P1 port on the meter and a USB port on the Raspberry Pi\n3. SSH into the Raspberry Pi or open a terminal on the Raspberry Pi\n4. Disable Pi Desktop (optional, but recommended on older Pi's)  \n    When running additional smart meter related software on the Pi, it may cause memory issues if we don't.\n\n    ```bash\n    sudo raspi-config\n    # System Options → Boot / Auto Login → Console\n    # Exit and reboot\n    ```\n\n5. Install Interpreter API\n\n    ```bash\n    # Install or update the Interpreter API\n    sudo curl -sSL https://raw.githubusercontent.com/NotCoffee418/european_smart_meter/main/installers/install_interpreter.sh | sudo bash /dev/stdin\n    ```\n\n6. Install Meter Collector\n\n    ```bash\n    # Install or update the Meter Collector\n    sudo curl -sSL https://raw.githubusercontent.com/NotCoffee418/european_smart_meter/main/installers/install_meter_collector.sh | sudo bash /dev/stdin\n    ```\n\n7. Set up Auto-Upgrading and install Grafana\n\n    ```bash\n    # Install or update the Auto-Updater\n    sudo curl -sSL https://raw.githubusercontent.com/NotCoffee418/european_smart_meter/refs/heads/main/installers/autoupdater.sh | sudo bash /dev/stdin\n    ```\n\n## Updating\n\nRun the install scripts again to update the services. Configs remain intact.\n\n## Interpreter API\nThe Interpreter API reads the meter and provides the values as an API with a websocket endpoint option.  \nThis service is essential for all other services to work and can be optionally run as a standalone application to work with custom software.\n\n### Endpoints\n\n- **/latest**: Get the latest data from the smart meter\n- **/ws**: Subscribe to the websocket endpoint to get real-time data from the smart meter\n\nBoth output the following JSON response structure:\n\n```json\n{\n  \"timestamp\": \"2025-05-30T15:52:07\", // Local Time\n  \"current_consumption_kw\": 0.150, // Combined Consumption (L1+L2+L3)\n  \"current_production_kw\": 0.0,\n  \"l1_consumption_kw\": 0.150,\n  \"l2_consumption_kw\": 0.0, // L2 and L3 is for 3 phase meters (industrial)\n  \"l3_consumption_kw\": 0.0, // L2 and L3 is for 3 phase meters (industrial)\n  \"l1_production_kw\": 0.0,\n  \"l2_production_kw\": 0.0,\n  \"l3_production_kw\": 0.0,\n  \"total_consumption_day_kwh\": 9999.999,\n  \"total_consumption_night_kwh\": 9999.99,\n  \"total_production_day_kwh\": 9999.99,\n  \"total_production_night_kwh\": 9999.99,\n  \"current_tariff\": 1, // 1=day, 2=night\n  \"l1_voltage_v\": 237.8,\n  \"l2_voltage_v\": 0.0,\n  \"l3_voltage_v\": 0.0,\n  \"l1_current_a\": 2.28,\n  \"l2_current_a\": 0.0,\n  \"l3_current_a\": 0.0,\n  \"switch_electricity\": 1, // 1=on, 0=off - Physical switch on the meter\n  \"switch_gas\": 1, // 1=on, 0=off - Physical switch on the meter\n  \"meter_serial_electricity\": \"XXXXXXXXX\",\n  \"meter_serial_gas\": \"XXXXXXXXX\",\n  \"gas_consumption_m3\": 9999.99 // Updated every 10 minutes\n}\n```\n\n\n## Uninstallation\n\n```bash\n# Interpreter API (everything else depends on this)\ncurl -sSL https://raw.githubusercontent.com/NotCoffee418/european_smart_meter/main/installers/uninstall_interpreter.sh | sudo bash /dev/stdin\n\n# Meter Collector\ncurl -sSL https://raw.githubusercontent.com/NotCoffee418/european_smart_meter/main/installers/uninstall_meter_collector.sh | sudo bash /dev/stdin\n```\n\n## Troubleshooting\n\n### Device not found\n\nIf you have multiple USB ports, you need to check which one is the P1 port and adjust it in the docker-compose.yml file if it's not /dev/ttyUSB0.\n\n```bash\n# List all USB devices\nls /dev/ttyUSB*\n```\n\n### No data received\nIt may be that you have submitted the request to activate the P1 port but it's not activated yet.\nYou can check if you're receiving data by running the following command:\n\n```bash\npython3 -m serial.tools.miniterm /dev/ttyUSB0 115200 --xonxoff\n```\n\n## Unsorted info (todo)\n### Paths\n- /etc/european_smart_meter/interpreter_api.toml\n- /etc/european_smart_meter/meter_collector.toml\n- /var/lib/european_smart_meter/esm-meter.db\n- /usr/bin/european_smart_meter/interpreter_api\n- /usr/bin/european_smart_meter/meter_collector","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotcoffee418%2Feuropean_smart_meter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnotcoffee418%2Feuropean_smart_meter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotcoffee418%2Feuropean_smart_meter/lists"}