Skip to content

Learn the ventilation unit node id from CnNodeNotification - #79

Merged
michaelarnauts merged 1 commit into
masterfrom
discover-ventilation-node
Aug 2, 2026
Merged

Learn the ventilation unit node id from CnNodeNotification#79
michaelarnauts merged 1 commit into
masterfrom
discover-ventilation-node

Conversation

@michaelarnauts

Copy link
Copy Markdown
Owner

Summary

On newer firmware the ventilation unit is no longer exposed as node 1, so every RMI/property call returned RMI_ERROR while the session itself established fine (a ComfoAir Flex was seen at node 45).

This handles CnNodeNotificationType instead of ignoring it and tracks the nodes on the ComfoNet bus per session. The node whose productId identifies a ventilation unit (1 = ComfoAirQ, 8 = ComfoAirFlex) is the node all RMI/property calls are sent to; other nodes (gateway 5, Flex connection board 9, …) are stored but never selected. A CnNodeRequest retriggers discovery, and the session isn't reported ready until the unit is known.

There is deliberately no fallback to node 1: when the bridge doesn't announce a ventilation unit, a VentilationUnitNotFoundException is raised instead of sending commands to a guessed node. The reconnect loop retries every 5 seconds, so connect() fails with its usual timeout.

Testing

  • Live LAN C / ComfoAir Q450 (node 1): model/serial/speed/mode/bypass/balance/boost/flow reads, sensor streaming, and the get-property CLI all work; an explicit wrong node still yields RMI_ERROR.
  • A protocol-level fake bridge for the cases the local hardware can't reproduce: ComfoAir Flex layout (RMI confirmed arriving on node 45, never node 1) and the no-ventilation-unit case (zero RMI requests sent, VentilationUnitNotFoundException raised).
  • 76 unit tests pass (14 new), pylint 10.00, black/isort clean.

Fixes #78

On newer firmware the ventilation unit is no longer exposed as node 1, so
every RMI request returned RMI_ERROR while the session itself established
fine. A ComfoAir Flex was for example seen at node 45.

Handle CnNodeNotificationType instead of ignoring it, and keep track of the
nodes on the ComfoNet bus per session. The node whose productId identifies a
ventilation unit (1 = ComfoAirQ, 8 = ComfoAirFlex) is the node all RMI and
property calls are sent to. Other nodes on the bus, such as the gateway
(5) and the Flex connection board (9), are stored but never selected.

The nodes are announced when a session starts, and we also send a
CnNodeRequest to retrigger the discovery. We wait for the ventilation unit
before the session is considered ready, so the first property read already
goes to the right node.

There is no fallback to node 1: when the bridge doesn't announce a
ventilation unit, a VentilationUnitNotFoundException is raised instead of
sending commands to a node that we are only guessing about. The reconnect
loop retries every 5 seconds, so connect() fails with its usual timeout.

Fixes #78

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RMI calls fail with newer firmware: ventilation unit is not node 1, node id must be learned from CnNodeNotification

1 participant