From c00eea57736629d3569a78f39324f7aff0c1b322 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Arnauts?= Date: Tue, 20 Oct 2026 12:31:39 +0000 Subject: [PATCH] Describe how the bridge handles RPDO subscriptions A subscription is identified by pdid and zone, the bridge accepts any pdid below 0x4000 and doesn't check the type, clients share subscriptions, and there is room for 192. The timeout is not used; the interval is in seconds, per client, rounded down to a power of 2, and only used by the LAN C. Co-Authored-By: Claude Opus 5.5 --- docs/PROTOCOL.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/PROTOCOL.md b/docs/PROTOCOL.md index 44506d6..f9963b1 100644 --- a/docs/PROTOCOL.md +++ b/docs/PROTOCOL.md @@ -327,9 +327,19 @@ The `zone` is a bit set of zones: zone 1 is `1`, zone 2 is `2`, zone 3 is `4`, a ventilation unit with one zone it is always `1`. The official app subscribes to the CO2 levels of a CO2 sensor in the zone of that sensor, and hands a notification to every zone whose bit is set in its `zone` field †. -The official app subscribes with a `timeout` of `16777215` (`0xffffff`) †. It can also set the optional `interval` -field, but only with intervals it got for a remote (not LAN) connection. To unsubscribe, it sends a `CnRpdoRequestType` with the `pdid` -and the `zone` but without a `type`; the protobuf definition says that this deletes the subscription †. +A subscription is identified by its `pdid` and its `zone`. The bridge doesn't know which pdids exist or what their +type is: it accepts any `pdid` below `16384` (`0x4000`), and never checks the `type` against the `pdid`. A higher +`pdid` is answered with `NOT_EXIST`. Clients that subscribe to the same `pdid` and `zone` share one subscription on the +bridge, which is only removed when the last of them unsubscribes. The bridge has room for 192 subscriptions; when they +are all in use, it answers `NO_RESOURCES`. Unsubscribing from something that isn't subscribed is answered with +`NOT_EXIST`. + +The official app subscribes with a `timeout` of `16777215` (`0xffffff`) †, but the bridge doesn't use the `timeout`. +The optional `interval` field is in seconds, and is kept per client: the bridge then sends a notification for that +`pdid` to that client at most once per interval, rounded down to a power of 2 (an `interval` of `10` gives one every 8 +seconds). A LAN C (firmware R1.5.1) does this; the gateway in a ComfoAir Flex (R1.2.1) ignores the `interval`. The +official app only sets it with intervals it got for a remote (not LAN) connection. To unsubscribe, it sends a +`CnRpdoRequestType` with the `pdid` and the `zone` but without a `type`, which deletes the subscription. ```javascript type: CnRpdoRequestType