IoTaWatt Discussion

From this thread, which lead me to this one.

With the caveats above I do recommend it.

1 Like

Hello, sorry for bumping an older thread, but this appears to be the most active/recent thread with a lot of good discussion.

I have a simple US split phase setup, with no solar or other complications.

I got the iotawatt setup and my ct clamps connected, and I setup the output to combine the 2 mains.

I have the official integration installed and it has started pulling the mains_total stats.

My question/confusion, is how to use the remaining CT inputs.

I have (1) CT’s on all of the 220v breakers, and on most of the 110 breakers.

Are the non main CT inputs supposed to go into the HA ā€˜grid’ section or the ā€˜individual’ devices section?

While I assume that the 220’s that power specific individual devices should go to the devices section, I am less certain where the generic 110 circuits should go, as they are not ā€˜individual’ devices (in my head).

I do have some local energy monitoring devices such as hs300 and ikea smart plugs already listed in the indiv devices.

But I don’t necessarily know which specific circuit breaker a particular device may be on. (the house is old, and the breakers/circuits are not consistently labeled/wired).

TLDR;

are CT (non main) circuits considered ā€˜grid sources’ or ā€˜individual devices’ as related to HA energy?

It’s really up to you how you assign CTs in your circuit board, what they measure and how you wish to use them in Home Assistant.

But in general you will have CT(s) assigned to monitor the mains (as you have) and be the only inputs used for the ā€œGrid Sourceā€ in the HA energy dashboard, unless you have a second source of power supply (e.g. an off-grid system).

You may also have CTs for monitoring any solar PV and/or battery inverter(s) for the solar and battery sections (if using Iotawatt for monitoring these then there is some special set up required).

Then CTs for individual circuits as you see fit which would all go into the individual appliance section of the HA energy dashboard if you so choose.

If you do choose to add some of general power or lighting circuits (which will naturally cover many things) to the individual devices section of the energy dashboard, then as you say you may have smart plugs doing some overlap in measurement on those circuits.

To avoid double counting, you can create a Home Assistant template sensor which deducts one from the other, e.g. If CT #10 was used to monitor a general 110V power circuit which happened to be supplying kitchen power outlets and you have a plug in power monitor for a kitchen appliance (e.g. a fridge), then you can create two new template sensors from your existing ones:

General kitchen circuit (net) power = CT10 power - Fridge power
Obviously you will have you own names for stuff, it’s just illustrative.

Then create a new integral sensor to accumulate the energy from this new ā€œnetā€ power sensor.

Then you can add the new net energy sensor and the fridge energy sensor each as their own individual devices into the energy dashboard.

I hope that makes sense.

TIP:
For individual devices/appliances you wish to monitor (e.g. a fridge) then it’s a good idea to create power and energy template sensors dedicated for each, then use the output from your power monitoring smart plug or device to ā€œfeedā€ that sensor.

While this might seem like unnecessary doubling up on sensors measuring the same thing, there is good reason for it. Smart plugs will fail and may get replaced, or you may wish to reassign them to other duty.

So if (or really when) a plug fails, is replaced or is reassigned, then you just change the input to the (e.g. fridge) power template sensor which in turn feeds the fridge energy template sensor.

This way the ā€œfridgeā€ sensor history is not affected, it can carry on with a new smart plug feeding it with data. You do not lose the history for that appliance and don’t need to keep adding new inputs to the energy dashboard (it can quickly get messy).

1 Like

Thank you for the clarifications, detailed response and awesome tips!

Using template sensors to do logical grouping and decoupling from the physical sensors is just ingenious!

Seems I’m now experiencing an old issue, the Iotawatt integration failing. Been fine for weeks since I set it back up at our new home.

This error originated from a custom integration.

Logger: custom_components.iotawatt.coordinator
Source: helpers/update_coordinator.py:380
integration: IoTaWatt (documentation)
First occurred: 5:58:20 AM (28 occurrences)
Last logged: 6:40:00 AM

Unexpected error fetching iotawatt.local data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 380, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/iotawatt/coordinator.py", line 67, in _async_update_data
    is_authenticated = await api.connect()
                       ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/iotawattpy/iotawatt.py", line 48, in connect
    if results.status_code == httpx.codes.OK:
       ^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'status_code'

The Iotawatt itself is online and reporting normally. It’s the integration with HA that’s falling over and I have little clue as to how to fix it.

I suspect it’s not the integration but a networking issue on my end.

My Iotawatt was reporting via a 169.254.x.x IP address, and not appearing with it’s normally assigned IP address, which tells me it’s a probably DHCP issue with my router.

I’m working through that, have assigned it a new static lease outside of the DHCP dynamic assignment range.

It’s back talking with Home Assistant. Will monitor.

1 Like

So I’ve been super slack on adding my devices to the HA Energy Dashboard and started looking at this today.

I have a strange issue where my Energy Integral is calculating in kWh’s instead of Wh’s despite the power figure coming out of the iotawatt in W and me not using a multiplier in the Integral calc.

Any ideas what’s going on here?


sensor:
  - platform: integration      ###   Calculate energy from power
    source: sensor.mains_export   ### grid out
    name: energy_grid_feed
    unique_id: REDACTED
#    unit_prefix: k
    round: 2

image

I don’t know why my energy integral is multiplying by 1000 (ie: becoming kWh) and I can’t change it in the settings for the entity because it just wont change.

This won’t save:

Dave it is way better if you do the power to energy integration in the IoTaWatt.

Setup → Integrators

I thought about that but only looked at ā€œoutputsā€ and saw that energy wasn’t an option… I didn’t even think to look at the other options available in that menu. :man_facepalming: I’ll go and set it up now.

Thanks mate!

1 Like

When you setup yours, did you have the option to simply use your already configured iotawatt outputs as the source for the integrator?

It looks like I need to do the full calculation again before getting iotawatt to integrate power to energy…

You can only use inputs for the integrators.

I have single phase so not as complicated as yours. Except for the mathematical gymnastics to reject my inverter self consumption from the solar output, so ignore that and concentrate on the grid:

Inputs:

Grid input is fed to the integrator:

The integrator creates grid.neg and grid.poswhich I then use as outputs for export and import.

This will generate both power and energy entities.

1 Like

Thanks. It was the fact that under ā€˜outputs’ you can’t use the correct unit for energy that was also throwing me off.

I’ll see how these work out:
Integrator-
image
Outputs-
image