Decrypt your Smarty energy meter data to use it with Home Assistant

If you live in Luxembourg, you’ve probably been equiped with a smart electricity and gas meter in your home. The “Smarty” is a device that measures your energy consumption and production in real time and sends it to your network operator. But did you know that you can also access your own data and use it for your home automation projects?

In this blog post, I will show you how I did it with my latest project: smarty_dsmr_proxy. This is a Python script that allows you to decrypt the data from your Smarty meter and send it to Home Assistant or similar software. Home Assistant is an open source platform that lets you control and automate your smart devices.

Why decrypt your Smarty data?

Smarty uses a standard protocol called DSMR (Dutch Smart Meter Requirements) to communicate with other devices. This protocol is widely used in Europe and there are many applications that can read and process DSMR data. However, Smarty encrypts the data with a key that you need to request from your network operator. This means that you cannot use the standard DSMR applications without decrypting the data first.

By decrypting the data, you can access information such as:

  • Your current electricity consumption (and production if applicable)
  • Your current gas consumption

You can use this information to monitor your energy usage, optimize your consumption, detect anomalies, or trigger actions based on certain conditions.

How to decrypt your Smarty data?

To decrypt your Smarty data, you need two things:

  • A Raspberry Pi
  • A USB cable to connect to the smart meter
  • The encryption key of your Smarty meter. You can request it from your network operator by filling out a form on their website.

Once you have these three things, you can use my script smarty_dsmr_proxy to decrypt the data and send it to Home Assistant or similar software. See the GitHub repository for more infos.

The script works as follows:

  • It reads the encrypted data from the P1 port of the Smarty meter
  • It decrypts the data using the encryption key
  • It converts the data to plain DSMR format
  • It sends the data over a TCP socket

How to use your Smarty data with Home Assistant?

Home Assistant is an open source platform that lets you control and automate your smart devices. You can install it on various devices such as a Raspberry Pi, a NAS, or a PC.

To use your Smarty data with Home Assistant, you need to install the DSMR integration: This integration can read DSMR data from a serial port or a TCP socket.

Once you have installed and configured the integration, you should see a number of sensors in Home Assistant that correspond to your Smarty data. You can use these sensors to create dashboards, automations, notifications, or anything else you can imagine.