Doorsensor icon_off not working

I have several door sensors,
but for one of them icon_off is not working, it just shows the normal icon.
It could be that this is because i overwrite the icon before I knew how to set device classes of some other reason. This is the only sensor I uses with esphome. my other sensors are zigbee.
closed, color closed,
icon is open
My other sensors show a different icon when closed

Is there a way to fix this?

There are several methods to control the state of an icon, depending on how the sensor is configured.
The simplest way is to not specify the icon for the sensor, but define the device_class as door.
If you don’t know how to do this, then show your yaml code for the sensor and we might be able to give some advice.

I still had

icon: mdi:door

configured in ESPhome yaml, appearently that can’t be overruled by device class, only by static mdi.
thanks for pointing me to the yaml