Hey everyone! I wanted to share my experience with getting the utility meter readings to work correctly in HomeAssistant. I recently set up a MQTT sensor for my power company’s meter reading, but I was facing an issue where the readings weren’t showing up on the utility meter sensor. It was quite confusing because the sensor itself was incrementing properly, but the utility meter wasn’t reflecting the data.
After some research and trial and error, I realized that the issue might be with how the sensor data was being processed. I decided to revisit my YAML configuration and tweak the value template to ensure it was correctly parsing the JSON data from the MQTT topic. Here’s the adjusted configuration that worked for me:
yaml
sensor:
- platform: mqtt
name: “Power Company Meter”
unique_id: “power_company_meter_consumption”
state_topic: “homeassistant/sensor/rtlamr/scm/(id censored)”
unit_of_measurement: ‘kWh’
value_template: “{{ value_json.Message.Consumption | float / 100.0 }}”
utility_meter:
monthly_electric_meter:
source: sensor.power_company_meter_consumption
cycle: monthly
offset:
days: 0
weekly_electric_meter:
source: sensor.power_company_meter_consumption
cycle: weekly
daily_electric_meter:
source: sensor.power_company_meter_consumption
cycle: daily
By ensuring the value_template correctly processes the JSON data and divides it by 100.0, the readings started showing up as expected. It was a bit of a puzzle, but breaking it down step by step helped me identify where the issue was. I’m now able to monitor my energy consumption accurately, which is a huge help for tracking usage patterns and optimizing energy use.
If anyone else is facing similar issues, I’d recommend checking the data format coming from your sensor and ensuring the value_template is correctly configured to handle it. Also, verifying the MQTT topic and payload structure can make a big difference. Happy troubleshooting! ![]()