SonoffLAN: Integration cannot be set up

I’m getting this error and the Sonoff integration cannot be set up.

2020-09-24 16:13:12  DEBUG    main          SysInfo: {'version': '0.115.2', 'dev': False, 'hassio': True, 'virtualenv': False, 'python_version': '3.8.5', 'docker': True, 'arch': 'armv7l', 'os_name': 'Linux', 'os_version': '4.19.127-v7', 'supervisor': '245', 'host_os': 'HassOS 4.13', 'chassis': 'embedded', 'docker_version': '19.03.11'}
2020-09-24 16:13:12  DEBUG    main          AUTO mode start
2020-09-24 16:13:19  ERROR    sonoff_cloud  Coolkit API error: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('https://eu-api.coolkit.cc:8080/api/user/login')
2020-09-24 15:56:57 ERROR (MainThread) [custom_components.sonoff.sonoff_cloud] Coolkit API error: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('https://eu-api.coolkit.cc:8080/api/user/login')
Traceback (most recent call last):
  File "/config/custom_components/sonoff/sonoff_cloud.py", line 148, in _api
    return await r.json()
  File "/usr/local/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 1026, in json
    raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('https://eu-api.coolkit.cc:8080/api/user/login')
2020-09-24 15:56:57 ERROR (MainThread) [homeassistant.setup] Error during setup of component sonoff
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 213, in _async_setup_component
    result = await task
  File "/config/custom_components/sonoff/__init__.py", line 102, in async_setup
    if await registry.cloud_login(config[CONF_USERNAME],
  File "/config/custom_components/sonoff/sonoff_main.py", line 110, in cloud_login
    return await self.cloud.login(username, password)
  File "/config/custom_components/sonoff/sonoff_cloud.py", line 282, in login
    if resp.get('error') == 406:
AttributeError: 'NoneType' object has no attribute 'get'

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 43 (9 by maintainers)

Most upvoted comments

Well nevermind. After countless restarts of the server, I just restarted the entire raspberry (it crashed somehow) and now the all devices appeared. The classic “did you turn it off and on again” troubleshooting