With 2023.1.x kicking off a bunch of errors, it has been highlighted that SensorDeviceClass.ENERGY does not support the unit of ‘MJ’ (megajoules), could support for this unit please be added?
In Australia (and I would assume a number of other countries), we are billed on MJ of energy consumed, when it comes to tracking gas consumption.
At the moment whilst having to ‘work around’ the energy dashboard and do conversions to m3 for the consumption, we still need to track MJ for the cost/billing side of the dashboard (as that’s how we are billed).
I note that support for Gigajoules (GJ) has recently been added, given that there are 1,000 MJ in 1 GJ, and a typical house is only using ~2,000mj per quarter. The addition of MJ would seem logical, as the scale of using GJ is not appropriate to allow visibility of usage… i.e. 0.002gj use in a quarter (~0.000002gj per day)
If you could please add this for Australian users, it would be appreciated.
The Energy Dashboard has a bug in it, when you add a sensor for the gas that is tracking in MJ, the dashboard is not recognising that it is MJ. Instead it is showing the sensor value (that doesn’t appear right, and is not current with the value of that sensor when checked in ‘entities’) but with a suffix / unit type of kWh.
Is this still an issue, I’m having a lot of trouble trying to get the MJ gas reading and metering correct. I have standalone daily charge and a consumption sensor based on ESPHome reading the rotation of dial and converting that to MJ.
@SgtBatten I just got a chance to setup a new HA and add a gas meter in, assigning the MJ gas readings for the Gas input.
It appears that the change to add MJ as an option, whilst working at the entity level as a unit of measurement, has NOT worked at the Energy Dashboard level. With the entity feeding in MJ of gas, the dashboard is showing kWh as the gas energy unit.
Also tried with device_class: energy and `device_class: gas’, the doco says its the former but there’s some issues logged and comments saying this is actually supposed to be the later. i.e.
Seems like this dashboard issue has been raised (in regards GJ) but no one is assigned, nothing happening to fix it. See: