I have asked ESPHome developers to add the device class ‘apparent_power’ so that unit of measurement VA is correctly recognized in HA. https://github.com/esphome/issues/issues/3405
Fix has been done and therefore I have modified my yaml file for the ESPHome component and changed the device class from power to apparent_power. In the log file the correct device class is sent to HA
Yes this will probably work but the device has 35 entities and all of them are customized so I will need to reenter all the information. Not fun
What strange is why it worked for 3 of them?
I tested on another instance of HA reading data from the same ESPHome devices and in this instance everything got updated correctly!
I will probably do what you says. It is maybe because some data are stuck in the DB ???
Thanks for advice.
I fixed the problem as follow (this may help others?):
In ESPHome I removed the problematic sensor recompiled. After that the removed sensor was declared as not available in HA but I could not remove it. So I restarted HA and this time I was able to remove it.
Then I put back the sensor in ESPHome recompiled … and voilà the device was now displayed with the correct device_class