Huawei LTE error

Hello,

I’ve set the huawei LTE component and trying 0.95, 0.96 and 0.97Beta with the following configuration :


huawei_lte:
  - url: http://192.168.8.1/
    username: admin
    password: mypassword

but I still get the error :

2019-08-07 11:00:40 ERROR (MainThread) [homeassistant.setup] Error during setup of component huawei_lte
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/setup.py", line 172, in _async_setup_component
    component.setup, hass, processed_config  # type: ignore
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/huawei_lte/__init__.py", line 141, in setup
    _setup_lte(hass, conf)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/huawei_lte/__init__.py", line 154, in _setup_lte
    data = RouterData(client)
  File "<attrs generated init a913a5a0dec25a5d2cc6640921767ebbb9a30491>", line 8, in __init__
    self.__attrs_post_init__()
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/huawei_lte/__init__.py", line 68, in __attrs_post_init__
    self._update()
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/huawei_lte/__init__.py", line 117, in _update
    get_data("wlan_host_list", self.client.wlan.host_list)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/huawei_lte/__init__.py", line 105, in get_data
    setattr(self, path, func())
  File "/srv/homeassistant/lib/python3.7/site-packages/huawei_lte_api/AuthorizedConnection.py", line 19, in wrapped
    return fn(*args, **kw)
  File "/srv/homeassistant/lib/python3.7/site-packages/huawei_lte_api/api/WLan.py", line 78, in host_list
    host = hosts.get('Hosts', {}).get('Host')
AttributeError: 'NoneType' object has no attribute 'get'

Is somebody has an idea how to solve that ?

I use the 4G LTE router behind a TP-Link multiwan router to aggregate a DSL line and a 4G line.
If I change my password I get an error “bad login or password”, so HA can connect to the 4G LTE router.

try placing quotes around your url

it seems that I’m not the only one with that bug : https://github.com/home-assistant/home-assistant/issues/22303

I get it, but did you try quotes around that field?

huawei_lte:
  - url: 'http://192.168.8.1/'
    username: admin
    password: mypassword

Colon’s inside yaml cause problems. Asserting it as a string may fix your issues.

Hell, removing http:// and / may also fix the issues.

huawei_lte:
  - url: '192.168.8.1'
    username: admin
    password: mypassword

the first one gives the same error message (eq. #1)

the second one says that an URL must start with “http://”

I also tried :
url : ‘http://192.168.8.1
and it says that the url must end with a ‘/’

Documentation suggests not to put quotes.

I understand that but if you read my responses, you would have seen that my reasoning is because yaml doesn’t like colons in odd spots outside strings. Yaml has a tendency to see the colon and link it to a dictionary key instead of treating the whole string as a value.

Ah ok, seems like that component has a lot of odd restrictions in regards to host names. Looks like you’ll have to wait until there is a fix unfortunately. I was just trying to see if there were work-arounds for the bug to make the component work for the time being.

The solution found in the github is to edit manifest.json (/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/huawei_lte/manifest.json) and put 1.1.4 instead of 1.2.0.

I’ve still the notification and the traffic_statistics KO but I’ve the 4G status and the WAN IP used.

Ouch, that means the bug is in the resource not the component. Has anyone written an issue against huawei_lte_api? Without that, nothing will be done as the bug is not in Home Assistant.