Checking the energy dashboard I found that this sensor is not available there.
So I checked the entity and I found that state_class is total but If I’m not mistaken it should be total_increasing to be showed in the energy dashboard.
The main problem could be that “total_increasing” and “total” could behave differently:
total:
The state represents a total amount that can both increase and decrease, e.g. a net energy meter. Statistics of the accumulated growth or decline of the sensor’s value since it was first added is updated every 5 minutes. This state class should not be used for sensors where the absolute value is interesting instead of the accumulated growth or decline, for example remaining battery capacity or CPU load; in such cases state class measurement should be used instead.
total_increasing:
Similar to total, with the restriction that the state represents a monotonically increasing positive total which periodically restarts counting from 0, e.g. a daily amount of consumed gas, weekly water consumption or lifetime energy consumption. Statistics of the accumulated growth of the sensor’s value since it was first added is updated every 5 minutes. A decreasing value is interpreted as the start of a new meter cycle or the replacement of the meter.
So, it depends how the sensor / integration does behave - if the Sensor does increase - but can also decrease, the state_class “total” is the correct one.
so, do you want to include the UPS into the Energy Dashboard as Battery device?
If yes, it would probably require a “load” and “unload” sensor… this could maybe done with the "Battery Consumption integration available on HACS… ?
The sensor can only increase its value.
To start I wanted only get from the UPS load provided by NUT the consumption in W and them integrate this value to have something in Wh to be added in the energy dashboard as normal device that eats energy.
Now I will dig into the use of the battery device to better understand if I can do the same smarter.
hm… according to the development area, the customization did work.
The sensor has state_class: total_increasing, has the correct device_class and unit_of_measurement.
if it can only increase, then total_increasing should be valid… (it should probably be changed within the integration then) - and it should appear in the energy dashboar configuration.
2022-11-02 14:35:10.602 WARNING (Recorder) [homeassistant.components.sensor.recorder] The unit of sensor.consumo_ups (kWh) can not be converted to the unit of previously compiled statistics (kWmin). Generation of long term statistics will be suppressed unless the unit changes back to kWmin or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this
Fixed this I can see the entity in the energy dashboard