Unable to add my Integral-sensor-derived gas usage to the energy dashboard due to mis-assumed device_class

I have an integral sensor that takes another sensor (gas flow rate to my furnace) and creates a total “Furnace Gas Usage” sensor (as well as a secondary utility monitor based on THAT to make it daily instead of total).

The problem is, I cant seem to add it to the Energy Dashboard, as the Furnace Gas Usage sensor does not have device_class: gas.

Integral Sensors don’t seem to have a why of manually setting their device class; it’s forcibly derived from the source, which in this case—being a measurement of flow—is Volume Flow Rate, not Gas. I can’t change the flow rate sensor to Gas, because then it would not accept m3/h as the units.

I’ve tried setting the device_class of the integral sensor in the config yaml, but that doesnt seem to work (it doesnt show up as an attribute of the sensor, even after reloading).

How can I make this work?

You can use customize to override a device class for a sensor.

See: Home Assistant Core Integration - Home Assistant

Alternatively, you can make a second template sensor with the correct device_class.

There is no device class “gas”

Yes it is called gas.

https://developers.home-assistant.io/docs/core/entity/sensor/