#Statistics graph: hide empty bars when sensor is unavailable

1 messages · Page 1 of 1 (latest)

rigid atlas
#

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?

knotty timber
#

What does it mean to hide something that is not visible? 😕

rigid atlas
knotty timber
#

I guess I'm confused what you're asking for

#

You want to compress the time axis or something?

rigid atlas
#

I am not interested in seeing so much white space during the time the sensor was not available

knotty timber
#

ok. No there's no support for anything like that in the stock cards. The time axis is always linear

#

maybe you can make a custom dataset to apexchart card

rigid atlas
#

Ok, check, good to know!

rigid atlas