Home Assistant’s Energy dashboard shows gas consumption in the unit used by its sources when they all agree. For households billed in therms, the gas chart and totals can use the same unit as the bill instead of always showing kilowatt-hours.

Colin Haven extends the rule to other energy units, including gigajoules and megawatt-hours, for both the current and comparison periods. Mixed-unit sources still use kilowatt-hours, as does a gas statistic also configured as an individual device; electricity is unchanged.

This is Haven’s first contribution to the frontend, reviewed by Petar Petrov. He checked the display with demo data and automated tests.