home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.15k stars 30.19k forks source link

esphome : Please update your configuration if device_class is manually configured, otherwise create a bug report #65467

Closed bbrendon closed 2 years ago

bbrendon commented 2 years ago

The problem

Home assistant is telling me to do this. I have an esphome device connected to my system. It doesn't appear to be configured with yaml, but with the gui.

home-assistant.log:2022-02-02 15:23:24 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.sensornode_airquality_temp (<class 'homeassistant.components.esphome.sensor.EsphomeSensor'>) with device_class None reports a temperature in °C which will be converted to °F. Temperature conversion for entities without correct device_class is deprecated and will be removed from Home Assistant Core 2022.3. Please update your configuration if device_class is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+esphome%22

Device info
PLATFORMIO_NODEMCUV2
by espressif
Connected via <Unknown device>
Firmware: 1.15.0b3 (Sep 20 2020, 18:42:55)

What version of Home Assistant Core has the issue?

2022.2.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

esphome?

Link to integration documentation on our website

https://www.home-assistant.io/integrations/esphome/

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

probot-home-assistant[bot] commented 2 years ago

esphome documentation esphome source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

Hey there @ottowinter, @jesserockz, mind taking a look at this issue as it has been labeled with an integration (esphome) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

jesserockz commented 2 years ago

@bbrendon Can you paste in your ESPHome yaml for that sensor?

bbrendon commented 2 years ago

@jesserockz I think this is it. Not 1000% sure. But if not, its very close. https://pastebin.com/SjrfpWU0

The computer I made it with is somewhere. I could probably find it again if I had to.

bbrendon commented 2 years ago

@jesserockz this is still happening. Luckily my esphome stuff is still working.

emontnemery commented 2 years ago

@bbrendon The problem is that your sensor lacks a "device_class" configuration. This explains how to configure, with temperature sensor in the example: https://esphome.io/components/sensor/index.html#base-sensor-configuration

bbrendon commented 2 years ago

@emontnemery That explains it. I suppose I need to figure out how to reflash someday. I wonder why they didn't make it backward compatible? Oh well, thanks.

jesserockz commented 2 years ago

I just came across this again now while cleaning up my GH notfications. Ah, your device is running a very old version of ESPHome. The hdc1080 now sets device_class: temperature for the temp sensor and humidity for the humidity sensor. It was "backward compatible" with a deprecation period of 3 months ending at HA 2022.3. There is nothing an old ESPHome firmware can do about that without being updated at some point.