Current state of Home Assistant & Iotawatt

I’ve had my Iotawatt running happily for several years now, and about a year ago installed Home Assistant. I connected the two using the integration in core (IoTaWatt - Home Assistant), but I see there is an issue on Github that mentions an alternative (GitHub - kuralabs/iotawatt_ha: We had to fork Home Assistant IoTaWatt integration, people is crazy). That alternative appears to be a manual install as the repo is missing the hacs.json, etc to make it installable from HACS. I also see this fork, which appears to have a hacs.json (GitHub - llamafilm/iotawatt-hacs: A fork of Home Assistant's built-in Iotawatt integration for use with HACS)

Is there any difference in the end result between using one over the other? I can’t seem to find any clear recent answer, particularly since changes to remove the _accumulated sensors (these were not used by the energy dashboard, right?), and changing to a fork of iotawattpy, which in itself appears to be a few years old.

The reason for the question is that despite configuring the MainsConsumption and MainsExport outputs as instructed at IoTaWatt - Home Assistant , I seem to be missing some data, or misunderstand how it is meant to work. Also note that I don’t have any integrators configured, which I believe aren’t required for the core integration?

In the following screenshot, you can see the MainsExport output is correct (absolute value sum of the three phases):


I have also confirmed this stays at zero when drawing from the grid.

However, in HA I don’t have any export showing for the day:

I presume this is due to the MainsExport.wh sensor staying at zero, despite the instantaneous value appearing to be correct (in the following graph, the instantaneous drops to zero when the AC is on as it draws more than what is being produced by solar):

I’d expect MainsExport.wh to be an integral of MainsExport. Is this a wrong assumption? What is meant to be doing the integration? Energy function of HA, the core integration, or on the Iotawatt itself? Any suggestions on how to go about fixing this?

Interestingly, the MainsConsumption.wh does appear to increase, although it also seems to decrease when exporting. I’d expect it to remain flat when there is no consumption from the grid - perhaps this is a clue?

The Home Assistant integration is user contributed, so they would be the best source of information.

HA Energy can only integrate the data that it gets, at the resolution of the data it receives. With the IoTaWatt integration, I believe that is 30 seconds. Moreover, it has no way to deal with lost data caused by network or HA problems.

IoTaWatt will integrate your import/export data with 5 second granularity and the resulting kWh totals can be exported to HA Energy. So when there is a network or HA outage, while the detail data will be missing, the totals should be correct. Typically the outage appears as a large change at the time the network or HA servive is restored.

I would recommend that you follow the advice in the IoTaWatt docs to setup an integrator for your energy import/export, regardless of the HA integration that you decide to use.

1 Like