I have built a light sensor that reads the led pulse on my energy meter and publishes a message to my MQTT broker that looks like this: ‘0.002’ which corresponds to the amount of energy in kWh that has been consumed since last pulse. HA connects to the topic and I can see in the MQTT logs that HA gets the message and formats it.
My problem: I can’t seem to get HA to display the data correctly. I have setup both a utility meter and a Riemann Sum Helper, but none seem to get it right, they miss maybe 90% of the events.
I have tried everything I can think of, am I missing something?
Heres the config:
mqtt:
sensor:
unique_id: sensor_1
name: "energy_pulse"
state_topic: "energy_sensor"
device_class: energy
state_class: total_increasing
unit_of_measurement: "kWh"
value_template: "{{ value | float | round (3) }}"
utility_meter:
energy:
unique_id: meter_1
source: sensor.energy_pulse
cycle: quarter-hourly
name: Energy consumption quarter-hourly
delta_values: True