p1meter.dev is a Phoenix LiveView application that provides a virtual smart meter P1 port. It simulates DSMR 5.0 telegrams and streams them over raw TCP, so you can build and test energy monitoring software without a physical Dutch or Belgian smart meter nearby.
The web interface shows a live smart meter preview, while the TCP endpoint emits the same telegram data that a P1 reader would receive.
Install dependencies, build the assets and start server:
mix setup
mix phx.serverVisit the local web UI:
http://localhost:4000
Connect to the local TCP stream:
nc localhost 8080Run the test suite:
mix testRun the full project check before committing:
mix precommitThis project uses Phoenix 1.8, LiveView, Tailwind CSS, Bandit, and the dsmr
library for DSMR telegram data structures and formatting.
LiveMeter.SmartMetergenerates simulated DSMR telegrams.LiveMeter.TCPServerlistens for TCP clients and broadcasts telegrams.LiveMeter.TCPClientstreams telegram lines with a baud-style delay.LiveMeterWeb.HomeLiverenders the live smart meter preview.
The application can be deployed Docker container.
- HTTP traffic is served by Phoenix on port
4000. - The TCP stream is exposed on port
8080. - Production requires
SECRET_KEY_BASE. - The canonical host defaults to
p1meter.dev. - Metrics are exposed at
/metricson port9568.
Everyone is encouraged to help improve this project. Here are a few ways you can help:
- Report bugs
- Fix bugs and submit pull requests
- Write, clarify, or fix documentation
- Suggest or add new features
Copyright (C) Robin van der Vleuten
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.