Hello,
I am using a statistics graph to report on my heat pump COP. The sensor I am reporting on is a template sensor:
# Sensor for calculating the hourly COP
# Using utility meters for production & consumption values
- unique_id: "panasonic_heat_pump_cop_hourly"
name: "Aquarea COP hourly"
unit_of_measurement: "x"
state_class: "total"
availability: "{{ states('sensor.aquarea_energy_produced_hourly') | float(default=0) > 0 }}"
state: >
{% set produced = states('sensor.aquarea_energy_produced_hourly') | float(default=0) %}
{% set consumedHeatPump = states('sensor.aquarea_energy_consumed_hourly') | float(default=0) %}
{% set consumedBuh = states('sensor.aquarea_energy_consumed_buh_hourly') | float(default=0) %}
{% set consumed = consumedHeatPump + consumedBuh %}
{% set value = 0 if produced == 0 else produced / consumed %}
{{ '%0.1f' % value }}
When there is no produced energy in this hour (sensor.aquarea_energy_produced_hourly) the sensor is not available.
However, the statistics graph is still showing empty bars when the sensor was unavailable for that hour(s). Is there any way to hide these empty bars?