This is a Rust application that reads data from a Dutch Smart Meter using a serial connection to the P1 port. Currently only the DSMRS5.0 protocol is supported.
Requirements:
- P1 to USB-cable
- Something to plug the cable in and run this program
- InfluxDB on the same machine as this program
- Optional: Grafana to visualize the InfluxDB data
- Install InfluxDB and optionally Grafana.
- Checkout this repo.
- Make sure
libudev-dev
andlibssl-dev
are installed:
sudo apt-get install libudev-dev && sudo apt-get install libssl-dev
- Check the serial path (by default
/dev/ttyUSB0
) and change according to your setup. - Check the InfluxDB database name (by default
p1meter
). - Test if it works by running
cargo run
(if you don't have the Rust toolchain installed click here) - Finally, run
cargo build
to create the binary executable. Use this executable as you wish, for example add it as systemd service so that it automatically starts and restarts.
Create /etc/systemd/system/smart-meter.service
:
[Unit]
Description=InfluxDB-DSMR Adapter Process
[Service]
ExecStart=/home/<user>/path/to/dsmr-influxdb-adapter-rs/target/debug/dsmr-influxdb-adapter
Restart=always
[Install]
WantedBy=multi-user.target
And run sudo systemctl enable smart-meter.service
.
Use a data visualization tool that uses InfluxDB as data source to create some nice graphs and/or dashboards. For example:
Disclaimer: I probably forgot to document something...