IoTaWatt Discussion

I take it these are outputs you have configured in the iotawatt. I’ll have to try and find the website I got the REST sensor code from because I think he had the code for the outputs as well. There’s a heap of info on the iotawatt forum about interfacing to HA as well, it might be in there.

Yeah they are, the outputs are showing,

0	
name	"Export"
units	"Watts"
value	1396.004
1	
name	"Import"
units	"Watts"
value	0

But only the power, not energy.

I get this issue all the time and it drives me bananas:

This error originated from a custom integration.

Logger: custom_components.iotawatt.coordinator
Source: helpers/update_coordinator.py:313
Integration: IoTaWatt (documentation)
First occurred: 8:44:47 AM (13 occurrences)
Last logged: 8:49:26 AM

Unexpected error fetching iotawatt.local data: 'NoneType' object has no attribute 'status_code'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 313, 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.12/site-packages/iotawattpy/iotawatt.py", line 48, in connect
    if results.status_code == httpx.codes.OK:
       ^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'status_code'

Is there any way to make this integration more reliable?

Which fork of the integration are you using?

I use this one: GitHub - kuralabs/iotawatt_ha: We had to fork Home Assistant IoTaWatt integration, people is crazy and have no issues.

If it is that one, what is your wifi RSSI like?

Normally the integration does come back to life, it just goes off line regularly. This time it’s dead so I check the Iotawatt and it looks like my IoTaWatt SD card is borked

That’s a different level of hassle to resolve. Now on the Iotawatt forum to validate process for sorting that out.

Oh boy. I was reading about the process for that the other day on the iotawatt forum. It immediately made me backup my config.txt file.

I’m not fussed about losing the databases as all the data I want is exported to influxdb, so all I should need to do if SD card corruption occurs is to replace the imaged card and upload the config file to restore the inputs and outputs.

1 Like

Yeah, I don’t have my config file.

I happened to have a new SD card in a drawer (Class 10 16GB) so followed the instructions and miracle of miracles I have it all back functioning.

I cannot read the old SD card at all, so the config file was lost.

But I am back online.

In HA:

Not all of those are Iotawatt but a lot of them are.

I’m pretty sure I am using the same one as I had a lot of the same issues as others did once I tried to move past HA Core 2023.3 (so I stayed on 2023.3 until recently when I got it to work again)

But how can I tell what I am using?

When I click on Documentation link in the settings tile, it just brings me straight back to the same page in HA, it does not take me to a Github page.

Yeah mine does that too. Look in /config/custom_components/iotawatt/README.rst

Mine says:

=======================================
IoTaWatt integration for Home Assistant
=======================================

A working version of the IoTaWatt integration for Home Assistant.

This fixes issue #87182 and enables all inputs and outputs.

We had to fork this from the Home Assistant Core because the official
integration is broken and Home Assistant maintainers are more interested in
discussing semantics than fixing a broken integration.
etc...

Yes, that’s what I have. Thanks for the tip.

Since reinstalling with new SD card the integration seems more stable. Not seen it go offline like it used to do a lot. But not enough time has passed to call it good just yet.

I had a buddy help with installing a dedicated router near the IoTaWatt just so it would have good Wi-Fi signal as I was having a lot of issues earlier last year. Connection has been pretty solid since, it was just the HA side that wasn’t so great.

Maybe the SD card was a cause, don’t know. Will monitor and see how it goes.

The third party integration is probably causing issues with the energy dashboard after Home Assistant restarts.

I’m going to swap back to the core integration tomorrow and see if that helps.

See how you go but I use the custom component and it works perfectly for me?

Which custom integration?

If it is this one: https://github.com/kuralabs/iotawatt_ha

Do you use IoTaWatt integrator outputs?

Do they reset exactly at midnight?

Do you use the HA energy dashboard?

Have you tried restarting Home Assistant recently and does it mess up the data?

Actually sorry no. I didn’t know there were multiple. I use GitHub - gtdiehl/iotawatt_ha: IoTaWatt for Home Assistant

Yikes!

4 years since the last commit and quite a few open issues. Comments in the latest issue recommend moving to the HA core integration or this fork: GitHub - darek-margas/iotawatt_ha: IoTaWatt for Home Assistant

Yeah one of those PRs is mine. Once that is done though I have had no problems at all but I am not using any integrators.

Just throwing my 2c i here as a long time Iotawatt user.

I had rest sensors which worked great. I never used the custom integration.
I tried the “official” one but didnt like it.

Whats worked best for me is to leverage EmonCMS. I already had EmonCMS running and integrated with iotawatt to give me long term power/energy statistics.

Iotawatt sends to EmonCMS, and then HA queries EmonCMS.

I also found when using any of the HA integrations with iotawatt that my iotawatt would crash periodically. Removing direct integration has stopped this from happening.

Its an extra thing that needs to run, but other than that its proved more reliable in my use case.

Thanks for the info.

While the 3rd party integration hasn’t introduced any stability issues for me its quirks, issues and lack of development are pissing me off. Apparently it is just a copy of the core integration with unique ids for the outputs. So the core integration will only be worse.

Do you use a cloud or local EmonCMS server?

I see there is an addon.

Any chance you can share your emonCMS setup? I set mine up well before I got into HA and it’s never sent to the Energy dashboard properly.

I assume it’s to do with how I have the Feeds etc.