core: Viessmann integration failes sometimes

Home Assistant release with the issue: 0.100.2

Last working Home Assistant release (if known): The previous custom component from @oischinger didn’t have the problem.

Operating environment (Hass.io/Docker/Windows/etc.): hassbian on raspberry pi 3b

Integration: vicare

Description of problem: After some time, the vicare integration stops working. A restart solves the problem. I’m unsure what the problem is, but it could be that some missing exception handling when the server is down is the cvause of the problem. Interesting could also be the fact that restart of home assistant is not possible from UI after the vicare integration stops working. The process is then blocked and either reboot of the raspberry pi is needed or I have to manually kill the home assistant process(es) from the command line.

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

vicare:
  username: ***
  password: ***

Traceback (if applicable):

2019-10-18 01:04:52 ERROR (MainThread) [homeassistant.helpers.entity] Update for water_heater.vicare_water fails
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connectionpool.py", line 603, in urlopen
    chunked=chunked)
  File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connectionpool.py", line 387, in _make_request
    six.raise_from(e, None)
  File "<string>", line 2, in raise_from
  File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connectionpool.py", line 383, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/lib/python3.7/http/client.py", line 1321, in getresponse
    response.begin()
  File "/usr/local/lib/python3.7/http/client.py", line 296, in begin
    version, status, reason = self._read_status()
  File "/usr/local/lib/python3.7/http/client.py", line 265, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connectionpool.py", line 641, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/util/retry.py", line 368, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/packages/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connectionpool.py", line 603, in urlopen
    chunked=chunked)
  File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connectionpool.py", line 387, in _make_request
    six.raise_from(e, None)
  File "<string>", line 2, in raise_from
  File "/srv/homeassistant/lib/python3.7/site-packages/urllib3/connectionpool.py", line 383, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/lib/python3.7/http/client.py", line 1321, in getresponse
    response.begin()
  File "/usr/local/lib/python3.7/http/client.py", line 296, in begin
    version, status, reason = self._read_status()
  File "/usr/local/lib/python3.7/http/client.py", line 265, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 268, in async_update_ha_state
    await self.async_device_update()
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 448, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/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/vicare/water_heater.py", line 68, in update
    current_temperature = self._api.getDomesticHotWaterStorageTemperature()
  File "/srv/homeassistant/lib/python3.7/site-packages/PyViCare/PyViCareDevice.py", line 220, in getDomesticHotWaterStorageTemperature
    return self.service.getProperty("heating.dhw.sensors.temperature.hotWaterStorage")["properties"]["value"]["value"]
  File "/srv/homeassistant/lib/python3.7/site-packages/PyViCare/PyViCareService.py", line 231, in getProperty
    j=self.__get(url)
  File "/srv/homeassistant/lib/python3.7/site-packages/PyViCare/PyViCareService.py", line 164, in __get
    r=self.oauth.get(url).json()
  File "/srv/homeassistant/lib/python3.7/site-packages/requests/sessions.py", line 546, in get
    return self.request('GET', url, **kwargs)
  File "/srv/homeassistant/lib/python3.7/site-packages/requests_oauthlib/oauth2_session.py", line 425, in request
    headers=headers, data=data, **kwargs)
  File "/srv/homeassistant/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/srv/homeassistant/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/srv/homeassistant/lib/python3.7/site-packages/requests/adapters.py", line 498, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

Additional information: vicare_log.txt

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 22 (21 by maintainers)

Commits related to this issue

Most upvoted comments

All problems are fixed for me since version 0.103.0. Many thanks to all involved.

You’re right that there is one API call returning all values, but the PyViCare library reads all values separately directly from the server in separate calls.

For sure one option would be to create a new library which uses the global API call which returns all values to avoid such problems. Then we need a complete rewrite of the library and the home assistant integration.

@crazyfx1 I synced the master branch with your heating mode / set temperature bugfix