Weird issue with history graph temperature

I haven’t changed my configuration or anything, but something weird just happened with my history graph tracking temperature indoor and outdoor. For about 2 weeks now, the graph was working just fine with everything together on the same graph, but tonight I just noticed that my indoor temperature sensor randomly shifted to Celsius (despite the degrees being obviously still Fahrenheit). The device attributes still show unit_of_measurement as Fahrenheit as well. Not really sure how exactly this happened or if it’s a bug that was introduced over the last few days. Take a look and please share any thoughts you might have.
image

Have you updated home assistant?

Yes, I update Home Assistant usually within a day or two of new updates being released (basically when I stumble on the notification in the supervisor tab) which is why i mentioned that it could be a bug introduced recently.

Could very well be a bug, this user is seeing the same thing:

See if you two can work out if you are using the same sensor type.

Then post an issue here (same sensor or not):

I had the same issue a little over 2 weeks ago. It went away on its own. I never got an answer to my question here:

If it went away on it’s own, then the incorrect units got pushed down to the database. Then when that piece of information left the database, the units got restored.

FYI same exact issue as this thread. The only difference is the unit_of_measurement change was likely sparked by a bug.

@jarvistek, my sensor is an ESP32 with a DHT22 temp and humidity sensor. It’s running Esphome with the following config:

esphome:
  name: greenhousesensor
  platform: ESP32
  board: node32s

wifi:
  ssid: "xxxxxx"
  password: "xxxxxxx"
  fast_connect: true

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: "xxxxxx"

ota:
  password: "xxxxxx"

sensor:
  - platform: dht
    pin: GPIO5
    temperature:
      name: "Greenhouse Temperature"
    humidity:
      name: "Greenhouse Humidity"
    update_interval: 30s
    model: DHT22

Nothing special in the config for the Lovelace card.

type: history-graph
entities:
  - entity: sensor.greenhouse_temperature
  - entity: sensor.greenhouse_humidity
hours_to_show: 48
refresh_interval: 30

There’s nothing particularly advanced with mine, the “off” sensor is just a SmartThings motion sensor that also includes temperature (because SmartThings sensors are neat like that). I don’t have any real device/sensor configuration for it as I added it through the Zigbee Home Automation integration and everything “just worked”. It’s been working fine for at least a year now.

type: history-graph
entities:
  - entity: sensor.home_realfeel_temperature
  - entity: sensor.livingroom_motion_temp
  - entity: sensor.nws_temperature
  - entity: sensor.accuweather_temperature
hours_to_show: 168
refresh_interval: 0
title: 7 Day Temperature

I’ll write up an issue and try and summarize all the details from this thread and the linked ones. I’ll post a link back here once it’s done if anybody want to review it.

I’ve submitted issue https://github.com/home-assistant/core/issues/43145. Please take a look to see if I’m misrepresenting anything.