Export kWh as output?

Just wondering about exporting kwh. I have IotaWatt up and running exporting volts and watts.

Can I get it to export kwh? I’d like to export that to home assistant and calculate power costs. Is that possible?

Also, I understand that kwh is available within iotaWatt but where?

Wh is the unit of measure available. KWh is simply Wh / 1000. In Graph+, you can plot Wh for any input or output. The results will be scaled to kWh or MWh as appropriate. The query API can report Wh as well. All of the data uploaders use script (calculator) to produce their metrics and Wh is available there as well.

Thanks for that. I’ve set up chart similar to the one you posted. Makes much more sense to me know. Thanks for taking the time to clarify that for me.

In terms of output, I don’t see a way to export Wh, only Watts, or is that something that has be configured as an output with the calculator?

You specify outputs for Emoncms and influx using the calculator. Just select Wh for units.

Apologies for the endless questions here. Do I add an additional input to the emoncms via the data uploads panel? I am trying to select Wh, but I don’t see a ‘save button’.

The Emoncms outputs are handled a little differently from other outputs. When you look at the Emoncms inputs display, all inputs are numbered, and optionally named.


When uploading data, there are protocols that use the number and protocols that use the name. IoTaWatt uses the number for two reasons:

  1. Inputs are not required to have a name

  2. The bulk protocol that IoTaWatt uses to upload uses a positional notation corresponding to each inputs number, which is much more size efficient in data transmission.

So the problem is that you have named the input Wh rather than assign a number, so the app is not accepting it. You should have gotten a validation message for the name and I’ll look into that, but if you change the “Name” to a number, the Save button should appear. If you specify a number that is already in use, this new definition will replace it. If the new number is unique, it will add it to the list of uploads. Look at your existing Emoncms outputs to determine the next number to assign.

From the IoTaWatt Emoncms chapter in the documentation:

One distinctive feature of this list vs the outputs list is that the names must be numeric values between 1 and 99. The name of an entry corresponds to the Emoncms input “key” value. When editing the various fields, if you add a new entry with the same number as an existing entry, or change an entry to the same number as an existing entry, it will replace the existing entry. Each time you save an entry, the list will be reordered.

Got it. Thanks for that.

Quick question, is there a reason that kWh is available via the “Setup → Data Uploaders → Edit” calculator but not via “Setup → Output → Edit” ?

Reason I ask is that the HA integration seems to reference the standard Input and Output streams rather than those defined for say InfluxDb. Thanks.

kWh is a measure of energy used, while units like Watts and VA are units of power. To display the energy used (kWh) requires a timeframe. The status display does not have a timeframe.

An analogy might be your car speedometer and odometer. Your speed requires no timeframe, it simply is how fast you are going right now. The odometer requires a timeframe, and is the miles driven since new, or in the case of a trip-odometer, since you last reset it.

When uploading, there is an interval associated with the data, so the Wh used during that interval can be provided.

As I understand it, there are several integrations for HA. Some use the “status” request, which is a snapshot with no time period. I believe there are others that are using query, where there is a timeframe and Wh can be requested.

Hi Pete did you manage to solve this so its working correctly in HA, Ive the same issue


@Macnet1 , I didnt need to do anything on the IoTaWatt side. Instead, I installed the IoTaWatt integration from HACS. It seems to automatically create Wh sensors for each Input and Output that can then be used in the Energy dashboard.