History Graph splits Temperature Sensors

Hello, i have a weird problem with the History Graph Card.

Some Sensors are Split into a second Graph. But why ?
I can see, the Units of that two sensors are “C” and the others have “°C” This is why the Sensors are splitted. But in my Config file all Sensors are set to “°C”

The Card on the upper left side is showing all sensors with “°C”

The config for all sensors looks like this :

sensor:
  - platform: mqtt
    state_topic: "ESP_Easy_78/Kühlschrank/temperature"
    name: "Kühlschrank_Keller"
    unit_of_measurement: "°C"
  - platform: mqtt
    state_topic: "Sonoff_S20_79/Kühlschrank/temperature"
    name: "Kühlschrank_Eltern"
    unit_of_measurement: "°C"
  - platform: mqtt
    state_topic: "Sonoff_S20_79/Keller/temperature"
    name: "Keller"
    unit_of_measurement: "°C"
  - platform: mqtt
    state_topic: "Fermenter/Fermenter/temperature"
    name: "Fermenter_Temp"
    unit_of_measurement: "°C"

Do i need to change some settings elswhere ?

Greetings,

Christian

Might be an encoding issue: I notice the split is with/without non-ASCII characters like ü. Try renaming (and the topic) with ue instead, see if that works…

First try copy-pasting a working ° symbol in place of the non-working ones, though.

The “Ü” was not the problem, but you pointed me into the correct direction :slight_smile:

Problem was. Both “C” sensors where formerly configured with “C” instead of “°C”.
If the history graph “sees” this “C” at the beginning of its history, it just uses this “C” and never looks for the later setup “°C”. I just renamed that sensors (Not the MQTT Topics, just the name for HA) Now the graph is working fine.

I think this will resolve automaticly, if the history including only “C” value is purged.

1 Like

I seem to remember running across a similar problem due to pasting an odd value in for the unit of measurement. I think there are a couple of unicode characters that materialize as ‘degree’ symbols. It took some time and a couple of glasses of :wine_glass:to track it down.

It was a lesson is being very careful where you copy and paste unicode values from. Unicode is very complicated under the covers, and scarily can be a vector for bad actor code.

1 Like

Oh yes i remember my formerly misconfigured Putty and doing stuff in a mysql database. Was a horrible scenario at the frontend then :slight_smile: Now iam using UTF-8 in Putty an never ran into problems with special chars (for now). But i dont want to cry for it :slight_smile:

This one bites a lot of people. Sometimes all you need to do is wait for the “old” units to age out of the database and it’ll go back to showing one graph. Or just delete the database, if there’s nothing critical in there.

I guess someone could submit a request to update the logic to use the last unit read from the database for a given value, rather than the first. Not sure how much interest there would be.