The integration is setup in the UI through Configuration → Integrations → Click on the Add Integration button and search for iotawatt
Enter a name for the device and the IP Address. See issue below about text not appearing
Entities will then be created for each Input and Output that was created on the device.
Current Limitations/Issues:
I didn’t take a screenshot but I did notice in my production HA server when the dialog appears there was no text to indicate which line is for the name and which is for the IP Address. The first line is for the name and the second line is for the IP Address. Closing the dialog and forcing a hard refresh from the browser (Shift-Reload) seemed to fix this
Integration does not support Authentication
Have only tested with one IoTaWatt device loaded in Home Assistant
I know people have been using the REST interface and templates but I wanted a simple way to add the IoTaWatt and hopefully be dynamic to update Home Assistant when Inputs/Outputs are added/removed/changed on the IoTaWatt device.
I made a clumsy fork of the code into a new repo that can be installed with HACS
Looks like its working pretty well so far but the device registry might not be working properly since the entities aren’t editable and don’t display as children of the integration.
@panctronic I’m glad it works for you! It was quickly built as really a proof of concept. Now I need to start implementing beyond the bare minimum It shouldn’t be too bad but I’m still learning beyond my basic coding skills.
So to add it through HACS all someone has to do is add the Git repo to HACS?
With the structure in my repository (copying the iotawatt directory you created into a custom_components subdirectory) the bare minimum requirements are met. I was able to install this repository into two of my hassio installations by adding the github url as a custom repository https://hacs.xyz/docs/faq/custom_repositories
I have added support for Authentication and Unique ID.
I really want to hide the Username/Password fields as I don’t think too many people enable Authentication for the IoTaWatt. But for now the fields are shown and are optional and can be blank
Thanks.I pulled down the latest files and uploaded, now I get this error, checking into it…
Logger: homeassistant.config_entries
Source: custom_components/iotawatt/__init__.py:31
First occurred: 11:15:57 (1 occurrences)
Last logged: 11:15:57
Error setting up entry Name of the device for iotawatt
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 236, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/config/custom_components/iotawatt/__init__.py", line 31, in async_setup_entry
entry.data["username"],
KeyError: 'username'
See below what I can capture in the log. From my side I would not know what to modify, I am not such an advanced user…
I am running HA 0.118.4 on a Raspberry Pi 4, hassos 5.5, with SSD install.
Regards
Guido
Logger: homeassistant.config_entries
Source: custom_components/iotawatt/__init__.py:52
First occurred: 10 January 2021, 21:46:04 (3 occurrences)
Last logged: 14:31:46
Error setting up entry IotaWatt for iotawatt
Error setting up entry iotawatt for iotawatt
Error setting up entry iota for iotawatt
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 236, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/config/custom_components/iotawatt/__init__.py", line 52, in async_setup_entry
entry.data["username"],
KeyError: 'username'
Hello Greg,
I am also attempting to install the files, but not getting the expected results. I have 2 IoTaWatt base units monitoring 22 CTs.
Followed the instructions you listed in the first comment (i.e. - create iotawatt directory, copy files, restart, …) but the integration does not appear. I do not see anything listed in the logs. Also, using the HA Terminal, I have tried to run a “pip install iotawatttpy.” I see some files were created under the “/usr/lib/python3.8/site-packages” directory, but no integration appears. Restarted multiple times. Running the latest Hass.io version.
Was wondering if I missed a step? Thank you.
-Cannondale
Hello,
I was wondering if the iotawatt integration is still being developed. I finally got the files to load in HA and configured the name and IP in settings and it was successful but no entities were created. Thank you!!
@gregtd - set this up yesterday and it works great! Any interest in getting it added to HA as a core integration? I’d be willing to help get it submitted to core if necessary
Today I restarted Home Assistant without having done any updates (I updated the Grafana plugin and Google Home integration but not HA) and the integration failed with an error. I restarted multiple times and each time it failed with:
2021-04-03 19:18:38 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry iotawatt for iotawatt
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 248, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/config/custom_components/iotawatt/__init__.py", line 35, in async_setup_entry
await iotawatt.update()
File "/usr/local/lib/python3.8/site-packages/iotawattpy/iotawatt.py", line 45, in update
await self._createSensors()
File "/usr/local/lib/python3.8/site-packages/iotawattpy/iotawatt.py", line 56, in _createSensors
results = response.text
AttributeError: 'NoneType' object has no attribute 'text'