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
71.11k stars 29.79k forks source link

Opentherm Gateway - unknown message in queue #88020

Closed lloyda closed 1 year ago

lloyda commented 1 year ago

The problem

A few times a day I see the following in the logs. Not causing any problems, but reported here just in case.

2023-02-13 10:54:41.327 WARNING (MainThread) [pyotgw.commandprocessor] Unknown message in command queue: SC: 10:54/1
2023-02-13 10:54:41.330 WARNING (MainThread) [pyotgw.commandprocessor] Command PR failed with SC: 10:54/1, retrying...

What version of Home Assistant Core has the issue?

core-2023.2.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

opentherm-gw

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @mvn23, mind taking a look at this issue as it has been labeled with an integration (opentherm_gw) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `opentherm_gw` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Change the title of the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign opentherm_gw` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


opentherm_gw documentation opentherm_gw source (message by IssueLinks)

akula3 commented 1 year ago

The similar for me:

Logger: pyotgw.commandprocessor
Source: runner.py:120
First occurred: 1. Februar 2023 um 16:31:28 (260490 occurrences)
Last logged: 05:26:04

Command PR failed with PR: Q=P, retrying...
Unknown message in command queue: PR: S=16.00
Command PR failed with PR: S=16.00, retrying...
Received Error 03. If this happens during a reset of the gateway it can be safely ignored.
Command PR failed with Error 03, retrying...
mvn23 commented 1 year ago

A few times a day I see the following in the logs. Not causing any problems, but reported here just in case.

Thanks. The error you see means that the gateway is responding to another command while HA is expecting a response to a command it just sent. In this case, something is trying to set the clock on the gateway (SC command) while HA is waiting for a response to a "print report" (PR) command.

Make sure HA is the only thing connecting to the gateway to prevent messages like this. While some networked setups allow more than one connection to the gateway, it is originally designed as a serial device. For this reason, the library that we use only supports a single connection to the gateway. See also the warning here.

The similar for me:

Same response for you. If you're trying to connect more than one thing to the gateway things like this will happen. However, Error 03 is an error that is generated by the gateway itself (see here) If you see a lot of these (I sure hope there aren't 260490 in your logs), please have a look at the troubleshooting section of the OpenTherm Gateway docs.

lloyda commented 1 year ago

Interesting, as I believe the only things connected to my gateway are HA, the boiler, and evohome.

mvn23 commented 1 year ago

Neither the library (pyotgw) nor the Home Assistant integration try to set the clock on the gateway by default. The only way the SC response can show up in the logs is if something is issuing that command to the gateway. This can be done from Home Assistant (any automation using the opentherm_gw.set_clock service, although this should normally not produce any warnings in the logs) or from somewhere else using e.g. otmonitor with certain options enabled.

akula3 commented 1 year ago

or from somewhere else using e.g. otmonitor with certain options enabled Indeed, I run otmonitor in parallel, but all set clock options are disabled. An, indeed, since I closed otmonitor, the warnings disappeared. Thanks for your hint, @mvn23!

lloyda commented 1 year ago

I don't run otmonitor, and many of the occurrences of this occur when my PC is off. As I said, not a big deal, just intriguing.

andriej commented 1 year ago

I do run otmonitor just to lookup messages and without it changing messages anyhow.

Logger: pyotgw.commandprocessor
Source: runner.py:128
First occurred: 22 lutego 2023 14:10:00 (38 occurrences)
Last logged: 10:16:00

Command PR failed with SC: 09:18/4, retrying...
Unknown message in command queue: SC: 10:09/4
Command PR failed with SC: 10:09/4, retrying...
Unknown message in command queue: SC: 10:16/4
Command PR failed with SC: 10:16/4, retrying...

If there's way to solve that I'd like to help with the solution or debugging.

Despite warnings in log everything works, of course.

mvn23 commented 1 year ago

I do run otmonitor just to lookup messages and without it changing messages anyhow.

There's a clear warning in the docs that this is not supported. Therefore, no support will be provided.

andriej commented 1 year ago

You've convinced me to switch back to direct communication. :-)

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.