StyraHem / ShellyForHASS

Shelly smart home platform for Home Assistant
MIT License
620 stars 111 forks source link

[BUG] #542

Closed Boh1 closed 3 years ago

Boh1 commented 3 years ago

Environment

Describe the bug

I'm seeing multiple HA Core log errors relating to Shelly, mostly around status updates and checking for firmware updates. I have a single Shelly device and seems to be working just fine wrt actual integrations. Firmware updates via the HA UI are not working, but a workaround is to simply use the Shelly native web interface.

Steps to Reproduce

Reboot HA core and/or HA hardware and errors start appearing in log. Errors seem to appear every minute, possibly related to some polling cycle.

Expected behavior

No log errors.

Screenshots

None - see logs.

Traceback/Error logs

2021-03-25 08:49:52 ERROR (Poll status) [pyShelly] Error update device status: 8CAAB5C51A12 SHSW-1, , Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pyShelly/block.py", line 191, in update_status_information
    dev.raise_updated(force_update_devices)
  File "/usr/local/lib/python3.8/site-packages/pyShelly/base.py", line 36, in raise_updated
    callback(self)
  File "/config/custom_components/shelly/device.py", line 59, in _updated
    self._update_ha_state()
  File "/config/custom_components/shelly/device.py", line 51, in _update_ha_state
    self.schedule_update_ha_state(True)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 421, in schedule_update_ha_state
    assert self.hass is not None

Additional context

Have tried restarting HA Core and HA hardware to resolve issue with no success.

stefanroelofs commented 3 years ago

I have similar issues. These error messages in the log every 10 minutes:

2021-03-31 21:56:03 ERROR (FirmwareManage) [pyShelly] Error http GET: https://repo.shelly.cloud/files/firmware, HTTP Error 400: Bad Request, Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pyShelly/firmware.py", line 29, in _http_get
    f = urllib.request.urlopen(url)
  File "/usr/local/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/local/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/usr/local/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/local/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pyShelly/firmware.py", line 29, in _http_get
    f = urllib.request.urlopen(url)
  File "/usr/local/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/local/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/usr/local/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/local/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request
2021-03-31 22:06:03 ERROR (FirmwareManage) [pyShelly] Error http GET: https://repo.shelly.cloud/files/firmware, HTTP Error 400: Bad Request, Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pyShelly/firmware.py", line 29, in _http_get
    f = urllib.request.urlopen(url)
  File "/usr/local/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/local/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/usr/local/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/local/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pyShelly/firmware.py", line 29, in _http_get
    f = urllib.request.urlopen(url)
  File "/usr/local/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/local/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/usr/local/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/local/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request
hakana commented 3 years ago

Fixed in latest release