I am tracking the PC Desktop energy consumption by check of APC UPS current load by multiply to the nominal real power. After then get a sum of the total consumption and feed it to utility meter. But I am turning off the PC at night and can’t check APC UPS load at that moment. To bypass unavailable sensor I’m using template sensor and pass zero.
Sensors configuration like this:
sensor:
- platform: template
sensors:
energy_bu_w:
value_template: >
{% if states('sensor.apc_load_2') != "unavailable" %}
{{states('sensor.apc_nominal_real_power_2')| int * (states('sensor.apc_load_2')| float * 0.01) | round(4)}}
{% else %}
0
{% endif %}
unit_of_measurement: 'W'
- platform: integration
source: sensor.energy_bu_w
name: energy_bu
unit_prefix: k
round: 3
utility_meter:
energy_bu_meter_d:
source: sensor.energy_bu
cycle: daily
tariffs:
- main
The issue is on the graph below. Why Riemann sum integration don’t start from 0 (as other sensors which are working at night at 00:00)? How could I force reset unavailable sensor at 00:00?