ksya / ha-nefiteasy

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

Home assistant on boot errors #11

Closed BVGorp closed 4 years ago

BVGorp commented 4 years ago

When booting the following errors are in homeassistant.log Entities are not available when error occurs. Sometimes the error is not present on boot. Then it does work. running on a version of yesterday

2019-12-19 00:19:46 WARNING (MainThread) [slixmpp.stringprep] Using slower stringprep, consider compiling the faster cython/libidn one.
2019-12-19 00:19:51 ERROR (MainThread) [homeassistant.core] Error doing job: Fatal error: protocol.data_received() call failed.
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/asyncio/selector_events.py", line 816, in _read_ready__data_received
    self._protocol.data_received(data)
  File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/xmlstream.py", line 406, in data_received
    self._spawn_event(xml)
  File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/xmlstream.py", line 970, in _spawn_event
    stanza = self._build_stanza(xml)
  File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/xmlstream.py", line 951, in _build_stanza
    stanza = stanza_type(self, xml)
  File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/stanzabase.py", line 1390, in __init__
    ElementBase.__init__(self, xml, parent)
  File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/stanzabase.py", line 416, in __init__
    if self.setup(xml):
  File "/usr/local/lib/python3.7/site-packages/slixmpp/stanza/stream_features.py", line 27, in setup
    self.values = self.values
  File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/stanzabase.py", line 615, in _set_stanza_values
    self[full_interface] = value
  File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/stanzabase.py", line 753, in __setitem__
    lang=lang)
  File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/stanzabase.py", line 959, in _set_sub_text
    return self._del_sub(name, lang=lang)
  File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/stanzabase.py", line 1040, in _del_sub
    parent = self.xml.find(parent_path)
  File "/usr/local/lib/python3.7/xml/etree/ElementTree.py", line 299, in find
    return ElementPath.find(self, path, namespaces)
  File "/usr/local/lib/python3.7/xml/etree/ElementPath.py", line 307, in find
    return next(iterfind(elem, path, namespaces), None)
TypeError: 'NoneType' object is not an iterator
2019-12-19 00:19:56 WARNING (MainThread) [homeassistant.setup] Setup of nefiteasy is taking over 10 seconds.
2019-12-19 00:20:46 ERROR (MainThread) [homeassistant.setup] Error during setup of component nefiteasy
Traceback (most recent call last):
  File "/config/custom_components/nefiteasy/__init__.py", line 104, in connect
    await asyncio.wait_for(self.nefit.xmppclient.connected_event.wait(), timeout=60.0)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 449, in wait_for
    raise futures.TimeoutError()
concurrent.futures._base.TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 172, in _async_setup_component
    hass, processed_config
  File "/config/custom_components/nefiteasy/__init__.py", line 67, in async_setup
    await client.connect()
  File "/config/custom_components/nefiteasy/__init__.py", line 115, in connect
    raise PlatformNotReady
homeassistant.exceptions.PlatformNotReady

These notifications are received. image

Config:

nefiteasy:
  devices:
    - serial: !secret nefitserial
      accesskey: !secret nefitaccesskey
      password: !secret nefitpassword
      name: Nefit Easy #below here all optional settings
      min_temp: 15
      max_temp: 27
      sensors:
       - year_total
       - status
       - supply_temperature
       - outdoor_temperature
       - system_pressure
      switches:
       - hot_water
       - holiday_mode
       - today_as_sunday
       - tomorrow_as_sunday
       - home_entrance_detection
liquid-motion commented 4 years ago

I have exactly the same problem. Have to reboot a few times, before the error disappears.

sweetpants commented 4 years ago

Same for me, have to restart HA several times to finally load

2019-12-24 10:30:24 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for nefiteasy which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant. 2019-12-24 10:30:27 DEBUG (MainThread) [aionefit] Initializing XMPP client 2019-12-24 10:30:29 ERROR (MainThread) [homeassistant.core] Error doing job: Fatal error: protocol.data_received() call failed. Traceback (most recent call last): File "/usr/local/lib/python3.7/asyncio/selector_events.py", line 816, in _read_readydata_received self._protocol.data_received(data) File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/xmlstream.py", line 406, in data_received self._spawn_event(xml) File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/xmlstream.py", line 970, in _spawn_event stanza = self._build_stanza(xml) File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/xmlstream.py", line 951, in _build_stanza stanza = stanza_type(self, xml) File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/stanzabase.py", line 1390, in init ElementBase.init(self, xml, parent) File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/stanzabase.py", line 416, in init if self.setup(xml): File "/usr/local/lib/python3.7/site-packages/slixmpp/stanza/stream_features.py", line 27, in setup self.values = self.values File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/stanzabase.py", line 615, in _set_stanza_values self[full_interface] = value File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/stanzabase.py", line 753, in setitem__ lang=lang) File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/stanzabase.py", line 959, in _set_sub_text return self._del_sub(name, lang=lang) File "/usr/local/lib/python3.7/site-packages/slixmpp/xmlstream/stanzabase.py", line 1040, in _del_sub parent = self.xml.find(parent_path) File "/usr/local/lib/python3.7/xml/etree/ElementTree.py", line 299, in find return ElementPath.find(self, path, namespaces) File "/usr/local/lib/python3.7/xml/etree/ElementPath.py", line 307, in find return next(iterfind(elem, path, namespaces), None) TypeError: 'NoneType' object is not an iterator 2019-12-24 10:30:29 DEBUG (MainThread) [aionefit.provider.slixmpp_impl] Connection was closed

mauricebish commented 4 years ago

I have the same issue. Rebooting helps, but issue pops up again after a ha restart from the gui

ksya commented 4 years ago

Should be fixed in latest version

ErnstEeldert commented 4 years ago

I'm on f6db01a, and still experience this issue to such effect that it's impossible to use the component, as it stalls HA restarts by a minute or so, and the end result is in ~75% of the cases that my heating is no longer controlled :|

I'm running the latest stable HA, no custom components other than this one, and mainly controlling a zigbee network through mqtt integration. Hardware is an i5 NUC on SSD with 16GB RAM. Oh, and HA is running based off the official docker image.

Thoughts?

liquid-motion commented 4 years ago

Please reopen this bug. It's still not fixed in latest version (of Hassio and this plugin).