home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
70.47k stars 29.4k forks source link

opentherm_gw via socket tcp crashes hass #22231

Closed robswinkels closed 5 years ago

robswinkels commented 5 years ago

Home Assistant release with the issue:

0.89.2

Last working Home Assistant release (if known): unknown

Operating environment (Hass.io/Docker/Windows/etc.):

Docker on Synology

Component/platform:

https://www.home-assistant.io/components/opentherm_gw/

Description of problem: I'm noticing similar behaviour as in issue 20554, unfortunately that one is already closed. Opentherm component seems to crash/hang HA. As suggested in that issue, I have turned on debug logging for the pyotgw component:

# configuration.yaml
logger:
  default: warning
  logs:
    pyotgw.pyotgw: debug
    pyotgw.protocol: debug

this resulted in the following log lines before HA becomes inaccessible.

2019-03-20 21:01:04 DEBUG (MainThread) [pyotgw.protocol] Watchdog triggered!
2019-03-20 21:01:04 DEBUG (MainThread) [pyotgw.protocol] Canceling Watchdog task.
2019-03-20 21:01:04 DEBUG (MainThread) [pyotgw.pyotgw] Scheduling reconnect...
2019-03-20 21:01:04 DEBUG (MainThread) [pyotgw.pyotgw] Reconnecting to serial device on socket://192.168.2.11:6638
2019-03-20 21:01:04 ERROR (MainThread) [pyotgw.protocol] Disconnected: None

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

opentherm_gw:
  device: socket://192.168.2.11:6638
  climate:
    name: Thermostat
    precision: 0.5
  monitored_variables:
    - room_setpoint
    - room_temp
    - otgw_about
    - relative_mod_level
    - control_setpoint

Traceback (if applicable):

Additional information:

andriej commented 5 years ago

I had the same issues until 0.89. Few minues before upgrade to 0.90 I've moved my OTGW to ethernet connected version (changed nodemcu to that ttl adapter with ethernet) and there's no issues nor errors.

Migration moment marked: image you can even see how much lately was the scale of problem and unavailability of component or data...

I've tried to change espeasy on nodemcu to other cores but it was still the issue.

andriej commented 5 years ago

Oh I see that you've got 0.89.2 - try on 0.90, there were some fixes for OTGW and I hope they made to this version.

lwestenberg commented 5 years ago

I'm running Home Assistant 0.90.0 via Docker on a Pi 3B+ with the same configuration as @robswinkels and have the same issues. The last logs before crashing the whole Home Assistant instance are:

2019-03-22 10:01:48 ERROR (MainThread) [pyotgw.protocol] Disconnected: None
/usr/local/lib/python3.7/site-packages/pyotgw/protocol.py:65: RuntimeWarning: coroutine 'Queue.get' was never awaited
  q.get()
andriej commented 5 years ago

I think it was already fixed: https://github.com/mvn23/pyotgw/pull/5/files - just it seems like the version didn't get to HA, yet?

andriej commented 5 years ago

I can see it has got to HA, so maybe there's an issue with the fix. Calling @mvn23 :-)

lwestenberg commented 5 years ago

pyotgw 0.4b2 is on the development branch at this moment. Master / last release still has pyotgw 0.4b1.

andriej commented 5 years ago

If you're using venv or want quick fix, run: pip3 install pyotgw==0.4b2 The version should be bumped in 0.91 anyway

mvn23 commented 5 years ago

That will only work if you run HA with the --skip-pip option, otherwise it will reinstall the old version before it loads the library.

andriej commented 5 years ago

Really? Didn't know! Any way to push it to 0.90.2 as it's fix of platform?

mvn23 commented 5 years ago

That's not up to me to decide. You could try to ping someone with write access to master for that.

andriej commented 5 years ago

@fabaff - you're the last commiter to master... :-) any chance to get opentherm fixes to master? #21973 #22106 #22112 #22121 with .2?

andriej commented 5 years ago

@pvizeli any way to add this fixes mentioned above to 0.90.2 milestone? they get rid of bugs in OTGW component including this issue.

andriej commented 5 years ago

Fixed with 0.90.2 - check if issue still appears, probably can be closed.

Daylights commented 5 years ago

I can confirm it works much better in 0.90.2, no issues so far.

andriej commented 5 years ago

If still stable then issue can be closed?

@robswinkels did it help for u?

robswinkels commented 5 years ago

Have been running 0.90.2 for a number of days now and indeed the crashes seem to have disappeared. Issue can be closed.