Use Smart Energy Meter with Home Assistant

The Dutch Government is aiming on providing smart meters to every household before Q4 2020. All the smart meters need to comply to DSMR (Dutch Smart Meter Requirements). DSMR allows us to read data from the smart meter by using a cable. In this guide, I will explain how I got this to work with Home Assistant.


  • Home Assistant ( running on a Raspberry Pi
  • One of the supported smart meters. I’m using the Landis+Gyr ZMF110 with DSMR 4.2 from Liander
  • A cable to connect from USB on your Pi to the smart meter
  • (Optionally) a second Raspberry Pi running on a Linux distro to send the data over the network to your Pi

Connect your Raspberry Pi to the smart meter

Insert the USB cable in the Raspberry Pi and the other side of the cable into your smart meter. A data connection should now be established.

Optional: Use Ser2Net on another Raspberry Pi if your Pi isn’t close to the smart meter

I have two Pi’s and only one of the Pi is close to the smart meter, while the other Pi hosts the image. Luckily there is a great Linux package called Ser2Net. This tool will make the serial connection available over the network. Install and configure it with the following commands:

sudo apt-get update
sudo apt-get install ser2net
sudo nano /etc/ser2net.conf
sudo service ser2net restart

At step 3, make sure you grab the example code from the official Home Assistant component page and save the file.chrome_2018-08-04_07-01-23Please note that I assume that the USB cable is connected to /dev/ttyUSB0. If that’s not the case, change this value to the correct port.

Enable the DSMR component in Home Assistant

Open your Configuration.yaml file or your Sensors.yaml file and specify the following configuration if the Smart Meter is directly connected to USB:

# Example configuration.yaml entry for USB/serial connected Smartmeter
  - platform: dsmr
    port: /dev/ttyUSB1
    dsmr_version: 5

If you are using the Ser2Net on another Pi, use the following configuration:chrome_2018-08-04_07-07-04

Don’t forget to check the DSMR version on your smart meter and the USB port on the Raspberry Pi. Now all the sensors will be available in Home Assistant. You might want to structure this as a group in the configuration.yaml file or like me in a separate groups.yaml file:

  name: Meter readings
    - sensor.power_consumption
    - sensor.power_consumption_low
    - sensor.power_consumption_normal
    - sensor.power_consumption_phase_l1
    - sensor.power_consumption_phase_l2
    - sensor.power_consumption_phase_l3
    - sensor.power_production
    - sensor.power_production_low
    - sensor.power_production_normal
    - sensor.power_production_phase_l1
    - sensor.power_production_phase_l2
    - sensor.power_production_phase_l3
    - sensor.power_tariff
    - sensor.voltage_sags_phase_l1
    - sensor.voltage_sags_phase_l2
    - sensor.voltage_sags_phase_l3
    - sensor.voltage_swells_phase_l1
    - sensor.voltage_swells_phase_l2
    - sensor.voltage_swells_phase_l3
    - sensor.long_power_failure_count
    - sensor.gas_consumption
    - sensor.hourly_gas_consumption

Update 1:

I’ve been playing around with my dashboard in Home Assistant this weekend. I now have the following view in my dashboard:

Home Assistant Power Meter Readings
Screenshot of Meter Readings view in Home Assistant

Update 2:

Something I forgot to mention in the blog post: if you use the ser2net package mentioned in the blog post, make sure you allow access to the port (e.g. 2001) from Home Assistant and deny access to any other device. This can be done by using a firewall like ufw on Linux. Otherwise your smart meter data is visible to anyone on the (local) network.

Big thanks to everyone who made this possible in the Home Assistant Community!


5 thoughts on “Use Smart Energy Meter with Home Assistant

  1. Hi Jean-Paul, thanks for the tutorial! Ordered the p1 cable and i have a Rpi laying around. I will use the ser2net method as my Hassio installation is running on a ubuntu server machine. Did you use a Rpi or Rpi Zero? Would the Zero W have enough power to work?


    1. Hi Vincon, thanks! I’m using an old Raspberry Pi from 2013 to gather the data from the Smart Meter and make it available to Home Assistant. I assume a Zero W will work from a performance perspective, but you might have to work with USB converters. If you are going to try the Zero W, please let me know if it works! Thanks!


      1. Hi, i got it working finally (raspberry Pi 3) but first it didn’t… I have a Pi in the ‘meterkast’ for my Zigbee controller: Conbee II. Because this was occupying the serial on the Pi i first had to take that out, replug the p1 usb and reboot the system. Then i ssh’d in tot the pi and did the command: cat /dev/tttyUSB0. This gave me a correct reading. After that i added the sensor in HA which now gives perfect readings. replugd the Conbee II and everything is working again.

        Thanks for the tutorial.

        Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s