ds1707
April 6, 2020, 7:47am
1
Hello guys,
I have a Solaredge inverter with a modbus meter.
Everything works like a charm with getting values every 5s over the Modbus tcp from the inverter.
Now i have calculated my own consumption:
self_consumption:
friendly_name: "Self consumption"
value_template: "{{ (state_attr('sensor.solaredge_modbus', 'ac_power_output') | round(2)) - (state_attr('sensor.solaredge_modbus_meter_1', 'ac_power_output') | round(2)) }}"
unit_of_measurement: 'W'
self_consumption_kwh:
friendly_name: "Self consumption"
value_template: "{{ ((states('sensor.self_consumption')| float) / 1000 ) }}"
unit_of_measurement: 'kWh'
Now i created two utility meters:
consumption_daily:
source: sensor.self_consumption_kwh
cycle: daily
consumption_monthly:
source: sensor.self_consumption_kwh
cycle: monthly
My problem is that those values were accumulated every 5 seconds.
Can anyone help me with this issue?
Thank you!
tom_l
April 6, 2020, 9:12am
2
Your problem is that you are using a power sensor (W or kW) instead of an energy sensor (kWh).
Simply changing the unit of a power sensor does not change it to an energy sensor.
You need to integrate the power sensor to get energy:
Some advice on which method to use here:
How do you have the integral sensor set up? If you don’t have that set up properly, you’ll get bad results.
EDIT: In case you respond and I don’t see it.
If you are always consuming power (above 0) and it has rolling consumption like a sine wave use the default value (method: trapezoidal).
If your power drops to zero for extremely long periods of time and spike very high (like a square wave), use method: left.
I’ve never found a good use case for method: right.
2 Likes
ds1707
April 6, 2020, 11:08am
3
Thank you for this awesome hint, seems to work
1 Like
niraviry
(Nir Aviry)
November 3, 2021, 7:02pm
4
The integration shown here does not apply to power meters like a Modbus power meter that already integrates the power. I have two of them. I do not see a way to add these to the energy dashboard. The device class is energy from the very 1st day and I have tried to added “state_class: total_increasing” to the sensor but I do not see a new entity available in the energy dashboard. I might be missing something here.