home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
74.21k stars 31.16k forks source link

unable setup huawei_lte #22303

Closed kuradi closed 4 years ago

kuradi commented 5 years ago

Home Assistant release with the issue:

0.90.1

Last working Home Assistant release (if known):

Operating environment (Hass.io/Docker/Windows/etc.):

hassio Component/platform:

https://www.home-assistant.io/components/huawei_lte/

Description of problem:

2019-03-22 21:58:40 ERROR (MainThread) [homeassistant.setup] Error during setup of component huawei_lte
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/setup.py", line 154, in _async_setup_component
    component.setup, hass, processed_config)  # type: ignore
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/huawei_lte/__init__.py", line 122, in setup
    _setup_lte(hass, conf)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/huawei_lte/__init__.py", line 142, in _setup_lte
    data = RouterData(client)
  File "<attrs generated init b1407ab531e0a88414e75b58be1b0189b46eb6cf>", line 8, in __init__
    self.__attrs_post_init__()
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/huawei_lte/__init__.py", line 53, in __attrs_post_init__
    self._update()
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/huawei_lte/__init__.py", line 97, in _update
    self.wlan_host_list = self.client.wlan.host_list()
  File "/usr/local/lib/python3.7/site-packages/huawei_lte_api/AuthorizedConnection.py", line 19, in wrapped
    return fn(*args, **kw)
  File "/usr/local/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'
2019-03-22 21:58:40 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of huawei_lte.sensor. Setup failed for dependencies: huawei_lte
2019-03-22 21:58:40 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform huawei_lte.sensor: Could not set up all dependencies.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

huawei_lte:
  - url: http://192.168.8.1/
    username: *****
    password: *****

sensor:
  - platform: huawei_lte 
    monitored_conditions:
      - device_information.WanIPAddress
      - device_signal.rsrq
      - device_signal.rsrp
      - device_signal.rssi
      - device_signal.sinr
      - traffic_statistics.CurrentDownloadRate
      - traffic_statistics.CurrentUploadRate
      - traffic_statistics.TotalUpload
      - traffic_statistics.TotalDownload
      - traffic_statistics.TotalConnectTime

Traceback (if applicable):

2019-03-22 21:58:39 DEBUG (SyncWorker_7) [homeassistant.components.huawei_lte] device_information={'DeviceName': 'B525s-23a', 'SerialNumber': 'XXXXXX', 'Imei': 'XXXXXX', 'Imsi': 'XXXXXX', 'Iccid': 'XXXXXX', 'Msisdn': None, 'HardwareVersion': 'WL1B520FM', 'SoftwareVersion': '*******', 'WebUIVersion': '17.100.11.00.03', 'MacAddress1': 'XXXXXX', 'MacAddress2': None, 'WanIPAddress': '*******', 'wan_dns_address': 'XXXXXX', 'WanIPv6Address': None, 'wan_ipv6_dns_address': None, 'ProductFamily': 'LTE', 'Classify': 'cpe', 'supportmode': 'LTE|WCDMA|GSM', 'workmode': 'LTE', 'submask': '255.255.255.255'}
2019-03-22 21:58:39 DEBUG (SyncWorker_7) [homeassistant.components.huawei_lte] device_signal={'pci': '332', 'sc': None, 'cell_id': '35907843', 'rsrq': '-12dB', 'rsrp': '-87dBm', 'rssi': '-59dBm', 'sinr': '1dB', 'rscp': None, 'ecio': None, 'mode': '7', 'ulbandwidth': '10MHz', 'dlbandwidth': '10MHz', 'txpower': 'PPusch:3dBm PPucch:-7dBm PSrs:13dBm PPrach:1dBm', 'tdd': None, 'ul_mcs': 'mcsUpCarrier1:19', 'dl_mcs': 'mcsDownCarrier1Code0:0 mcsDownCarrier1Code1:2', 'earfcn': 'DL:6400 UL:24400', 'rrc_status': '1', 'rac': None, 'lac': None, 'tac': '225', 'band': '20', 'nei_cellid': 'No1:323No2:330', 'plmn': '24803', 'ims': '0'}
2019-03-22 21:58:39 DEBUG (SyncWorker_7) [homeassistant.components.huawei_lte] traffic_statistics={'CurrentConnectTime': '526426', 'CurrentUpload': '155746501', 'CurrentDownload': '8428', 'CurrentDownloadRate': '0', 'CurrentUploadRate': '256', 'TotalUpload': '1295512707', 'TotalDownload': '15933986', 'TotalConnectTime': '10644416', 'showtraffic': '1'}

