I just built up a prototype meat thermometer using MAX31856 and ESP8266, I copied the code as it exists on the ESPHome MAX31856 page. To my surprise when I added the integration to Home Assistant the icon used was the standard thermometer type:
It’s pretty straightfoward usually, just set the icon value to mdi:grill or something and it should show up in Home Assistant but I tried:
mdi:hamburger
‘mdi:hamburger’
mdi:grill
mdi:food-steak
“mdi:grill”
“mdi:food-steak”
and every time it comes up with the thermometer. Even after removing the integration and re-adding it. I even tried renaming the sensor so it would be a completely fresh entity to Home Assistant!
There will be a copy of the nodes config in the .storage folder. It wont have the same name, open the files to find the matching config. Delete the node in the integration, then delete the file, then restart. You should also backup the text of your sketch in the esphome interface.
You could also just change it on the lovelace card when it’s displayed on a dashboard.
Thanks @Mikefila, I did what you said. I found the file in .storage and then removed the integration, deleted the file, restarted HA. I had the device powered off while doing all of that. Then I plugged the device into power and when it was connected to my WiFi, I added the integration back.
Strangely, all the device’s icons work except for the max31856 one! They are all set from the ESPHome YAML file.
I know I can override the icon with a few entries in the customize section but I’ve used this ESPHome icon: field many, many times and it has always worked. This is the first time I’m really struggling with it and I think it might be a bug.
Not a bug - a feature! The MAX31856 ESPHome component uses a device class for the temperature sensor. This will always override an icon specified in ESPHome. Your only option is to use customize in Home Assistant (or maybe edit the entity on the Configuration / Entities page).
And from the docs it looks like you can disable it by setting device_class: "" in the ESPHome definition.
That makes me wonder what the benefits are of having the device class defined on an ESPHome sensor for HA to pick up. Aside from it making all the icons the same… I guess any HA unit conversions would all apply. Is there anything else?