Graph split in history but unified in panel?

I have some temperature sensors (and filters/averages of them) that seem to display separately in history graph but one chart in lovelace panels.

Any ideas why?

Lovelace panel:

History:

And I don’t see any difference in how some of those template-sensors are that are displayed separate on the history graph:

sensor:

  - platform: template
    sensors:

      upstairs_heat_pump_temp_delta:
        friendly_name: "Upstairs Heat Pump Temp Delta"
        unit_of_measurement: '°F'
        device_class: temperature
        icon_template: 'mdi:thermometer-lines'
        value_template: >-
          {% if states('sensor.upstairs_hvac_status') == 'idle' or states('sensor.upstairs_thermostat_temperature_filtered') | int(0) == 0 or states('sensor.upstairs_heat_pump_temperature_filtered') | int(0) == 0 %}
            0
          {% else %}
            {{ states('sensor.upstairs_heat_pump_temperature_filtered') | int(0) - states('sensor.upstairs_thermostat_temperature_filtered') | int(0) }}
          {% endif %}

Vs

sensor:

  - platform: template
    sensors:

      # offset for general average
      upstairs_temp_offset_realtime:
        friendly_name: "Upstairs Temp Offset"
        #entity_id: sensor.time
        unit_of_measurement: '°F'
        value_template: >-
          {% if ( states('sensor.upstairs_thermostat_air_temperature') | float(0) ) == 0 or ( states('sensor.upstairs_rooms_average_temperature') | float(0) ) == 0 %}
            0
          {% else %}
            {{ ( states('sensor.upstairs_thermostat_air_temperature') | float(0) - states('sensor.upstairs_rooms_average_temperature') | float(0) ) | round(2,default=0) }}
          {% endif %}


Graphs are sometimes grouped by device_class, your top sensor has one but the bottom one does not.

Hmmm, looks like that is easy to fix on my templates but I’m not seeing an easy way to fix it on the averages (min_max integration)

Looks like its requested but not yet possible Add device_class: to integration min/max sensor - #6 by mmiller7

You can change device class with customize: if you need to.

1 Like

Oh cool - and if I recall I can use that in package-YAML files so I can just toss it in as needed still keeping it maintainable.

I’ll have to give it a go!

Got it!

Little grep/sed/vim magic and it was a breeze…

[core-ssh hvac]$ grep name: downstairs_room_temperatures.yaml  | sed 's/name: /sensor./g' | sed 's/$/:/g'
    sensor.main_floor_average_temperature:
    sensor.main_floor_min_temperature:
    sensor.main_floor_max_temperature:
    sensor.basement_rooms_average_temperature:
    sensor.basement_rooms_min_temperature:
    sensor.basement_rooms_max_temperature:
    sensor.downstairs_hvac_zone_average_temperature:
    sensor.downstairs_hvac_zone_weighted_average_temperature:
    sensor.downstairs_hvac_zone_weighted_average_basement_temperature:
    sensor.downstairs_hvac_zone_min_temperature:
    sensor.downstairs_hvac_zone_max_temperature:
[core-ssh hvac]$ vim downstairs_room_temperatures.yaml 
[core-ssh hvac]$ grep name: upstairs_room_temperatures.yaml  | sed 's/name: /sensor./g' | sed 's/$/:/g'
    sensor.bedroom_average_temperature:
    sensor.bedroom_min_temperature:
    sensor.bedroom_max_temperature:
    sensor.upstairs_rooms_average_temperature:
    sensor.upstairs_rooms_weighted_average_temperature:
    sensor.upstairs_rooms_min_temperature:
    sensor.upstairs_rooms_max_temperature:
[core-ssh hvac]$ vim -d downstairs_room_temperatures.yaml upstairs_room_temperatures.yaml 

and tada…

homeassistant:
  customize:
    sensor.main_floor_average_temperature:
      device_class: temperature
    sensor.main_floor_min_temperature:
      device_class: temperature
    sensor.main_floor_max_temperature:
      device_class: temperature
    sensor.basement_rooms_average_temperature:
      device_class: temperature
    sensor.basement_rooms_min_temperature:
      device_class: temperature
    sensor.basement_rooms_max_temperature:
      device_class: temperature
    sensor.downstairs_hvac_zone_average_temperature:
      device_class: temperature
    sensor.downstairs_hvac_zone_weighted_average_temperature:
      device_class: temperature
    sensor.downstairs_hvac_zone_weighted_average_basement_temperature:
      device_class: temperature
    sensor.downstairs_hvac_zone_min_temperature:
      device_class: temperature
    sensor.downstairs_hvac_zone_max_temperature:
      device_class: temperature