Tariff Adjustment
Setting up your Smart Gateaways – Smart Meter Gateway to accurately reflect your energy consumption and generation according to local tariffs is crucial for effective energy management. In Lithuania, the default MQTT topics within Home Assistant for DSMR-reader may not align with the tariffs provided by ESO (Energijos Skirstymo Operatorius). This guide will help you adjust the MQTT topics to ensure accurate reporting.
To connect your Smart Meter you need one of these Smart Meter Gateways:

Understanding the Tariffs and OBIS Mappings
Before diving into the configurations, it’s essential to understand how energy consumption and generation are mapped using OBIS codes. Here’s a quick overview of the Lithuanian tariffs and their corresponding OBIS mappings:
One Time Zone Tariff Plan
- Energy consumption from the grid: electricity_delivered_1
- Energy generation to the grid: electricity_returned_1
Two Time Zones Tariff Plan
- Energy consumption from the grid:
- Daytime (6:00 – 22:00): electricity_delivered_1
- Nighttime and weekends: electricity_delivered_2
- Energy generation to the grid:
- Daytime (6:00 – 22:00): electricity_returned_1
- Nighttime and weekends: electricity_returned_2
Four Time Zones Tariff Plan
- Energy consumption from the grid:
- Morning: electricity_delivered_3
- Daytime: electricity_delivered_2
- Evening: electricity_delivered_1
- Nighttime and weekends: electricity_delivered_4
- Energy generation to the grid:
- Morning: electricity_returned_3
- Daytime: electricity_returned_2
- Evening: electricity_returned_1
- Nighttime and weekends: electricity_returned_4
Differentiated Tariff Plan for Business Users
- Energy consumption from the grid:
- 8:00 to 11:00 and 18:00 to 20:00 on weekdays: electricity_delivered_1
- Other hours: electricity_delivered_2
- Weekends and special days: electricity_delivered_3
- 23:00 to 7:00 every day: electricity_delivered_4
- Energy generation to the grid:
- 8:00 to 11:00 and 18:00 to 20:00 on weekdays: electricity_returned_1
- Other hours: electricity_returned_2
- Weekends and special days: electricity_returned_3
- 23:00 to 7:00 every day: electricity_returned_4
Manual Adjustments for MQTT Topics in Home Assistant
Before proceeding with the steps outlined below, it’s important to note that you should first follow the instructions provided on https://haprofs.com/smart-meter-advanced-energy-dashboard-for-home-assistant/. These instructions will guide you through setting up the advanced energy dashboard for Home Assistant, which serves as the foundation for integrating and visualizing your energy data.
Once you have completed the setup of the advanced energy dashboard as per the instructions provided on https://haprofs.com/smart-meter-advanced-energy-dashboard-for-home-assistant/, you can then proceed with adding the new sensors and configuring them to accurately reflect your energy consumption and generation according to the Lithuanian tariffs.
Following these steps in the correct order will ensure a smooth integration of your new sensors into the Home Assistant Energy Dashboard, providing you with comprehensive insights into your energy usage and generation based on the specific tariffs in Lithuania.
To align the MQTT topics with the correct tariffs, you will need to manually adjust the configuration in Home Assistant. Below are the steps to do this.
Step-by-Step Configuration
- Open your Home Assistant configuration file:
Open thesmartgateways_smartmeter.yamlfile in the packages directory of Home Assistant where you define your MQTT sensors. - Define your MQTT sensors:
Here is an example configuration for the electricity delivered and returned sensors.
Configuration for Electricity Delivered (Consumption)
mqtt:
sensor:
- name: "smart_meter_electricity_delivered_1"
unique_id: electricity_delivered_1
state_topic: "power/dsmr/reading/electricity_delivered_1"
unit_of_measurement: "kWh"
icon: mdi:lightning-bolt
force_update: true
state_class: total_increasing
device_class: energy
- name: "smart_meter_electricity_delivered_2"
unique_id: electricity_delivered_2
state_topic: "power/dsmr/reading/electricity_delivered_2"
unit_of_measurement: "kWh"
icon: mdi:lightning-bolt
force_update: true
state_class: total_increasing
device_class: energy
- name: "smart_meter_electricity_delivered_3"
unique_id: electricity_delivered_3
state_topic: "power/dsmr/reading/electricity_delivered_3"
unit_of_measurement: "kWh"
icon: mdi:lightning-bolt
force_update: true
state_class: total_increasing
device_class: energy
- name: "smart_meter_electricity_delivered_4"
unique_id: electricity_delivered_4
state_topic: "power/dsmr/reading/electricity_delivered_4"
unit_of_measurement: "kWh"
icon: mdi:lightning-bolt
force_update: true
state_class: total_increasing
device_class: energyConfiguration for Electricity Returned (Generation)
mqtt:
sensor:
- name: "smart_meter_electricity_returned_1"
unique_id: electricity_returned_1
state_topic: "power/dsmr/reading/electricity_returned_1"
unit_of_measurement: "kWh"
icon: mdi:lightning-bolt
force_update: true
state_class: total_increasing
device_class: energy
- name: "smart_meter_electricity_returned_2"
unique_id: electricity_returned_2
state_topic: "power/dsmr/reading/electricity_returned_2"
unit_of_measurement: "kWh"
icon: mdi:lightning-bolt
force_update: true
state_class: total_increasing
device_class: energy
- name: "smart_meter_electricity_returned_3"
unique_id: electricity_returned_3
state_topic: "power/dsmr/reading/electricity_returned_3"
unit_of_measurement: "kWh"
icon: mdi:lightning-bolt
force_update: true
state_class: total_increasing
device_class: energy
- name: "smart_meter_electricity_returned_4"
unique_id: electricity_returned_4
state_topic: "power/dsmr/reading/electricity_returned_4"
unit_of_measurement: "kWh"
icon: mdi:lightning-bolt
force_update: true
state_class: total_increasing
device_class: energy- Save and restart Home Assistant:
After making these changes, save theconfiguration.yamlfile and restart Home Assistant to apply the new settings. - Add the newly created sensors to the Home Assistant Energy dashboard::
Go to Settings -> Dashboards -> Energy and add the smart_meter_electricity_returned_1 to 4 to Grid consumption. Add the smart_meter_electricity_returned_1 to 4 to Grid consumption
Conclusion
By following these steps, you can ensure that your smart meter accurately reflects your energy consumption and generation according to the correct Lithuanian tariffs. This will help prevent confusion and provide precise readings, enabling better energy management and cost tracking.
Setting up your Home Assistant with these manual MQTT topic adjustments might seem a bit technical, but it’s a one-time effort that pays off in accurate and reliable energy monitoring. Happy energy managing!