Celsius/Fahrenheit confusion

I have two xiaomi temperature sensors. My system is configured to use imperial units. When I use an entities card to display the two temperatures, both are shown correctly in degrees F. However, when I use a history graph card, one of the temperatures is shown on a separate graph, supposedly in degrees Celsius - but the values are in Fahrenheit. Any ideas?

Thanks!

1 Like

Unless it was you, I’ve seen the same question not so long ago.
I assume this is a bug in the graph card, and as such you should open an issue (unless one already exists)

1 Like

It’ll correct itself in time. Just be patient.

2 Likes

I believe what @petro means is that it will correct itself when the “wrong” data rolls out of the recorder database. FMI:

2 Likes

Oh. Of course. Somehow a couple of data points were marked as “C”, for reasons I do not quite understand.

DELETE FROM "states" WHERE "entity_id" LIKE '%temperature%' AND "attributes" LIKE '%\u00b0C%'

…and all is fine. Thanks everyone!

Your device most likely outputs in ÂşC and home assistant converts it to ÂşF. However it takes a second for HA to detect that and a ÂşC will get into the database. Then you just need to wait for that value to get out of the history range.

1 Like

It shouldn’t work that way then… But yeah “fixed” ad hoc by going into the database and deleting everything in the states table under the entity that has the unit of measurement in the attributes column as C.

It’s a chicken egg scenario. If you have a state before recorder is running, the state is already set or vice versa. Typically it doesn’t happen, however if you have a slow machine, it’s more likely to happen. Not to mention, HA is starting to move towards a system that has this defined before it happens. Baby steps. If you want it to change now, take the time to put in a PR and change it now.

Hello,

Could you tell how did you manage to display temp in both units? I want to display them in both F and C, one per line.

I used unit_of_measurement in dashboard:

  - entity: sensor.master_bedroom_temp_sensor_temperature
    unit_of_measurement: °F
  - entity: sensor.master_bedroom_temp_sensor_temperature
    unit_of_measurement: °C

But both lines are still showing as F:
image

Change the unit of measurement of the Celsius one to anything but degree c