From 8f001667047e14a1b8023b52268f1f62bddc8469 Mon Sep 17 00:00:00 2001 From: Doug Rathbone Date: Sat, 21 Nov 2026 08:00:06 +0000 Subject: [PATCH 1/4] fix: raw event capture sees applications with no group address Capture only matched a network/application/group triple. Clock, Audio and Media Transport address the application itself, so their lines (for example "audio mute //BOARD/254/205 1 2 7") never matched and cbus_raw_event_log_apps captured nothing for them. Fall back to the network/application pair and publish to cbus/read/{net}/{app}/raw. Co-authored-by: Doug Rathbone --- src/cgateWebBridge.js | 4 +++- src/rawEventCapture.js | 17 ++++++++++++----- tests/rawEventCapture.test.js | 29 +++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/src/cgateWebBridge.js b/src/cgateWebBridge.js index ba5ebd77..ad7ce8a8 100644 --- a/src/cgateWebBridge.js +++ b/src/cgateWebBridge.js @@ -848,7 +848,9 @@ class CgateWebBridge { // Redacted like the log line above. Redacting one and not the // other was the original 1.24.3 miss: this publishes off-box to // every broker subscriber, so it is the worse of the two (#51). - `cbus/read/${target.network}/${target.application}/${target.group}/raw`, + target.group === null + ? `cbus/read/${target.network}/${target.application}/raw` + : `cbus/read/${target.network}/${target.application}/${target.group}/raw`, redactCgateLine(line), RAW_CAPTURE_MQTT_OPTIONS ); diff --git a/src/rawEventCapture.js b/src/rawEventCapture.js index 38e0c9c7..1c24811e 100644 --- a/src/rawEventCapture.js +++ b/src/rawEventCapture.js @@ -11,15 +11,20 @@ /** * Decide whether a raw C-Gate line should be captured for the configured apps, * and extract its address. Returns null when capture is disabled, the line has - * no network/application/group triple, or the app is not in the capture list. + * no network/application address, or the app is not in the capture list. * * The address is the first numeric triple on the line, which holds for every - * known C-Gate event/status shape (e.g. "lighting on 254/56/4", + * group-addressed C-Gate event/status shape (e.g. "lighting on 254/56/4", * "//CLIPSAL/254/56/10", "300 //HOME/254/203/5: level=128"). * + * Applications with no group (Clock 223, Audio 205, Media Transport 192) carry + * a two-segment address such as "clock time //CLIPSAL/254/223 21:13:21 0". + * Those fall back to network/application with a null group, so the capture + * feature can see the traffic a decoder has yet to be written for. + * * @param {string} line - Raw C-Gate line. * @param {Array} apps - Configured application IDs to capture. - * @returns {{network: string, application: string, group: string}|null} + * @returns {{network: string, application: string, group: string|null}|null} */ function parseRawCaptureTarget(line, apps) { if (!apps || apps.length === 0) { @@ -29,7 +34,9 @@ function parseRawCaptureTarget(line, apps) { return null; } - const match = line.match(/(\d+)\/(\d+)\/(\d+)/); + const triple = line.match(/(\d+)\/(\d+)\/(\d+)/); + const pair = triple ? null : line.match(/(?:^|[\s/])(\d+)\/(\d+)(?=[\s:]|$)/); + const match = triple || pair; if (!match) { return null; } @@ -39,7 +46,7 @@ function parseRawCaptureTarget(line, apps) { return null; } - return { network: match[1], application, group: match[3] }; + return { network: match[1], application, group: triple ? match[3] : null }; } module.exports = { parseRawCaptureTarget }; diff --git a/tests/rawEventCapture.test.js b/tests/rawEventCapture.test.js index 916e31df..3d70fa60 100644 --- a/tests/rawEventCapture.test.js +++ b/tests/rawEventCapture.test.js @@ -43,6 +43,16 @@ describe('raw event capture', () => { expect(published.length).toBe(1); }); + it('captures a two-segment address under cbus/read/{net}/{app}/raw', () => { + const { bridge, published } = buildBridge(['205']); + bridge._publishRawEventCapture('audio current_feed //BOARD/254/205 1 2 4 0 #sourceunit=0'); + expect(published).toContainEqual({ + topic: 'cbus/read/254/205/raw', + payload: 'audio current_feed //BOARD/254/205 1 2 4 0 #sourceunit=0', + opts: { retain: false, qos: 0 } + }); + }); + it('handles a line with no net/app/group token gracefully', () => { const { bridge, published } = buildBridge(['172']); bridge._publishRawEventCapture('garbage line with no address'); @@ -61,6 +71,25 @@ describe('parseRawCaptureTarget', () => { .toEqual({ network: '254', application: '172', group: '3' }); }); + it('falls back to network and application for a line with no group', () => { + expect(parseRawCaptureTarget('audio mute //BOARD/254/205 1 2 7', [205])) + .toEqual({ network: '254', application: '205', group: null }); + expect(parseRawCaptureTarget('#s# clock time //MIDSTRM/254/223 08:44:00 255 #sourceunit=18', ['223'])) + .toEqual({ network: '254', application: '223', group: null }); + expect(parseRawCaptureTarget('mediatransport play 254/192 2', ['192'])) + .toEqual({ network: '254', application: '192', group: null }); + }); + + it('prefers the group address when a line has both shapes', () => { + expect(parseRawCaptureTarget('lighting on //HOME/254/56/4', ['56'])) + .toEqual({ network: '254', application: '56', group: '4' }); + }); + + it('does not mistake a date or time for an address', () => { + expect(parseRawCaptureTarget('clock date //HOME/254/223 2026-03-02 0', ['2026', '3', '2'])) + .toBeNull(); + }); + it('returns null when the app is not configured', () => { expect(parseRawCaptureTarget('lighting on 254/56/4', ['172'])).toBeNull(); }); From b255f6b42a16c5161928742217f6158c865e1581 Mon Sep 17 00:00:00 2001 From: Doug Rathbone Date: Sat, 21 Nov 2026 08:00:06 +0000 Subject: [PATCH 2/4] feat: claim C-Bus Audio and Media Transport event lines Audio (205) and Media Transport (192) lines have a two-segment address, so CBusEvent warned "Could not parse event line" for every one, and the #-prefixed form was dropped as a comment before capture could see it. Claim both in a small handler that routes them to raw capture and logs a single INFO hint on how to capture. Nothing is decoded: the manual does not say what the zone function codes mean and there are no real captures yet, so a decoder would be a guess. Co-authored-by: Doug Rathbone --- src/applicationDecoders/appEventLine.js | 4 +- src/audioEventHandler.js | 81 +++++++++++++++++++++++++ src/cgateWebBridge.js | 3 + src/cgateWebBridgeBuild.js | 12 ++++ tests/audioEventHandler.test.js | 47 ++++++++++++++ tests/cgateWebBridge.test.js | 35 +++++++++++ 6 files changed, 181 insertions(+), 1 deletion(-) create mode 100644 src/audioEventHandler.js create mode 100644 tests/audioEventHandler.test.js diff --git a/src/applicationDecoders/appEventLine.js b/src/applicationDecoders/appEventLine.js index c4028baa..bf8ace55 100644 --- a/src/applicationDecoders/appEventLine.js +++ b/src/applicationDecoders/appEventLine.js @@ -15,7 +15,9 @@ const PREFIX_WITH_SPACE = { security: 'security ', measurement: 'measurement ', clock: 'clock ', - trigger: 'trigger ' + trigger: 'trigger ', + audio: 'audio ', + mediatransport: 'mediatransport ' }; // Matches the keypad/hardware-native shape of a Trigger Control line, e.g. diff --git a/src/audioEventHandler.js b/src/audioEventHandler.js new file mode 100644 index 00000000..d61bddd8 --- /dev/null +++ b/src/audioEventHandler.js @@ -0,0 +1,81 @@ +// @ts-check +'use strict'; + +const { isAppEventLine } = require('./applicationDecoders/appEventLine'); + +/** + * Claims C-Bus Audio ($CD / app 205) and Media Transport Control ($C0 / + * app 192) event lines. + * + * Neither application is decoded yet. The C-Gate manual documents the command + * names and argument ranges (sections 4.5.16-4.5.35 and 4.5.99-4.5.118) but + * not what the zone function codes mean, and there are no real captures in + * this repository, so writing a decoder now would be a guess (see the note in + * src/applicationDecoders/clockDecoder.js on why that is worse than a missing + * feature; docs/AUDIO_INVESTIGATION.md lists what is unknown). What this handler does instead: + * + * - Keeps the lines out of CBusEvent. Their address has two segments + * (`//PROJECT//`, no group), so CBusEvent warns "Could not parse + * event line" on every one, and the `#`/`#s#`-prefixed form is dropped as a + * comment before anything else sees it. + * - Sends them to raw event capture, so a tester can set + * cbus_raw_event_log_apps to 205 and 192 and share what their hardware + * actually emits. + * - Says once, at INFO, that audio traffic is on the bus and how to capture + * it. + */ + +const AUDIO_APP_ID = '205'; +const MEDIA_TRANSPORT_APP_ID = '192'; + +/** @type {Array<{ prefix: 'audio'|'mediatransport', name: string, appId: string }>} */ +const CLAIMED_APPLICATIONS = [ + { prefix: 'audio', name: 'Audio', appId: AUDIO_APP_ID }, + { prefix: 'mediatransport', name: 'Media Transport', appId: MEDIA_TRANSPORT_APP_ID } +]; + +class AudioEventHandler { + /** + * @param {Object} deps + * @param {{ info: Function, debug: Function }} deps.logger + * @param {(line: string) => void} deps.captureRaw - Raw event capture hook. + */ + constructor({ logger, captureRaw }) { + this.logger = logger; + this.captureRaw = captureRaw; + /** @type {Set} */ + this._hintedApps = new Set(); + } + + /** + * @param {string} line - Raw line from the C-Gate event stream. + * @returns {true|false} true when the line was audio or media transport + * traffic and has been consumed, false when it is neither. + */ + handleLine(line) { + const application = CLAIMED_APPLICATIONS.find((app) => isAppEventLine(line, app.prefix)); + if (!application) return false; + + this.captureRaw(line); + this._hintOnce(application); + return true; + } + + /** + * Once per application, not once per line: an audio matrix reports every + * zone change and this is INFO. + * @param {{ name: string, appId: string }} application + * @private + */ + _hintOnce(application) { + if (this._hintedApps.has(application.appId)) return; + this._hintedApps.add(application.appId); + this.logger.info( + `C-Bus ${application.name} traffic seen but not decoded yet. To help add support, set ` + + `cbus_raw_event_log_apps to include ${application.appId} and share the captured lines ` + + `(https://github.com/dougrathbone/cgateweb/issues/172).` + ); + } +} + +module.exports = AudioEventHandler; diff --git a/src/cgateWebBridge.js b/src/cgateWebBridge.js index ad7ce8a8..a1fa050f 100644 --- a/src/cgateWebBridge.js +++ b/src/cgateWebBridge.js @@ -114,6 +114,8 @@ class CgateWebBridge { /** @type {*} */ measurementEventHandler; /** @type {*} */ + audioEventHandler; + /** @type {*} */ stateResyncCoordinator; /** @type {*} */ networkInterfaceMonitor; @@ -600,6 +602,7 @@ class CgateWebBridge { ['security', () => this._handleSecurityLine(line)], ['measurement', () => this._handleMeasurementLine(line)], ['clock', () => this._handleClockLine(line)], + ['audio', () => this.audioEventHandler.handleLine(line)], ['trigger', () => this._handleTriggerMinMaxLine(line)] ]; /** @type {Record} */ diff --git a/src/cgateWebBridgeBuild.js b/src/cgateWebBridgeBuild.js index f5abcadc..fe551c01 100644 --- a/src/cgateWebBridgeBuild.js +++ b/src/cgateWebBridgeBuild.js @@ -12,6 +12,7 @@ const EventPublisher = require('./eventPublisher'); const AirconEventHandler = require('./airconEventHandler'); const SecurityEventHandler = require('./securityEventHandler'); const MeasurementEventHandler = require('./measurementEventHandler'); +const AudioEventHandler = require('./audioEventHandler'); const StateResyncCoordinator = require('./stateResyncCoordinator'); const CommandResponseProcessor = require('./commandResponseProcessor'); const { CgateVersionReporter } = require('./cgateVersion'); @@ -50,6 +51,9 @@ class _CgateWebBridgeBuild { /** @type {() => *} */ _createLineProcessor; + /** @type {(line: string) => void} */ + _publishRawEventCapture; + /** @type {() => number} */ _getAdaptiveQueueIntervalMs; @@ -274,6 +278,14 @@ class _CgateWebBridgeBuild { getHaDiscovery: this._getHaDiscovery }); + // Audio (app 205) and Media Transport (app 192) are not decoded yet; + // the handler only keeps their lines out of the standard parser and + // routes them to raw capture. + this.audioEventHandler = new AudioEventHandler({ + logger: this.logger, + captureRaw: (line) => this._publishRawEventCapture(line) + }); + // Republishes state after a Home Assistant or MQTT broker restart // (issue #44). Neither event restarts the bridge, so nothing else would. this.stateResyncCoordinator = new StateResyncCoordinator({ diff --git a/tests/audioEventHandler.test.js b/tests/audioEventHandler.test.js new file mode 100644 index 00000000..f7beb2f5 --- /dev/null +++ b/tests/audioEventHandler.test.js @@ -0,0 +1,47 @@ +const AudioEventHandler = require('../src/audioEventHandler'); + +function makeHandler() { + const logger = { info: jest.fn(), debug: jest.fn() }; + const captureRaw = jest.fn(); + return { handler: new AudioEventHandler({ logger, captureRaw }), logger, captureRaw }; +} + +describe('AudioEventHandler', () => { + it.each([ + 'audio current_feed //PROJ/254/205 1 2 4 100', + 'audio mute //PROJ/254/205 0 7 2 #sourceunit=9 OID=', + '#s# audio on //PROJ/254/205 1 0 255', + '# audio set_feed //PROJ/254/205 1 3 2 0', + 'mediatransport pause //PROJ/254/192 1 #sourceunit=4', + '#e# mediatransport status //PROJ/254/192 1', + ])('consumes and captures %s', (line) => { + const { handler, captureRaw } = makeHandler(); + expect(handler.handleLine(line)).toBe(true); + expect(captureRaw).toHaveBeenCalledWith(line); + }); + + it.each([ + 'lighting on 254/56/4', + 'clock time //PROJ/254/223 21:13:21 0', + 'audiofoo //PROJ/254/205 1', + 'security zone_unsealed //PROJ/254/208 3', + '', + ])('leaves %p to the other handlers', (line) => { + const { handler, captureRaw } = makeHandler(); + expect(handler.handleLine(line)).toBe(false); + expect(captureRaw).not.toHaveBeenCalled(); + }); + + it('explains how to capture once per application, not once per line', () => { + const { handler, logger } = makeHandler(); + handler.handleLine('audio mute //PROJ/254/205 1 2 7'); + handler.handleLine('audio mute //PROJ/254/205 1 3 7'); + handler.handleLine('mediatransport play //PROJ/254/192 1'); + handler.handleLine('mediatransport stop //PROJ/254/192 1'); + + expect(logger.info).toHaveBeenCalledTimes(2); + expect(logger.info.mock.calls[0][0]).toContain('cbus_raw_event_log_apps'); + expect(logger.info.mock.calls[0][0]).toContain('205'); + expect(logger.info.mock.calls[1][0]).toContain('192'); + }); +}); diff --git a/tests/cgateWebBridge.test.js b/tests/cgateWebBridge.test.js index dc09bb55..5879fda8 100644 --- a/tests/cgateWebBridge.test.js +++ b/tests/cgateWebBridge.test.js @@ -1009,6 +1009,41 @@ describe('CgateWebBridge', () => { publishEventSpy.mockRestore(); }); + describe.each([ + ['audio', 'audio current_feed //PROJ/254/205 1 2 4 100 #sourceunit=9 OID='], + ['audio (channel-prefixed)', '#s# audio mute //PROJ/254/205 1 2 7 #sourceunit=9 OID='], + ['media transport', 'mediatransport play //PROJ/254/192 3 #sourceunit=9 OID='], + ])('%s lines', (_name, line) => { + it('are captured but not warn-parsed as standard events', () => { + const rawCaptureSpy = jest.spyOn(bridge, '_publishRawEventCapture'); + const warnSpy = jest.spyOn(bridge, 'warn'); + const publishEventSpy = jest.spyOn(bridge.eventPublisher, 'publishEvent'); + + bridge._processEventLine(line); + + expect(rawCaptureSpy).toHaveBeenCalledWith(line); + expect(publishEventSpy).not.toHaveBeenCalled(); + expect(warnSpy).not.toHaveBeenCalledWith(expect.stringContaining('Could not parse event line')); + + rawCaptureSpy.mockRestore(); + warnSpy.mockRestore(); + publishEventSpy.mockRestore(); + }); + + it('are published to the raw topic when the app is configured', () => { + bridge.settings.cbusRawEventLogApps = [205, 192]; + + bridge._processEventLine(line); + + const app = line.includes('mediatransport') ? '192' : '205'; + expect(publishSpy).toHaveBeenCalledWith( + `cbus/read/254/${app}/raw`, + expect.stringContaining(line.replace(/^#s# /, '')), + expect.anything() + ); + }); + }); + it('should ignore comment lines starting with #', () => { const publishEventSpy = jest.spyOn(bridge.eventPublisher, 'publishEvent'); From 535c15a4621401c18df323a869504fa0a8a72293 Mon Sep 17 00:00:00 2001 From: Doug Rathbone Date: Sat, 21 Nov 2026 08:00:06 +0000 Subject: [PATCH 3/4] docs: audio investigation notes and capture instructions Records what the C-Gate manual says about Audio and Media Transport, what is still unknown, and how a tester captures the traffic. Also notes that Home Assistant has no MQTT media_player platform, which shapes what the issue's "media players" request can become. Co-authored-by: Doug Rathbone --- docs/AUDIO_INVESTIGATION.md | 112 ++++++++++++++++++++++++++++++++++++ docs/SETTINGS.md | 2 +- homeassistant-addon/DOCS.md | 2 +- src/config/schema.js | 2 +- 4 files changed, 115 insertions(+), 3 deletions(-) create mode 100644 docs/AUDIO_INVESTIGATION.md diff --git a/docs/AUDIO_INVESTIGATION.md b/docs/AUDIO_INVESTIGATION.md new file mode 100644 index 00000000..5fc581c9 --- /dev/null +++ b/docs/AUDIO_INVESTIGATION.md @@ -0,0 +1,112 @@ +# C-Bus Audio (205) and Media Transport (192) — Investigation Notes + +Where cgateweb stands on the C-Bus **Audio** application (app `205`, `$CD`) and the +**Media Transport Control** application (app `192`, `$C0`), what is still unknown, and +how to capture the data needed to close the gap. Tracks +[issue #172](https://github.com/dougrathbone/cgateweb/issues/172). + +> **Status legend:** ✅ verified against real hardware · ⚠️ from the C-Gate manual only · +> ❓ unknown / not captured. + +## Current state + +Nothing is decoded. What the bridge does today: + +- Audio and Media Transport event lines are claimed by `src/audioEventHandler.js`, so they no + longer log "Could not parse event line" (their address has two segments, no group, which + `CBusEvent` cannot parse). +- Each line is passed to raw event capture. Set `cbus_raw_event_log_apps` to `[205, 192]` and + every line is logged verbatim and published to `cbus/read/{net}/{app}/raw`. +- The first line of each application also logs one INFO message saying how to capture. + +Nothing is published to Home Assistant and no audio command can be written. That is deliberate: +see "Why not guess" below. + +## What the C-Gate manual gives us (⚠️) + +Audio commands (sections 4.5.16–4.5.35), addressed `audio /205 …`: + +| Verb | Arguments | Meaning per manual | +|---|---|---| +| `current_feed` | `mux zone feed gain` | Reports the current feed (`feed` 0..7, `gain` 0..4) | +| `set_feed` | `mux zone feed option` | Sets the zone's feed | +| `next_feed` / `previous_feed` | `mux zone` | Step the feed | +| `request_current_feed` | `mux zone` | Ask for `current_feed` | +| `mute` | `mux zone mode` | `0` amp off, `2` volume normal/speakers off, `5` volume preset/speakers off, `7` volume preset/speakers on, `255` volume normal/speakers on | +| `on` / `off` | `mux zone code` | Send an on/off operation | +| `ramp` | `mux zone code level rate` | Ramp a zone function to `level` 0..255; `rate` 0..15 (0 instant, 1 = 4 s … 15 = 17 min) | +| `terminateramp` | `mux zone code` | Stop a ramp | + +`mux` is 0..2, `zone` 0..7. Every verb also has a `Z ` form where `function` (0..255) +replaces `mux zone`. Other verbs exist for labelling (`zone_descriptor_request`, +`zone_feed_label_request`), `high_priority`, `dynamic_1/2`, `next_language`, +`output_common_control`, `output_device_status_request` and `output_error_code`. + +Media Transport commands (sections 4.5.99–4.5.118) take `app group [operation]`, where `group` is +the media-link group: `play`, `pause`, `stop`, `next_track`, `set_track`, `forward`, `rewind`, +`shuffle`, `repeat`, `source_power`, `status_request`, `enumerate`, `set_category`, and friends. + +The manual's sample line for the event port shows the `#`-prefixed shape: +`# audio zone_feed_label_request //BOARD/254/205 1 2 #sourceunit=0 OID=…` + +## What we do not know (❓) + +These block a decoder. Each needs a real capture, or the audio protocol document +(*C-Bus Application Messages and Behaviour*, chapter 14, CBUS-APP/14), which is not in this +repository: + +1. **What zone function `code` means.** `ramp`/`on`/`off` take a `code` 0..7. Volume is the + obvious candidate, but the manual does not say. +2. **Feed to source name.** `feed` is 0..7; nothing maps a number to "Tuner" or "CD". Labels come + from `zone_feed_label_request` traffic or the C-Gate database, and we have not seen either. +3. **Whether `mute` mode 0 is the only "power off".** Mode 0 turns the amplifier off, but + whether the amp reports state changes on the bus, and as which verb, is unobserved. +4. **Event grammar.** Which verbs a real amp or matrix emits unprompted, whether they arrive as + `audio …` or `#s# audio …`, and what `#sourceunit` identifies. +5. **Media Transport group semantics.** Which `group` values real players use, and whether state + (playing, track number) is reported or only commanded. + +## Why not guess + +The HVAC work (see [HVAC_INVESTIGATION.md](./HVAC_INVESTIGATION.md)) showed what a plausible +but unverified decoder does: it publishes confident nonsense that looks right until someone +checks it against a real device. Unknown semantics here fail closed, as in +`src/applicationDecoders/clockDecoder.js`. + +## Home Assistant mapping constraint + +Home Assistant's MQTT integration has **no `media_player` discovery platform**. The issue asks for +media players, which cannot be created through MQTT Discovery. What MQTT Discovery does support, +and what an audio zone maps onto once decoded: + +| Zone capability | HA entity | +|---|---| +| Amplifier power / mute mode | `switch`, or a `select` over the `mute` modes | +| Source (feed) | `select` | +| Volume | `number` | +| Transport (play, pause, next) | `button` | + +A true `media_player` would need a custom integration, which is out of scope for this bridge. +Whether to ship the entity set above is a decision for after the captures are in. + +## How to capture (for testers) + +1. Set `cbus_raw_event_log_apps` to `[205, 192]` (add-on option or `settings.js`). +2. Restart the bridge and, with the C-Bus audio hardware idle, work through each action on a + real keypad, touchscreen or the manufacturer's app: change source, change volume (note the + direction and rough amount), mute, unmute, power the zone off and on, and play, pause and skip + on any media-transport source. +3. Write down what you did next to each line. The log lines are the evidence; the notes tell us + what they mean. +4. Collect the `C-Gate raw capture [app 205]` / `[app 192]` log entries, or subscribe to `cbus/read/+/205/raw` and + `cbus/read/+/192/raw`. Keypad PINs are redacted, but check before sharing. +5. If you can, attach the C-Gate project's audio zone and feed labels as well. + +## Plan + +1. **Capture** (this change): claim the lines, make them capturable. +2. **Decode** once captures confirm the grammar: `audioDecoder.js` under + `src/applicationDecoders/` with fixtures taken verbatim from real captures, published as + read-only state. +3. **Discover** the entity set above, read-only first. +4. **Control**: command writes on `cbus/write/...`, only for operations confirmed on hardware. diff --git a/docs/SETTINGS.md b/docs/SETTINGS.md index c8484fea..baa012c4 100644 --- a/docs/SETTINGS.md +++ b/docs/SETTINGS.md @@ -390,7 +390,7 @@ The add-on does this for you: its service script exports `LOG_LEVEL` from the `l | Setting | Add-on option | Type | Default | Notes | |---|---|---|---|---| -| `cbusRawEventLogApps` | `cbus_raw_event_log_apps` | number[] | `[]` | Applications whose raw C-Gate event lines are logged verbatim and republished to `cbus/read/{net}/{app}/{group}/raw`. For capturing ground-truth protocol samples before writing a decoder (e.g. `[172]`). Empty disables. Leave empty in normal operation — it is noisy. | +| `cbusRawEventLogApps` | `cbus_raw_event_log_apps` | number[] | `[]` | Applications whose raw C-Gate event lines are logged verbatim and republished to `cbus/read/{net}/{app}/{group}/raw` (`cbus/read/{net}/{app}/raw` for applications with no group address: Audio 205, Media Transport 192, Clock 223). For capturing ground-truth protocol samples before writing a decoder (e.g. `[172]`, or `[205, 192]` for audio). Empty disables. Leave empty in normal operation — it is noisy. | --- diff --git a/homeassistant-addon/DOCS.md b/homeassistant-addon/DOCS.md index 24929783..855251f8 100644 --- a/homeassistant-addon/DOCS.md +++ b/homeassistant-addon/DOCS.md @@ -410,7 +410,7 @@ Disable auto-discovery (`auto_discover_networks: false`) if: | `cbus_clock_enabled` | boolean | `false` | Decode C-Bus Clock and Timekeeping (app 223) broadcasts as two diagnostic sensors on the network device, and ask C-Gate for a clock refresh on connect. Read-only: this never sets the network clock. Off by default. | | `cbus_scene_module_enabled` | boolean | `false` | Accept MQTT `cbus/write/{network}/{app}/{set}/play` and `/record` (payload is the scene number) for a C-Bus Scene Module. Off by default: most installs use Trigger Control scenes, and a record write overwrites module memory. | | `cbus_enable_control_app_id` | integer | (null) | C-Bus Enable Control application id (typically `203`) for extra MQTT writes: `cbus/write/{network}/{app}/{group}/set` (native 0–255, or ON/OFF), `/label` (group name, hex-encoded), and `/remove` (payload ON; deletes the C-Gate group object). Leave empty to disable. No Home Assistant entities. ON/OFF/RAMP on that application still work without this. | -| `cbus_raw_event_log_apps` | list | `[]` | C-Bus application IDs whose raw C-Gate event lines are logged and republished to `cbus/read/{network}/{app}/{group}/raw` for protocol capture. Empty disables. Noisy; leave empty in normal use. | +| `cbus_raw_event_log_apps` | list | `[]` | C-Bus application IDs whose raw C-Gate event lines are logged and republished to `cbus/read/{network}/{app}/{group}/raw` (`cbus/read/{network}/{app}/raw` for apps with no group, such as Audio 205 and Media Transport 192) for protocol capture. Empty disables. Noisy; leave empty in normal use. | | `ha_bridge_diagnostics_enabled` | boolean | `true` | Publish bridge health/diagnostic entities to Home Assistant via MQTT Discovery | | `ha_bridge_diagnostics_interval_sec` | integer | `60` | How often to refresh bridge diagnostic states (seconds) | diff --git a/src/config/schema.js b/src/config/schema.js index 20a9e74a..fc2a62c5 100644 --- a/src/config/schema.js +++ b/src/config/schema.js @@ -1574,7 +1574,7 @@ const SETTINGS_SCHEMA = { default: [], unit: 'none', exposure: 'both', - description: 'Apps whose raw C-Gate event lines should be logged verbatim (and published to cbus/read/{net}/{app}/{group}/raw) for protocol capture. Empty = off. Noisy; leave empty in normal operation.', + description: 'Apps whose raw C-Gate event lines should be logged verbatim (and published to cbus/read/{net}/{app}/{group}/raw, or cbus/read/{net}/{app}/raw for apps with no group such as Audio 205 and Media Transport 192) for protocol capture. Empty = off. Noisy; leave empty in normal operation.', aliases: ['cbus_raw_event_log_apps'] } }; From a3dfb0abbd9ca2056d4bdf52d3399eb11a5de81f Mon Sep 17 00:00:00 2001 From: Doug Rathbone Date: Sat, 21 Nov 2026 08:27:36 +0000 Subject: [PATCH 4/4] chore: release v1.40.6 Audio and Media Transport lines are captured instead of rejected as unreadable, so a tester can record real traffic for the decoder. Co-authored-by: Doug Rathbone --- homeassistant-addon/CHANGELOG.md | 6 ++++++ homeassistant-addon/config.yaml | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/homeassistant-addon/CHANGELOG.md b/homeassistant-addon/CHANGELOG.md index 952a5567..5fd360f8 100644 --- a/homeassistant-addon/CHANGELOG.md +++ b/homeassistant-addon/CHANGELOG.md @@ -11,6 +11,12 @@ If this add-on saves you time, you can [buy me a coffee](https://buymeacoffee.co Releases before 1.22.0 are in the [changelog archive](https://github.com/dougrathbone/cgateweb/blob/master/homeassistant-addon/CHANGELOG-archive.md). +## [1.40.6](https://github.com/dougrathbone/cgateweb/releases/tag/v1.40.6) - 2026-11-21 + +### Added + +- **Audio and Media Transport lines are now captured instead of reported as unreadable.** Set raw event logging to include applications 205 and 192 and share what your hardware sends. ([#172](https://github.com/dougrathbone/cgateweb/issues/172)) + ## [1.40.5](https://github.com/dougrathbone/cgateweb/releases/tag/v1.40.5) - 2026-11-21 ### Fixed diff --git a/homeassistant-addon/config.yaml b/homeassistant-addon/config.yaml index 2d866b72..9196a356 100644 --- a/homeassistant-addon/config.yaml +++ b/homeassistant-addon/config.yaml @@ -1,5 +1,5 @@ name: "C-Gate Web Bridge" -version: "1.40.5" +version: "1.40.6" slug: cgateweb description: "Bridge between Clipsal C-Bus systems and MQTT/Home Assistant" url: "https://github.com/dougrathbone/cgateweb" diff --git a/package-lock.json b/package-lock.json index 71b71fdf..48ff2cdf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cgateweb", - "version": "1.40.5", + "version": "1.40.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cgateweb", - "version": "1.40.5", + "version": "1.40.6", "license": "MIT", "dependencies": { "adm-zip": "^0.6.1", diff --git a/package.json b/package.json index ae2f7915..7a661b13 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cgateweb", - "version": "1.40.5", + "version": "1.40.6", "description": "Node.js bridge connecting Clipsal C-Bus automation systems to MQTT for Home Assistant integration", "keywords": [ "cbus",