claudegel / sinope-130

Neviweb130 custom component for Home Assistant to manage devices connected via a GT130 and wifi devices from Sinopé
GNU General Public License v3.0
73 stars 15 forks source link

Error during setup of component neviweb130 #194

Closed mattnhanson closed 10 months ago

mattnhanson commented 10 months ago

Fairly recently I've noticed that my neviweb130 integration in HA stopped working, and looking deeper I'm find the following in the error log. Has Sinope's API (or something else on their end) changed again?

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 288, in _async_setup_component
    result = await task
             ^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/neviweb130/__init__.py", line 138, in setup
    data = Neviweb130Data(hass_config[DOMAIN])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/neviweb130/__init__.py", line 170, in __init__
    self.neviweb130_client = Neviweb130Client(username, password, network, network2)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/neviweb130/__init__.py", line 201, in __init__
    self.__get_gateway_data()
  File "/config/custom_components/neviweb130/__init__.py", line 320, in __get_gateway_data
    data = self.get_device_attributes(device["id"], [ATTR_SIGNATURE])
                                      ~~~~~~^^^^^^
TypeError: string indices must be integers, not 'str'
claudegel commented 10 months ago

No there is nothing wrong with the Sinopé API Look like something wrong with your config in configuration.yaml Do you have two location on Neviweb ? please post your config

also check in the log for line: [custom_components.neviweb130] Successfully logged in to:... [custom_components.neviweb130] Number of networks found on Neviweb: 1 or 2 [custom_components.neviweb130] networks:..... [custom_components.neviweb130] Selecting «your network name» among: [custom_components.neviweb130] Received gateway data:.....

Post what you have

mattnhanson commented 10 months ago

As just as you said it was @claudegel it was an issue logging in. Would have bet a lot of money that I hadn't changed anything, but yet I did. Completely forgot that the location name was used in the configuration and it was more than just a mere label in the phone app!

Thank you muchly for your help!