Energy Meter, how to use unsupported ones? (f.i. data read by mqtt)

Hi
I’m new here, but I did use the search first.
Most problems I encountered I could solve, but this one seems to be uncovered or impossible.

I have a victron energy meter connected to a cerbo GX and I can read it’s values with MQTT. Power use can be displayed in HA in realtime.

Similarily I pull the production power from an older solar inverter with command-line sensor from a CSV file which is on the inverter and updated in realtime.

Now, those do not show up as supported statistics in the energy-management setup dialog.

Is there a way I can make them usable?
Thank you.

Ok, part of it I discovered myself, but part of it may be a feature request.

Here is the solution:
Whatever sensor that is being used for energy, in its config it has to have:

state_class: total_increasing

If you have a KNX or MQTT sensor this is no problem.

However… and that is the feature request… if you have a command line sensor this doesn’t work, because “state_class” is not supported there.

That is a pitty.