ksya / ha-nefiteasy

Nefit Easy connection for Home Assistant
74 stars 31 forks source link

Error during startup phase nefiteasy component #13

Closed mchangsp closed 4 years ago

mchangsp commented 4 years ago

Hi ksya, thank you for the Nefit integration. I am trying to get it working. During startup I find the error messages below in the Home Assistant log. I don't think it is a SSL issue. Can someone take a look?

2020-02-17 21:32:36 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.nefiteasy
2020-02-17 21:32:36 ERROR (MainThread) [homeassistant.components.sensor] nefiteasy: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 304, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
    await self.async_update()
  File "/config/custom_components/nefiteasy/nefit_device.py", line 60, in async_update
    self._client.nefit.get(self.get_endpoint())
  File "/usr/local/lib/python3.7/site-packages/aionefit/__init__.py", line 107, in get
    self.xmppclient.send_message(mto=self._to, mbody=msg)
  File "/usr/local/lib/python3.7/site-packages/aionefit/provider/slixmpp_impl.py", line 94, in send_message
    message.stream.send_raw(str_data)
  File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/xmlstream.py", line 926, in send_raw
    raise NotConnectedError()
slixmpp.xmlstream.xmlstream.NotConnectedError
2020-02-17 21:32:36 ERROR (MainThread) [homeassistant.components.sensor] nefiteasy: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 304, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
    await self.async_update()
  File "/config/custom_components/nefiteasy/nefit_device.py", line 60, in async_update
    self._client.nefit.get(self.get_endpoint())
  File "/usr/local/lib/python3.7/site-packages/aionefit/__init__.py", line 107, in get
    self.xmppclient.send_message(mto=self._to, mbody=msg)
  File "/usr/local/lib/python3.7/site-packages/aionefit/provider/slixmpp_impl.py", line 94, in send_message
    message.stream.send_raw(str_data)
  File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/xmlstream.py", line 926, in send_raw
    raise NotConnectedError()
slixmpp.xmlstream.xmlstream.NotConnectedError
2020-02-17 21:32:36 ERROR (MainThread) [homeassistant.components.sensor] nefiteasy: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 304, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
    await self.async_update()
  File "/config/custom_components/nefiteasy/nefit_device.py", line 60, in async_update
    self._client.nefit.get(self.get_endpoint())
  File "/usr/local/lib/python3.7/site-packages/aionefit/__init__.py", line 107, in get
    self.xmppclient.send_message(mto=self._to, mbody=msg)
  File "/usr/local/lib/python3.7/site-packages/aionefit/provider/slixmpp_impl.py", line 94, in send_message
    message.stream.send_raw(str_data)
  File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/xmlstream.py", line 926, in send_raw
    raise NotConnectedError()
slixmpp.xmlstream.xmlstream.NotConnectedError
2020-02-17 21:32:36 ERROR (MainThread) [homeassistant.components.sensor] nefiteasy: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 304, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
    await self.async_update()
  File "/config/custom_components/nefiteasy/nefit_device.py", line 60, in async_update
    self._client.nefit.get(self.get_endpoint())
  File "/usr/local/lib/python3.7/site-packages/aionefit/__init__.py", line 107, in get
    self.xmppclient.send_message(mto=self._to, mbody=msg)
  File "/usr/local/lib/python3.7/site-packages/aionefit/provider/slixmpp_impl.py", line 94, in send_message
    message.stream.send_raw(str_data)
  File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/xmlstream.py", line 926, in send_raw
    raise NotConnectedError()
slixmpp.xmlstream.xmlstream.NotConnectedError
2020-02-17 21:32:36 ERROR (MainThread) [homeassistant.components.sensor] nefiteasy: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 304, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
    await self.async_update()
  File "/config/custom_components/nefiteasy/nefit_device.py", line 60, in async_update
    self._client.nefit.get(self.get_endpoint())
  File "/usr/local/lib/python3.7/site-packages/aionefit/__init__.py", line 107, in get
    self.xmppclient.send_message(mto=self._to, mbody=msg)
  File "/usr/local/lib/python3.7/site-packages/aionefit/provider/slixmpp_impl.py", line 94, in send_message
    message.stream.send_raw(str_data)
  File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/xmlstream.py", line 926, in send_raw
    raise NotConnectedError()
slixmpp.xmlstream.xmlstream.NotConnectedError
2020-02-17 21:32:36 ERROR (MainThread) [homeassistant.components.sensor] nefiteasy: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 304, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
    await self.async_update()
  File "/config/custom_components/nefiteasy/nefit_device.py", line 60, in async_update
    self._client.nefit.get(self.get_endpoint())
  File "/usr/local/lib/python3.7/site-packages/aionefit/__init__.py", line 107, in get
    self.xmppclient.send_message(mto=self._to, mbody=msg)
  File "/usr/local/lib/python3.7/site-packages/aionefit/provider/slixmpp_impl.py", line 94, in send_message
    message.stream.send_raw(str_data)
  File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/xmlstream.py", line 926, in send_raw
    raise NotConnectedError()
slixmpp.xmlstream.xmlstream.NotConnectedError
2020-02-17 21:32:36 ERROR (MainThread) [homeassistant.components.sensor] nefiteasy: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 304, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
    await self.async_update()
  File "/config/custom_components/nefiteasy/nefit_device.py", line 60, in async_update
    self._client.nefit.get(self.get_endpoint())
  File "/usr/local/lib/python3.7/site-packages/aionefit/__init__.py", line 107, in get
    self.xmppclient.send_message(mto=self._to, mbody=msg)
  File "/usr/local/lib/python3.7/site-packages/aionefit/provider/slixmpp_impl.py", line 94, in send_message
    message.stream.send_raw(str_data)
  File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/xmlstream.py", line 926, in send_raw
    raise NotConnectedError()
slixmpp.xmlstream.xmlstream.NotConnectedError
mchangsp commented 4 years ago

This is my configuration:

#
# integration for the Nefit easy thermostat
#
nefiteasy:
  devices:
  - serial: !secret nefit_serial
    accesskey: !secret nefit_accesskey
    password: !secret nefit_password
    name: Nefit Easy
    min_temp: 15
    max_temp: 27
    sensors:
      - year_total
      - status
      - supply_temperature
      - outdoor_temperature
      - system_pressure
      - active_program
      - hot_water_operation
    switches:
      - hot_water
      - holiday_mode
      - fireplace_mode
      - today_as_sunday
      - tomorrow_as_sunday
      - preheating
      - home_entrance_detection
mchangsp commented 4 years ago

Oops, reported too soon. I copied my secrets directly into the nefiteasy definition and now it seems to work. I will move the secrets one by one to secrets.yaml to see where it goes wrong. You can close this issue.