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.
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?
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.
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...
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.
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.
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.