Device classes are not correct

Hi everybody,
I have an issue with one of my entities that I sum togehter.
Basically, both entities have the same type of measurement unit… but…

both single entities have W(att) as a measurement unit.

So I don’t know why I get the above warning message…
Why is it showing that message although the unit of measurements are the same?

The only difference is know, one is an entity from a MQTT device and the other it from my solar inverter directly.

Thanks in advance.
BR
Chavelle

I hope somebody has an anwser to that for me.

Show both entities in the developer tools. One has the wrong device class, confusing energy and power. You cannot express energy in W.
W is power and not energy. So that needs to be fixed. Basically the integration providing it must be fixed. If the entity is defined in yaml you can probably fix it there. Otherwise you can either use customize or use a template entity to create a new sensor with the right device class.

oh thanks thats the issue.


Ccan I just change that class? or will it be overwritten the next time those entities write into these?

Thanks!

I can’t see a way to override it from the UI.You can create a template sensor, take the value and set the device class yourself.

The unit of measure for our energy sensor is suspicious because I would expect a watt hour rather than watt unit. I would question if those are the sensors you want to sum because power is the watts used at the time of measurement where as energy is watts over time so it doesn’t make sense to add them together.

Example:
A fridge will turn on and off to maintain a certain the temperature. When it’s off, it uses 1w. When it’s on, it uses 100w. That’s power

If it turns on twice for 5 minutes in 1 hour, the total power used would be 5+5+(1*50 minutes) = 60wh.

So adding say the energy for the last hour and the current power reading doesn’t make sense.

1 Like

well the values are written by OpenDTU (a Open-Source platform, for micro inverter like Hoymiles) to the MQTT server.
I think I have to open an issue with them to really solve the issue.

Thanks for the help in investigating that issue.

1 Like