Additional information:

Instagraeme commented 5 years ago

Same issue here.

mrgluek commented 5 years ago

Same issue, worked fine on 0.89.x and earlier.

toreamun commented 5 years ago

Same issue with 0.91.0

azrod commented 5 years ago

Same issue with 0.91.1

kuradi commented 5 years ago

any updates here?

azrod commented 5 years ago

Hey everybody,

I found the problem. This problem has been implemented by this commit : #21791

i tried to edit manifest.json (/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/huawei_lte/manifest.json) to put the release to 1.1.3.

HomeAssistant starts and does not raise any problem. In version 1.1.3 the sendings notification does not work.

I tried release 1.1.4 and it works ! For the test I tried version 1.2.0 and I have the same errors as in 1.1.5

I hope that these tests will be able to help you and to find a solution to this bug

Bye

kuradi commented 5 years ago

Hey everybody,

I found the problem. This problem has been implemented by this commit : #21791

i tried to edit manifest.json (/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/huawei_lte/manifest.json) to put the release to 1.1.3.

HomeAssistant starts and does not raise any problem. In version 1.1.3 the sendings notification does not work.

I tried release 1.1.4 and it works ! For the test I tried version 1.2.0 and I have the same errors as in 1.1.5

I hope that these tests will be able to help you and to find a solution to this bug

Bye

good for you, but im running hassio and i dont have folders you mention.... still wating for fix but it looks like nobody doesnt care :)

azrod commented 5 years ago

Hi @kuradi,

You have tried this command

find / -name manifest.json | grep huawei_lte

Regards

kuradi commented 5 years ago

Hi @kuradi,

You have tried this command

find / -name manifest.json | grep huawei_lte

Regards

just tried. no results. its kinda ridiculous atm... i opened this issue 3 months ago and there are zero progress with it :(

Instagraeme commented 5 years ago

@kuradi Totally agree - this is where home assistant lets itself down.

Anyway, a fix that has worked for me was to comment out the following lines in /usr/local/lib/python3.7/site-packages/huawei_lte_api/api/WLan.py

host = hosts.get('Hosts', {}).get('Host') if isinstance(host, dict): hosts['Hosts']['Host'] = [host]

Your path might be different depending on python versions.

kuradi commented 5 years ago

@awarecan is there any progress at all?

Petro31 commented 5 years ago

Has anyone here written an issue up against https://github.com/Salamek/huawei-lte-api/issues? The bug is not in home assistant, it's in the resource. There's a code block that changed in the exact area that has the issue.

https://github.com/Salamek/huawei-lte-api/commit/df634440796e281a4cc8e8f1434df70a2e4682c8#diff-94d33c0e96407782108a8e8b438784aa

Would be advantageous if one of you guys (who has the device) would write up an issue against it. Then when a new version of huawei-lte-api is built, it can be added to HA as a resource. Otherwise you guys will always be downgrading to 1.14 through the manifest.json file.

kuradi commented 5 years ago

Has anyone here written an issue up against https://github.com/Salamek/huawei-lte-api/issues? The bug is not in home assistant, it's in the resource. There's a code block that changed in the exact area that has the issue.

Salamek/huawei-lte-api@df63444#diff-94d33c0e96407782108a8e8b438784aa

Would be advantageous if one of you guys (who has the device) would write up an issue against it. Then when a new version of huawei-lte-api is built, it can be added to HA as a resource. Otherwise you guys will always be downgrading to 1.14 through the manifest.json file.

i have no idea what to write there :)

Salamek commented 5 years ago

@kuradi this bug was present in version 1.1.5 to 1.3 of https://github.com/Salamek/huawei-lte-api, version >=1.4 should be ok again, current version is 1.4.1... So update your depedencies && close this issue if it works...

kuradi commented 5 years ago

@kuradi this bug was present in version 1.1.5 to 1.3 of https://github.com/Salamek/huawei-lte-api, version >=1.4 should be ok again, current version is 1.4.1... So update your depedencies && close this issue if it works...

sorry but how should i do it when im using hassio?

awarecan commented 5 years ago

@kuradi you can open a pull request to change the dependency version in https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/huawei_lte/manifest.json

kuradi commented 5 years ago

@kuradi you can open a pull request to change the dependency version in https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/huawei_lte/manifest.json

thanx. i have no idea how to do it. maybe somebody smarter will open request?

stale[bot] commented 4 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

scop commented 4 years ago

I believe this has been addressed a long time ago already. If not, please post a note here or open a new issue with details, thanks.