Unifying unit_of_measurement of °C, so they are displayed in a single graph

Hi there,

I have created a template sensor out of an attribute like this in my configuration.yaml:

template:
  - sensor:
      - name: "Soll-VL"
        unique_id: "SollVL"
        unit_of_measurement: '°C'
        state: >
            {{ state_attr('sensor.home_circuit_0_state','heating_circuit_flow_setpoint') }}

When I open the line graph for that together with other sensors that return °C by default, they are opened in separate graphs instead of in the same one. Therefore the °C seems to differ, HA doesn’t believe that it’s the same unit.

How can I fix this?

Thanks!

Look very closely at the ° character for all your temperature sensors. There are a number of different characters that look very similar. It should be this one ° for all of them.

Also all your temperature sensors should have the following attribute:

device_class: temperature

Thanks! Yes, I’ve done that, but that doesn’t make a difference, unfortunately.

To be clear, I want to display my own created sensors with the ones that are returned from the devices themselves. Therefore for the ‘default’ ones, I can’t define ‘unit_of_measurement’ or ‘device_class’ attributes. Or can I? Can I say something like “for all temperatures, use °C” or the like? I don’t want to create manual template sensors for all the default template sensors …

Thanks!

I have even opened the YAML definition of the ‘default’ entity that I want in the same graph, copied over the relevant lines

state_class: measurement
unit_of_measurement: °C
device_class: temperature

to my own template and still they are displayed in two separate graphs :see_no_evil:

Aaahhh, I had accidentally removed the sensor line between template and name :see_no_evil: now it works! Thanks!