yeah I’ve been using the energy readings as everywhere I read says to use them over power but I’ll set up the power alongside it to compare.
I’ve had some issues with the energy sensor, and for my case, the error of the Integrator is negligable. I encorage you to compare them both and see if it works for you.
Where are you adding that value template ? In with one of your sensors or on its own.
I put the value template in the MQTT entity:
- platform: mqtt #Water_Heater_Energy
name: "Water_Heater_Energy"
device_class: energy
state_topic: "shellies/shelly1pm-E8DB8----/relay/0/energy" #energy counter in Watt-minute
value_template: "{{ (value|float / 60000) | round(3)}}" #Fix for Watt-minutes
qos: 1
unit_of_measurement: "kWh"
In this topic, tom_l gives some nice info on the matter:
Configuring Shelly EM Energy Meter
I’ve been reading about the riemann integrator as well but couldn’t fully understand it lol.
Riemann integrator takes values from a sensor and gives you an approximation of the integral of that data.
For instance, for each value from the sensor, the trapezoidal method takes averages with the previous value, multiplies the result by the delay between and adds the result to itself.
The other methods simply takes the first (left) or last (right) value of the two instead of the average.
The following code takes a power sensor in Watt (site_power) and returns a energy sensor in kWh:
- platform: integration #riemann_net_energy
source: sensor.site_power
name: riemann_net_energy
method: trapezoidal
unit_prefix: k
round: 3
With my standing charge I’ve just added the amounts to each sensor with the monthly average for my charges and that amount gets added on when the sensor rolls over.
So it only updates monthly?
With the £ symbol I’ve now removed the unit of measurement line and just put a £ symbol at the start.
It’s a workaround, but if you want to do some work with grafana, you’d benefit from the unit of measurement. I have no issue using ‘€’
Do you ever have any issues with the Shelly Em ? I’ve had the web UI fail to load a few times and mqtt stops reporting, but oddly the device is still online and the integration sensors keep updating.
Never had any issue with shelly. Since I’m using it without the cloud, the shelly app takes some time to retrieve values, but in home assistant it’s quite robust.