Hi guys,
I have a small device which is doing air extraction from my basement. It’s not a connected device but it’s controlled by a Sonoff BASICZBR3 which unfortunately does not have energy measurement.
Since it has a power that is more or less stable, I create a fake sensor that returns the power for it based on the switch value from the Sonoff device. And then, and integration to get the energy in kWh.
- platform: template
sensors:
vmc_sous_sol_power:
unit_of_measurement: W
device_class: power
value_template: >-
{{ 28 if states('switch.vmc_sous_sol') == 'on' else 0 }}
- platform: integration
name: VMC sous-sol kWh
source: sensor.vmc_sous_sol_power
unit_prefix: k
unit_time: h
method: left
round: 6
I already did that for a heater that is not connected or reporting energy measurement and it has worked well for months.
Well, problem is: the energy entity does not get updated and I’m wondering if it’s not related to the integration calculation itself… the device only draws 28W, so it’s like 0.028 kWh and if the maths are done every seconds (actually I don’t know how often it is updated/calculated), then it’s 0,000007777777778 kWh that should be added every seconds, which is less than the default round value (3) in the integration sensor (I tried to put this value to 6 already, without success)
So if anyone has a clue on this… ?