homebridge-valor-fireplace 2.0.4 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/dist/controllers/fireplaceController.d.ts +60 -0
- package/dist/controllers/fireplaceController.d.ts.map +1 -1
- package/dist/controllers/fireplaceController.js +162 -3
- package/dist/controllers/fireplaceController.js.map +1 -1
- package/dist/controllers/ignitionTracker.d.ts +82 -0
- package/dist/controllers/ignitionTracker.d.ts.map +1 -0
- package/dist/controllers/ignitionTracker.js +163 -0
- package/dist/controllers/ignitionTracker.js.map +1 -0
- package/dist/models/fireplaceStatus.d.ts +40 -0
- package/dist/models/fireplaceStatus.d.ts.map +1 -1
- package/dist/models/fireplaceStatus.js +56 -2
- package/dist/models/fireplaceStatus.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.1.0] - 2026-05-17
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- **Ignition lockout circuit breaker with auto-retry.** When `igniteFireplace()` runs, it now sends the Ignite command and observes the receiver's own ignition cycle to completion. Three outcome classes are distinguished:
|
|
7
|
+
- **success**: `guardFlameOn` confirmed → exit, clear failure history.
|
|
8
|
+
- **soft-fail**: `igniting` cleared back to 0 but no flame caught (cold pilot, air in line — common cold-start case) → retry after delay.
|
|
9
|
+
- **hard-fail**: `igniting` bit stuck past timeout → Mertik GV60 safety lockout → stop the sequence, require manual reset (paperclip, cycle gas, or service).
|
|
10
|
+
|
|
11
|
+
Default: 4 attempts, 90s timeout per attempt, 3 min between retries. Each attempt logs as `[ignite] Attempt N of M` with explicit outcomes — makes postmortem of "did the fireplace try and fail?" trivial. Off requests mid-sequence abort the loop cleanly.
|
|
12
|
+
- **Persistent ignition history** at `<storagePath>/valor-ignition-history.json` via new `IgnitionTracker` class. Records every attempt with timestamps, outcomes, durations, and final status bits. Survives plugin restarts and homebridge log rotations — the previous all-in-memory state lost every diagnostic the moment the log rotated.
|
|
13
|
+
- **Six newly-decoded status packet fields** on `FireplaceStatus`, in parity with `valor-fireplace-cli` 1.1.0:
|
|
14
|
+
- `burnerOutput` (chars 14-15) — current burner output 0-255, continuous.
|
|
15
|
+
- `lightBrightness` (chars 20-21) — decorative light dimmer setpoint 0-255 (persists across off).
|
|
16
|
+
- `fanSpeed` (chars 22-23) — circulating fan speed 0-4.
|
|
17
|
+
- `scheduleActive` (status bit 9) — schedule/timer overlay flag.
|
|
18
|
+
- `lightOn` (status bit 13) — decorative light power.
|
|
19
|
+
- `statusBitsHex` — raw 4-char hex of the status bit field.
|
|
20
|
+
- **Derived signals** on `FireplaceStatus`:
|
|
21
|
+
- `lockoutSuspected` — heuristic candidate for hard lockout.
|
|
22
|
+
- `pilotOnly` — `guardFlameOn && burnerOutput === 0`.
|
|
23
|
+
- **`isLockoutActive()` on `IFireplaceController`.** Public method exposing whether the controller is in a confirmed hard-lockout state, for future code wiring up a HomeKit `StatusFault` characteristic.
|
|
24
|
+
- **`'lockout'` event** emitted on the controller for fault-state subscribers. Fires `true` when a hard lockout is detected, `false` when it clears.
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
- **Lockout state gates non-Off commands** but lets shutdowns through. When a hard lockout is in effect from a prior session, `request()` blocks ignite/mode/temp requests with a clear warning. An Off request is always allowed (does no harm, may help reconcile state).
|
|
28
|
+
- **`processStatusResponse`** no longer auto-shuts-off during the `lostConnection` recovery path while a hard lockout is active — the gas is already off and the receiver is in fault state, so a shutdown command would just generate log noise.
|
|
29
|
+
|
|
3
30
|
## [2.0.1] - 2026-01-11
|
|
4
31
|
|
|
5
32
|
### Fixed
|
|
@@ -11,10 +11,17 @@ export interface IFireplaceController extends EventEmitter {
|
|
|
11
11
|
getFlameHeight(): FlameHeight;
|
|
12
12
|
reachable(): boolean;
|
|
13
13
|
setTemperature(temperature: number): void;
|
|
14
|
+
/**
|
|
15
|
+
* True when a confirmed Mertik GV60 hard-lockout state is in effect
|
|
16
|
+
* (last terminated attempt was a hard-fail with no subsequent success).
|
|
17
|
+
* Future code can wire this to a HomeKit `StatusFault` characteristic.
|
|
18
|
+
*/
|
|
19
|
+
isLockoutActive(): boolean;
|
|
14
20
|
}
|
|
15
21
|
export interface IFireplaceEvents {
|
|
16
22
|
on(event: 'status', listener: (status: FireplaceStatus) => void): this;
|
|
17
23
|
on(event: 'reachable', listener: (reachable: boolean) => void): this;
|
|
24
|
+
on(event: 'lockout', listener: (active: boolean) => void): this;
|
|
18
25
|
}
|
|
19
26
|
export declare class FireplaceController extends EventEmitter implements IFireplaceController, IFireplaceEvents {
|
|
20
27
|
readonly log: Logger;
|
|
@@ -29,15 +36,68 @@ export declare class FireplaceController extends EventEmitter implements IFirepl
|
|
|
29
36
|
private igniting;
|
|
30
37
|
private shuttingDown;
|
|
31
38
|
private lostConnection;
|
|
39
|
+
/**
|
|
40
|
+
* Set when a user request (typically Off) wants to interrupt the auto-retry
|
|
41
|
+
* loop. The loop polls this between attempts and bails out gracefully.
|
|
42
|
+
*/
|
|
43
|
+
private ignitionAbortRequested;
|
|
44
|
+
/**
|
|
45
|
+
* Tracks attempt outcomes and persists history across plugin restarts.
|
|
46
|
+
* Provides the `consecutiveFailures` / `hasRecentHardLockout` signals
|
|
47
|
+
* used by the circuit breaker below.
|
|
48
|
+
*/
|
|
49
|
+
private readonly ignitionTracker;
|
|
32
50
|
private static UNREACHABLE_TIMEOUT;
|
|
33
51
|
private static REFRESH_TIMEOUT;
|
|
34
52
|
private static STATUS_PACKET_LENGTH;
|
|
53
|
+
/**
|
|
54
|
+
* How often we poll status while waiting for an Ignite to resolve.
|
|
55
|
+
* Tighter than the normal 15s subscription because we want to catch
|
|
56
|
+
* the igniting=1 → 0 transition quickly.
|
|
57
|
+
*/
|
|
58
|
+
private static IGNITE_POLL_INTERVAL_MS;
|
|
35
59
|
constructor(log: Logger, accessory: PlatformAccessory, platform?: ValorPlatform | undefined);
|
|
36
60
|
private startStatusSubscription;
|
|
37
61
|
private stopStatusSubscription;
|
|
38
62
|
private refreshStatus;
|
|
39
63
|
private processStatusResponse;
|
|
64
|
+
/**
|
|
65
|
+
* True when the most recent terminated attempt was a hard lockout
|
|
66
|
+
* (igniting bit stuck past timeout). External callers (HomeKit fault
|
|
67
|
+
* surface, status reporting) can use this to render fault state.
|
|
68
|
+
*/
|
|
69
|
+
isLockoutActive(): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Ignite the fireplace, retrying up to `IgnitionTracker.MAX_ATTEMPTS`
|
|
72
|
+
* times. Each attempt sends the Ignite command, waits for the receiver's
|
|
73
|
+
* own ignition cycle to resolve, and either declares success
|
|
74
|
+
* (`guardFlameOn` confirmed), a soft failure (receiver cleanly gave up —
|
|
75
|
+
* `igniting` cleared but no flame), or a hard lockout (`igniting` bit
|
|
76
|
+
* stuck past `IGNITION_TIMEOUT_MS` — receiver is in safety fault and
|
|
77
|
+
* needs manual reset).
|
|
78
|
+
*
|
|
79
|
+
* Logs each attempt as `[ignite] Attempt N of M` so the failure pattern
|
|
80
|
+
* is visible in `homebridge.log` after the fact. Persists every outcome
|
|
81
|
+
* to `<storagePath>/valor-ignition-history.json` for postmortem use even
|
|
82
|
+
* if the homebridge log rotates.
|
|
83
|
+
*/
|
|
40
84
|
private igniteFireplace;
|
|
85
|
+
/**
|
|
86
|
+
* Poll status during an Ignite attempt and decide its outcome.
|
|
87
|
+
*
|
|
88
|
+
* Returns:
|
|
89
|
+
* - `'success'`: `guardFlameOn` came up — pilot caught.
|
|
90
|
+
* - `'soft-fail'`: `igniting` cleared back to 0 but no flame. Receiver
|
|
91
|
+
* gave up cleanly. Worth retrying.
|
|
92
|
+
* - `'hard-fail'`: `IGNITION_TIMEOUT_MS` elapsed with `igniting` still
|
|
93
|
+
* set. Receiver is locked out; only manual reset clears this.
|
|
94
|
+
*/
|
|
95
|
+
private waitForIgnitionOutcome;
|
|
96
|
+
/**
|
|
97
|
+
* Like `delay()` but bails out early if `ignitionAbortRequested` becomes
|
|
98
|
+
* true. Returns true if it was interrupted, false on normal completion.
|
|
99
|
+
*/
|
|
100
|
+
private delayWithAbort;
|
|
41
101
|
private standBy;
|
|
42
102
|
private guardFlameOff;
|
|
43
103
|
private setEcoMode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fireplaceController.d.ts","sourceRoot":"","sources":["../../src/controllers/fireplaceController.ts"],"names":[],"mappings":";AACA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAoB,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEvD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"fireplaceController.d.ts","sourceRoot":"","sources":["../../src/controllers/fireplaceController.ts"],"names":[],"mappings":";AACA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAoB,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEvD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C,MAAM,IAAI,eAAe,GAAG,SAAS,CAAC;IACtC,cAAc,IAAI,WAAW,CAAC;IAC9B,SAAS,IAAI,OAAO,CAAC;IACr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S,EAAE,iBAAiB,EAC5B,QAAQ,CAAC,2BAAe;IAS1C,OAAO,CAAC,uBAAuB;IAO/B,OAAO,CAAC,sBAAsB;IAQ9B,OAAO,CAAC,aAAa;IAmBrB,OAAO,CAAC,qBAAqB;IAa7B;;;;OAIG;IACI,eAAe,IAAI,OAAO;IAIjC;;;;;;;;;;;;;OAaG;YACW,eAAe;IAyE7B;;;;;;;;;OASG;YACW,sBAAsB;IA8BpC;;;OAGG;YACW,cAAc;YAUd,OAAO;YAOP,aAAa;IAW3B,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,YAAY;IAyBpB,OAAO,CAAC,WAAW;IAOnB,SAAS,IAAI,OAAO;IAMpB,MAAM,IAAI,eAAe,GAAG,SAAS;IAIrC,KAAK,gCAAiD;IAEtD,gBAAgB,IAAI,IAAI;IAKlB,cAAc,CAAC,WAAW,EAAE,MAAM;IAajC,cAAc,IAAI,WAAW;IAIvB,cAAc,CAAC,WAAW,EAAE,MAAM;YAsBjC,mBAAmB;IAO3B,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IAqClD,MAAM,CAAC,EAAE,EAAE,OAAO;IAKZ,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;CAgDnD"}
|
|
@@ -10,8 +10,10 @@ const fireplaceStatus_1 = require("../models/fireplaceStatus");
|
|
|
10
10
|
const operationMode_1 = require("../models/operationMode");
|
|
11
11
|
const flameHeight_1 = require("../models/flameHeight");
|
|
12
12
|
const temperatureRange_1 = require("../models/temperatureRange");
|
|
13
|
+
const ignitionTracker_1 = require("./ignitionTracker");
|
|
13
14
|
class FireplaceController extends events_1.default {
|
|
14
15
|
constructor(log, accessory, platform) {
|
|
16
|
+
var _a, _b, _c, _d;
|
|
15
17
|
super();
|
|
16
18
|
this.log = log;
|
|
17
19
|
this.accessory = accessory;
|
|
@@ -22,8 +24,15 @@ class FireplaceController extends events_1.default {
|
|
|
22
24
|
this.igniting = false;
|
|
23
25
|
this.shuttingDown = false;
|
|
24
26
|
this.lostConnection = false;
|
|
27
|
+
/**
|
|
28
|
+
* Set when a user request (typically Off) wants to interrupt the auto-retry
|
|
29
|
+
* loop. The loop polls this between attempts and bails out gracefully.
|
|
30
|
+
*/
|
|
31
|
+
this.ignitionAbortRequested = false;
|
|
25
32
|
this.delay = ms => new Promise(res => setTimeout(res, ms));
|
|
26
33
|
this.config = this.accessory.context.device;
|
|
34
|
+
const storagePath = (_d = (_c = (_b = (_a = this.platform) === null || _a === void 0 ? void 0 : _a.api) === null || _b === void 0 ? void 0 : _b.user) === null || _c === void 0 ? void 0 : _c.storagePath) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
35
|
+
this.ignitionTracker = new ignitionTracker_1.IgnitionTracker(this.log, storagePath);
|
|
27
36
|
this.startStatusSubscription();
|
|
28
37
|
}
|
|
29
38
|
startStatusSubscription() {
|
|
@@ -68,15 +77,145 @@ class FireplaceController extends events_1.default {
|
|
|
68
77
|
this.guardFlameOff();
|
|
69
78
|
}
|
|
70
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* True when the most recent terminated attempt was a hard lockout
|
|
82
|
+
* (igniting bit stuck past timeout). External callers (HomeKit fault
|
|
83
|
+
* surface, status reporting) can use this to render fault state.
|
|
84
|
+
*/
|
|
85
|
+
isLockoutActive() {
|
|
86
|
+
return this.ignitionTracker.hasRecentHardLockout();
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Ignite the fireplace, retrying up to `IgnitionTracker.MAX_ATTEMPTS`
|
|
90
|
+
* times. Each attempt sends the Ignite command, waits for the receiver's
|
|
91
|
+
* own ignition cycle to resolve, and either declares success
|
|
92
|
+
* (`guardFlameOn` confirmed), a soft failure (receiver cleanly gave up —
|
|
93
|
+
* `igniting` cleared but no flame), or a hard lockout (`igniting` bit
|
|
94
|
+
* stuck past `IGNITION_TIMEOUT_MS` — receiver is in safety fault and
|
|
95
|
+
* needs manual reset).
|
|
96
|
+
*
|
|
97
|
+
* Logs each attempt as `[ignite] Attempt N of M` so the failure pattern
|
|
98
|
+
* is visible in `homebridge.log` after the fact. Persists every outcome
|
|
99
|
+
* to `<storagePath>/valor-ignition-history.json` for postmortem use even
|
|
100
|
+
* if the homebridge log rotates.
|
|
101
|
+
*/
|
|
71
102
|
async igniteFireplace() {
|
|
103
|
+
var _a, _b;
|
|
72
104
|
if (this.igniting) {
|
|
73
105
|
this.log.debug('Ignore already igniting!');
|
|
74
106
|
return;
|
|
75
107
|
}
|
|
108
|
+
if (this.ignitionTracker.hasRecentHardLockout()) {
|
|
109
|
+
this.log.error('[ignite] Refusing to attempt — prior session ended in hard lockout. ' +
|
|
110
|
+
'Manual intervention required (cycle gas at the wall, paperclip-reset the WiFi module, ' +
|
|
111
|
+
'or retry ignition from the handheld). Restart homebridge after recovery to clear this state.');
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
this.ignitionAbortRequested = false;
|
|
76
115
|
this.igniting = true;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
116
|
+
const max = ignitionTracker_1.IgnitionTracker.MAX_ATTEMPTS;
|
|
117
|
+
try {
|
|
118
|
+
for (let attempt = 1; attempt <= max; attempt++) {
|
|
119
|
+
if (this.ignitionAbortRequested) {
|
|
120
|
+
this.log.info(`[ignite] Attempt sequence aborted by user request before attempt ${attempt} of ${max}`);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
this.log.info(`[ignite] Attempt ${attempt} of ${max}: sending Ignite command`);
|
|
124
|
+
const record = this.ignitionTracker.recordAttemptStart(attempt, max, 'auto-retry');
|
|
125
|
+
const startedAt = Date.now();
|
|
126
|
+
this.sendCommand('314103');
|
|
127
|
+
const outcome = await this.waitForIgnitionOutcome(attempt, max);
|
|
128
|
+
const elapsedMs = Date.now() - startedAt;
|
|
129
|
+
const bits = (_b = (_a = this.lastStatus) === null || _a === void 0 ? void 0 : _a.statusBitsHex) !== null && _b !== void 0 ? _b : '????';
|
|
130
|
+
if (outcome === 'success') {
|
|
131
|
+
this.ignitionTracker.recordSuccess(elapsedMs, bits);
|
|
132
|
+
this.log.info(`[ignite] Attempt ${attempt} of ${max}: ✓ success after ${Math.round(elapsedMs / 1000)}s ` +
|
|
133
|
+
`(attempt id=${record.id}, bits=0x${bits})`);
|
|
134
|
+
this.emit('lockout', false);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (outcome === 'soft-fail') {
|
|
138
|
+
this.ignitionTracker.recordSoftFailure(elapsedMs, bits);
|
|
139
|
+
this.log.warn(`[ignite] Attempt ${attempt} of ${max}: ✗ soft-fail after ${Math.round(elapsedMs / 1000)}s — ` +
|
|
140
|
+
`receiver gave up cleanly (bits=0x${bits}). Common on cold starts.`);
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
this.ignitionTracker.recordHardLockout(elapsedMs, bits);
|
|
144
|
+
this.log.error(`[ignite] Attempt ${attempt} of ${max}: ✗ HARD LOCKOUT — igniting bit stuck after ` +
|
|
145
|
+
`${Math.round(elapsedMs / 1000)}s (bits=0x${bits}). Stopping retry sequence; manual reset required.`);
|
|
146
|
+
this.emit('lockout', true);
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
if (attempt < max) {
|
|
150
|
+
const delaySec = Math.round(ignitionTracker_1.IgnitionTracker.RETRY_DELAY_MS / 1000);
|
|
151
|
+
this.log.info(`[ignite] Waiting ${delaySec}s before attempt ${attempt + 1} of ${max}`);
|
|
152
|
+
const aborted = await this.delayWithAbort(ignitionTracker_1.IgnitionTracker.RETRY_DELAY_MS);
|
|
153
|
+
if (aborted) {
|
|
154
|
+
this.log.info('[ignite] Retry wait interrupted by user request — aborting sequence');
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
this.log.error(`[ignite] All ${max} attempts failed (no hard lockout but pilot never caught). ` +
|
|
160
|
+
'Likely needs manual intervention: check gas pressure, pilot orifice, thermopile, or spark electrode.');
|
|
161
|
+
this.emit('lockout', true);
|
|
162
|
+
}
|
|
163
|
+
finally {
|
|
164
|
+
this.igniting = false;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Poll status during an Ignite attempt and decide its outcome.
|
|
169
|
+
*
|
|
170
|
+
* Returns:
|
|
171
|
+
* - `'success'`: `guardFlameOn` came up — pilot caught.
|
|
172
|
+
* - `'soft-fail'`: `igniting` cleared back to 0 but no flame. Receiver
|
|
173
|
+
* gave up cleanly. Worth retrying.
|
|
174
|
+
* - `'hard-fail'`: `IGNITION_TIMEOUT_MS` elapsed with `igniting` still
|
|
175
|
+
* set. Receiver is locked out; only manual reset clears this.
|
|
176
|
+
*/
|
|
177
|
+
async waitForIgnitionOutcome(attempt, max) {
|
|
178
|
+
const start = Date.now();
|
|
179
|
+
const timeoutMs = ignitionTracker_1.IgnitionTracker.IGNITION_TIMEOUT_MS;
|
|
180
|
+
while (Date.now() - start < timeoutMs) {
|
|
181
|
+
await this.delay(FireplaceController.IGNITE_POLL_INTERVAL_MS);
|
|
182
|
+
// Request a fresh status reading — the regular subscription is paused
|
|
183
|
+
// during a request() flow and we need timely data here.
|
|
184
|
+
try {
|
|
185
|
+
this.sendCommand('303303');
|
|
186
|
+
}
|
|
187
|
+
catch (_a) {
|
|
188
|
+
this.log.debug('[ignite] Status request during ignite wait failed (will retry)');
|
|
189
|
+
}
|
|
190
|
+
await this.delay(500);
|
|
191
|
+
const s = this.lastStatus;
|
|
192
|
+
if (!s)
|
|
193
|
+
continue;
|
|
194
|
+
if (s.guardFlameOn) {
|
|
195
|
+
return 'success';
|
|
196
|
+
}
|
|
197
|
+
if (!s.igniting) {
|
|
198
|
+
// Receiver cleared the igniting bit but never confirmed flame.
|
|
199
|
+
// Classic soft failure — the most common cold-start outcome.
|
|
200
|
+
return 'soft-fail';
|
|
201
|
+
}
|
|
202
|
+
this.log.debug(`[ignite] Attempt ${attempt}/${max}: still igniting at ${Math.round((Date.now() - start) / 1000)}s (bits=0x${s.statusBitsHex})`);
|
|
203
|
+
}
|
|
204
|
+
return 'hard-fail';
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Like `delay()` but bails out early if `ignitionAbortRequested` becomes
|
|
208
|
+
* true. Returns true if it was interrupted, false on normal completion.
|
|
209
|
+
*/
|
|
210
|
+
async delayWithAbort(ms) {
|
|
211
|
+
const step = 1000;
|
|
212
|
+
const end = Date.now() + ms;
|
|
213
|
+
while (Date.now() < end) {
|
|
214
|
+
if (this.ignitionAbortRequested)
|
|
215
|
+
return true;
|
|
216
|
+
await this.delay(Math.min(step, end - Date.now()));
|
|
217
|
+
}
|
|
218
|
+
return false;
|
|
80
219
|
}
|
|
81
220
|
async standBy() {
|
|
82
221
|
this.log.info('Standby');
|
|
@@ -229,6 +368,20 @@ class FireplaceController extends events_1.default {
|
|
|
229
368
|
}
|
|
230
369
|
async request(request) {
|
|
231
370
|
var _a, _b, _c, _d;
|
|
371
|
+
// If the auto-retry ignition loop is active, an Off request should
|
|
372
|
+
// abort the sequence rather than queueing behind it.
|
|
373
|
+
if (this.igniting && request.mode === operationMode_1.OperationMode.Off) {
|
|
374
|
+
this.log.info('Off requested while ignition retry sequence is in progress — aborting retries');
|
|
375
|
+
this.ignitionAbortRequested = true;
|
|
376
|
+
}
|
|
377
|
+
// If a prior session ended in a hard lockout, block everything except
|
|
378
|
+
// an explicit Off (which can't hurt and may help reconcile state).
|
|
379
|
+
if (this.ignitionTracker.hasRecentHardLockout() && request.mode !== operationMode_1.OperationMode.Off) {
|
|
380
|
+
this.log.warn('Ignoring request — fireplace is in Mertik GV60 hard-lockout state. ' +
|
|
381
|
+
'Physical intervention required to clear (cycle gas at the wall, paperclip-reset the WiFi module, ' +
|
|
382
|
+
'or retry ignition from the handheld). Restart homebridge after recovery.');
|
|
383
|
+
return false;
|
|
384
|
+
}
|
|
232
385
|
let succeeds = true;
|
|
233
386
|
const currentMode = ((_a = this.lastStatus) === null || _a === void 0 ? void 0 : _a.mode) || operationMode_1.OperationMode.Off;
|
|
234
387
|
this.stopStatusSubscription();
|
|
@@ -269,4 +422,10 @@ exports.FireplaceController = FireplaceController;
|
|
|
269
422
|
FireplaceController.UNREACHABLE_TIMEOUT = 1000 * 60 * 5; //5 min
|
|
270
423
|
FireplaceController.REFRESH_TIMEOUT = 1000 * 15; //15 seconds
|
|
271
424
|
FireplaceController.STATUS_PACKET_LENGTH = 106; //characters
|
|
425
|
+
/**
|
|
426
|
+
* How often we poll status while waiting for an Ignite to resolve.
|
|
427
|
+
* Tighter than the normal 15s subscription because we want to catch
|
|
428
|
+
* the igniting=1 → 0 transition quickly.
|
|
429
|
+
*/
|
|
430
|
+
FireplaceController.IGNITE_POLL_INTERVAL_MS = 5000;
|
|
272
431
|
//# sourceMappingURL=fireplaceController.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fireplaceController.js","sourceRoot":"","sources":["../../src/controllers/fireplaceController.ts"],"names":[],"mappings":";;;;;;AACA,oDAAkC;AAClC,8CAAkC;AAClC,+DAA4D;AAC5D,2DAA4E;AAC5E,uDAAsE;AAEtE,iEAAmE;AAiBnE,MAAa,mBAAoB,SAAQ,gBAAY;IAcnD,YACkB,GAAW,EACX,SAA4B,EAC5B,QAAwB;QAExC,KAAK,EAAE,CAAC;QAJQ,QAAG,GAAH,GAAG,CAAQ;QACX,cAAS,GAAT,SAAS,CAAmB;QAC5B,aAAQ,GAAR,QAAQ,CAAgB;QAflC,WAAM,GAAG,yBAAW,CAAC,MAAM,CAAC;QAE5B,WAAM,GAAkB,IAAI,CAAC;QAC7B,gBAAW,GAAS,IAAI,IAAI,EAAE,CAAC;QAE/B,aAAQ,GAAG,KAAK,CAAC;QACjB,iBAAY,GAAG,KAAK,CAAC;QACrB,mBAAc,GAAG,KAAK,CAAC;QAiJ/B,UAAK,GAAG,EAAE,CAA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C,IAAI,KAAK,6BAAa,CAAC,GAAG;mBAC3E,CAAA,MAAA,IAAI,CAAC,UAAU,0CAAE,IAAI,MAAK,6BAAa,CAAC,MAAM,IAAI,CAAA,MAAA,IAAI,CAAC,UAAU,0CAAE,IAAI,MAAK,6BAAa,CAAC,GAAG,CAAC,EAAE;YACrG,IAAI,OAAO,CAAC,WAAW,IAAI,GAAG,EAAE;gBAC9B,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;aACtB;iBAAM;gBACL,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;aAChD;SACF;QACD,MAAM,IAAI,CAAC,KAAK,CAAC,IAAK,CAAC,CAAC;QACxB,IAAI,CAAC,CAAC,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,WAAW,GAAG,GAAG,CAAC,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS,EAAE;YACtF,MAAM,IAAI,CAAC,KAAK,CAAC,IAAK,CAAC,CAAC;YACxB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAC3B,MAAM,IAAI,CAAC,KAAK,CAAC,IAAK,CAAC,CAAC;SACzB;QACD,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAC/B,OAAO,QAAQ,CAAC;IAClB,CAAC;;AAtcH,kDAucC;AAlbgB,uCAAmB,GAAG,IAAI,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO;AAC5C,mCAAe,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC,YAAY;AACzC,wCAAoB,GAAG,GAAG,CAAC,CAAC,YAAY;AACvD;;;;GAIG;AACY,2CAAuB,GAAG,IAAK,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Logger } from 'homebridge';
|
|
2
|
+
/**
|
|
3
|
+
* Tracks ignition attempts and persists their outcomes to disk.
|
|
4
|
+
*
|
|
5
|
+
* **Why this exists.** The Mertik GV60 receiver has its own internal
|
|
6
|
+
* ignition logic: when we send the Ignite command (`314103`), it opens
|
|
7
|
+
* the gas valve, sparks repeatedly for ~30-60s, and then either:
|
|
8
|
+
*
|
|
9
|
+
* - **Success**: the thermopile confirms flame, `guardFlameOn` goes true,
|
|
10
|
+
* `igniting` clears to 0.
|
|
11
|
+
* - **Soft failure**: the receiver gives up cleanly. `igniting` clears
|
|
12
|
+
* back to 0 but `guardFlameOn` stays 0. This is the common cold-start
|
|
13
|
+
* case — air in the pilot tube, cold thermopile, marginal gas pressure.
|
|
14
|
+
* Resolves on the next attempt 80% of the time.
|
|
15
|
+
* - **Hard lockout**: the `igniting` bit stays stuck at 1 indefinitely.
|
|
16
|
+
* This is the safety-lockout state — the receiver tripped its fault
|
|
17
|
+
* and only a paperclip reset or service visit clears it.
|
|
18
|
+
*
|
|
19
|
+
* This tracker doesn't drive retries directly; the controller's
|
|
20
|
+
* `igniteFireplace()` does that with explicit `Attempt N of M` logging.
|
|
21
|
+
* The tracker's job is to record each attempt's outcome, persist the
|
|
22
|
+
* history under the homebridge `storagePath` so it survives plugin
|
|
23
|
+
* restarts and log rotations, and expose the consecutive-failure count
|
|
24
|
+
* to the controller's circuit breaker.
|
|
25
|
+
*
|
|
26
|
+
* Persistence file: `<storagePath>/valor-ignition-history.json`. The
|
|
27
|
+
* previous all-in-memory approach lost every diagnostic the moment
|
|
28
|
+
* homebridge rotated its log.
|
|
29
|
+
*/
|
|
30
|
+
export declare type AttemptOutcome = 'pending' | 'success' | 'soft-fail' | 'hard-fail';
|
|
31
|
+
export interface IgnitionAttempt {
|
|
32
|
+
id: number;
|
|
33
|
+
attemptInSequence: number;
|
|
34
|
+
maxInSequence: number;
|
|
35
|
+
startedAtIso: string;
|
|
36
|
+
finishedAtIso?: string;
|
|
37
|
+
outcome: AttemptOutcome;
|
|
38
|
+
durationMs?: number;
|
|
39
|
+
finalStatusBits?: string;
|
|
40
|
+
reason: string;
|
|
41
|
+
}
|
|
42
|
+
export declare class IgnitionTracker {
|
|
43
|
+
private readonly log;
|
|
44
|
+
/** Auto-retries this many times before giving up. */
|
|
45
|
+
static MAX_ATTEMPTS: number;
|
|
46
|
+
/** Wait this long for `guardFlameOn` or `igniting=0` after Ignite command. */
|
|
47
|
+
static IGNITION_TIMEOUT_MS: number;
|
|
48
|
+
/** Spacing between auto-retries to let the receiver / gas line settle. */
|
|
49
|
+
static RETRY_DELAY_MS: number;
|
|
50
|
+
/** Cap on history we keep persisted. */
|
|
51
|
+
static MAX_HISTORY: number;
|
|
52
|
+
private history;
|
|
53
|
+
private current;
|
|
54
|
+
private readonly filePath?;
|
|
55
|
+
constructor(log: Logger, storagePath?: string);
|
|
56
|
+
/**
|
|
57
|
+
* Caller is about to send the Ignite command for the n-th attempt in
|
|
58
|
+
* a retry sequence. Returns the attempt record so callers can reference
|
|
59
|
+
* its id in log lines.
|
|
60
|
+
*/
|
|
61
|
+
recordAttemptStart(attemptInSequence: number, maxInSequence: number, reason: string): IgnitionAttempt;
|
|
62
|
+
/** Caller observed a successful outcome (guardFlameOn = true). */
|
|
63
|
+
recordSuccess(durationMs: number, finalStatusBits: string): void;
|
|
64
|
+
/** Caller observed a soft failure (igniting cleared back to 0, no flame). */
|
|
65
|
+
recordSoftFailure(durationMs: number, finalStatusBits: string): void;
|
|
66
|
+
/** Caller observed a hard lockout (igniting bit stuck at 1 past timeout). */
|
|
67
|
+
recordHardLockout(durationMs: number, finalStatusBits: string): void;
|
|
68
|
+
/**
|
|
69
|
+
* Number of consecutive failures (any kind) since the last success.
|
|
70
|
+
* Used by the controller to short-circuit fresh ignite requests when
|
|
71
|
+
* we've already burned through MAX_ATTEMPTS.
|
|
72
|
+
*/
|
|
73
|
+
consecutiveFailures(): number;
|
|
74
|
+
/** True if the most recent terminated attempt was a hard lockout. */
|
|
75
|
+
hasRecentHardLockout(): boolean;
|
|
76
|
+
/** Read-only access for diagnostics or HomeKit fault surfacing. */
|
|
77
|
+
getHistory(): readonly IgnitionAttempt[];
|
|
78
|
+
private complete;
|
|
79
|
+
private load;
|
|
80
|
+
private persist;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=ignitionTracker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ignitionTracker.d.ts","sourceRoot":"","sources":["../../src/controllers/ignitionTracker.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,oBAAY,cAAc,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,WAAW,CAAC;AAE/E,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,cAAc,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,eAAe;IAexB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAdtB,qDAAqD;IACrD,MAAM,CAAC,YAAY,SAAK;IACxB,8EAA8E;IAC9E,MAAM,CAAC,mBAAmB,SAAa;IACvC,0EAA0E;IAC1E,MAAM,CAAC,cAAc,SAAiB;IACtC,wCAAwC;IACxC,MAAM,CAAC,WAAW,SAAO;IAEzB,OAAO,CAAC,OAAO,CAAyB;IACxC,OAAO,CAAC,OAAO,CAAgC;IAC/C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAS;gBAGhB,GAAG,EAAE,MAAM,EAC5B,WAAW,CAAC,EAAE,MAAM;IAUtB;;;;OAIG;IACH,kBAAkB,CAAC,iBAAiB,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,eAAe;IAarG,kEAAkE;IAClE,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,IAAI;IAIhE,6EAA6E;IAC7E,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,IAAI;IAIpE,6EAA6E;IAC7E,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,IAAI;IAIpE;;;;OAIG;IACH,mBAAmB,IAAI,MAAM;IAa7B,qEAAqE;IACrE,oBAAoB,IAAI,OAAO;IAa/B,mEAAmE;IACnE,UAAU,IAAI,SAAS,eAAe,EAAE;IAIxC,OAAO,CAAC,QAAQ;IAgBhB,OAAO,CAAC,IAAI;IAmBZ,OAAO,CAAC,OAAO;CAWhB"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.IgnitionTracker = void 0;
|
|
27
|
+
const fs = __importStar(require("fs"));
|
|
28
|
+
const path = __importStar(require("path"));
|
|
29
|
+
class IgnitionTracker {
|
|
30
|
+
constructor(log, storagePath) {
|
|
31
|
+
this.log = log;
|
|
32
|
+
this.history = [];
|
|
33
|
+
this.current = null;
|
|
34
|
+
if (storagePath) {
|
|
35
|
+
this.filePath = path.join(storagePath, 'valor-ignition-history.json');
|
|
36
|
+
this.load();
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
this.log.debug('IgnitionTracker: no storagePath provided, running in-memory only');
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Caller is about to send the Ignite command for the n-th attempt in
|
|
44
|
+
* a retry sequence. Returns the attempt record so callers can reference
|
|
45
|
+
* its id in log lines.
|
|
46
|
+
*/
|
|
47
|
+
recordAttemptStart(attemptInSequence, maxInSequence, reason) {
|
|
48
|
+
var _a, _b;
|
|
49
|
+
const id = ((_b = (_a = this.history[this.history.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : 0) + 1;
|
|
50
|
+
this.current = {
|
|
51
|
+
id,
|
|
52
|
+
attemptInSequence,
|
|
53
|
+
maxInSequence,
|
|
54
|
+
startedAtIso: new Date().toISOString(),
|
|
55
|
+
outcome: 'pending',
|
|
56
|
+
reason,
|
|
57
|
+
};
|
|
58
|
+
return this.current;
|
|
59
|
+
}
|
|
60
|
+
/** Caller observed a successful outcome (guardFlameOn = true). */
|
|
61
|
+
recordSuccess(durationMs, finalStatusBits) {
|
|
62
|
+
this.complete('success', durationMs, finalStatusBits);
|
|
63
|
+
}
|
|
64
|
+
/** Caller observed a soft failure (igniting cleared back to 0, no flame). */
|
|
65
|
+
recordSoftFailure(durationMs, finalStatusBits) {
|
|
66
|
+
this.complete('soft-fail', durationMs, finalStatusBits);
|
|
67
|
+
}
|
|
68
|
+
/** Caller observed a hard lockout (igniting bit stuck at 1 past timeout). */
|
|
69
|
+
recordHardLockout(durationMs, finalStatusBits) {
|
|
70
|
+
this.complete('hard-fail', durationMs, finalStatusBits);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Number of consecutive failures (any kind) since the last success.
|
|
74
|
+
* Used by the controller to short-circuit fresh ignite requests when
|
|
75
|
+
* we've already burned through MAX_ATTEMPTS.
|
|
76
|
+
*/
|
|
77
|
+
consecutiveFailures() {
|
|
78
|
+
let n = 0;
|
|
79
|
+
for (let i = this.history.length - 1; i >= 0; i--) {
|
|
80
|
+
const a = this.history[i];
|
|
81
|
+
if (a.outcome === 'soft-fail' || a.outcome === 'hard-fail') {
|
|
82
|
+
n++;
|
|
83
|
+
}
|
|
84
|
+
else if (a.outcome === 'success') {
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return n;
|
|
89
|
+
}
|
|
90
|
+
/** True if the most recent terminated attempt was a hard lockout. */
|
|
91
|
+
hasRecentHardLockout() {
|
|
92
|
+
for (let i = this.history.length - 1; i >= 0; i--) {
|
|
93
|
+
const a = this.history[i];
|
|
94
|
+
if (a.outcome === 'success') {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
if (a.outcome === 'hard-fail') {
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
/** Read-only access for diagnostics or HomeKit fault surfacing. */
|
|
104
|
+
getHistory() {
|
|
105
|
+
return this.history;
|
|
106
|
+
}
|
|
107
|
+
complete(outcome, durationMs, finalBits) {
|
|
108
|
+
if (!this.current) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
this.current.outcome = outcome;
|
|
112
|
+
this.current.finishedAtIso = new Date().toISOString();
|
|
113
|
+
this.current.durationMs = durationMs;
|
|
114
|
+
this.current.finalStatusBits = finalBits;
|
|
115
|
+
this.history.push(this.current);
|
|
116
|
+
if (this.history.length > IgnitionTracker.MAX_HISTORY) {
|
|
117
|
+
this.history = this.history.slice(-IgnitionTracker.MAX_HISTORY);
|
|
118
|
+
}
|
|
119
|
+
this.current = null;
|
|
120
|
+
this.persist();
|
|
121
|
+
}
|
|
122
|
+
load() {
|
|
123
|
+
if (!this.filePath) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
try {
|
|
127
|
+
if (fs.existsSync(this.filePath)) {
|
|
128
|
+
const raw = fs.readFileSync(this.filePath, 'utf-8');
|
|
129
|
+
const parsed = JSON.parse(raw);
|
|
130
|
+
if (Array.isArray(parsed.history)) {
|
|
131
|
+
this.history = parsed.history;
|
|
132
|
+
this.log.debug(`IgnitionTracker: loaded ${this.history.length} historical attempts from ${this.filePath}`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
catch (err) {
|
|
137
|
+
this.log.warn(`IgnitionTracker: failed to read history (${err.message}); starting fresh`);
|
|
138
|
+
this.history = [];
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
persist() {
|
|
142
|
+
if (!this.filePath) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
try {
|
|
146
|
+
const payload = JSON.stringify({ history: this.history }, null, 2);
|
|
147
|
+
fs.writeFileSync(this.filePath, payload);
|
|
148
|
+
}
|
|
149
|
+
catch (err) {
|
|
150
|
+
this.log.warn(`IgnitionTracker: failed to persist history (${err.message})`);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
exports.IgnitionTracker = IgnitionTracker;
|
|
155
|
+
/** Auto-retries this many times before giving up. */
|
|
156
|
+
IgnitionTracker.MAX_ATTEMPTS = 4;
|
|
157
|
+
/** Wait this long for `guardFlameOn` or `igniting=0` after Ignite command. */
|
|
158
|
+
IgnitionTracker.IGNITION_TIMEOUT_MS = 90 * 1000;
|
|
159
|
+
/** Spacing between auto-retries to let the receiver / gas line settle. */
|
|
160
|
+
IgnitionTracker.RETRY_DELAY_MS = 3 * 60 * 1000;
|
|
161
|
+
/** Cap on history we keep persisted. */
|
|
162
|
+
IgnitionTracker.MAX_HISTORY = 200;
|
|
163
|
+
//# sourceMappingURL=ignitionTracker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ignitionTracker.js","sourceRoot":"","sources":["../../src/controllers/ignitionTracker.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AA6C7B,MAAa,eAAe;IAc1B,YACmB,GAAW,EAC5B,WAAoB;QADH,QAAG,GAAH,GAAG,CAAQ;QALtB,YAAO,GAAsB,EAAE,CAAC;QAChC,YAAO,GAA2B,IAAI,CAAC;QAO7C,IAAI,WAAW,EAAE;YACf,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,6BAA6B,CAAC,CAAC;YACtE,IAAI,CAAC,IAAI,EAAE,CAAC;SACb;aAAM;YACL,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,kEAAkE,CAAC,CAAC;SACpF;IACH,CAAC;IAED;;;;OAIG;IACH,kBAAkB,CAAC,iBAAyB,EAAE,aAAqB,EAAE,MAAc;;QACjF,MAAM,EAAE,GAAG,CAAC,MAAA,MAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,0CAAE,EAAE,mCAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QAChE,IAAI,CAAC,OAAO,GAAG;YACb,EAAE;YACF,iBAAiB;YACjB,aAAa;YACb,YAAY,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACtC,OAAO,EAAE,SAAS;YAClB,MAAM;SACP,CAAC;QACF,OAAO,IAAI,C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C,OAAO,CAAC,EAAE;oBACjC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;oBAC9B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,2BAA2B,IAAI,CAAC,OAAO,CAAC,MAAM,6BAA6B,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;iBAC5G;aACF;SACF;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,4CAA6C,GAAa,CAAC,OAAO,mBAAmB,CAAC,CAAC;YACrG,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;SACnB;IACH,CAAC;IAEO,OAAO;QACb,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,OAAO;SACR;QACD,IAAI;YACF,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;YACnE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;SAC1C;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,+CAAgD,GAAa,CAAC,OAAO,GAAG,CAAC,CAAC;SACzF;IACH,CAAC;;AA7IH,0CA8IC;AA7IC,qDAAqD;AAC9C,4BAAY,GAAG,CAAC,CAAC;AACxB,8EAA8E;AACvE,mCAAmB,GAAG,EAAE,GAAG,IAAI,CAAC;AACvC,0EAA0E;AACnE,8BAAc,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AACtC,wCAAwC;AACjC,2BAAW,GAAG,GAAG,CAAC"}
|
|
@@ -7,6 +7,46 @@ export declare class FireplaceStatus {
|
|
|
7
7
|
readonly igniting: boolean;
|
|
8
8
|
readonly guardFlameOn: boolean;
|
|
9
9
|
readonly shuttingDown: boolean;
|
|
10
|
+
/** Raw 4-char hex of the status bit field (chars 16-19). Useful for diagnostics. */
|
|
11
|
+
readonly statusBitsHex: string;
|
|
12
|
+
/**
|
|
13
|
+
* Heuristic: a Mertik GV60 ignition lockout looks like `igniting` set with
|
|
14
|
+
* no `guardFlameOn` and no `shuttingDown`. The valve tried to light, the
|
|
15
|
+
* thermopile never confirmed flame, and the receiver killed the gas. The
|
|
16
|
+
* `igniting` bit stays set until a power-cycle or paperclip reset.
|
|
17
|
+
* Empirically observed at the cabin on 2026-05-16. See PROTOCOL.md in the
|
|
18
|
+
* `valor-fireplace-cli` repo for the full empirical decode.
|
|
19
|
+
*/
|
|
20
|
+
readonly lockoutSuspected: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Schedule / timer / remote-program overlay active (status bit 9). Set when
|
|
23
|
+
* the handheld remote is driving the setpoint from a P1/P2 timer or schedule.
|
|
24
|
+
*/
|
|
25
|
+
readonly scheduleActive: boolean;
|
|
26
|
+
/** Decorative light on/off (status bit 13). Independent of brightness. */
|
|
27
|
+
readonly lightOn: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Decorative light brightness setpoint, 0-255 (chars 20-21). Persists across
|
|
30
|
+
* light on/off — the controller remembers your last dim level.
|
|
31
|
+
*/
|
|
32
|
+
readonly lightBrightness: number;
|
|
33
|
+
/**
|
|
34
|
+
* Circulating fan speed, 0-4 (chars 22-23). 0 = off, 1-4 = the four speed
|
|
35
|
+
* bars exposed by the Valor 10 handheld remote.
|
|
36
|
+
*/
|
|
37
|
+
readonly fanSpeed: number;
|
|
38
|
+
/**
|
|
39
|
+
* Current main-burner output level, 0-255 (chars 14-15). `0x00` means pilot
|
|
40
|
+
* only (no main burner flame). `0xFF` means full output (Step11). Uses the
|
|
41
|
+
* same calibration as the outbound FlameHeight command, but in temperature
|
|
42
|
+
* or eco mode the firmware may report any intermediate modulated value.
|
|
43
|
+
*/
|
|
44
|
+
readonly burnerOutput: number;
|
|
45
|
+
/**
|
|
46
|
+
* Pilot lit but main burner off (`guardFlameOn && burnerOutput === 0`).
|
|
47
|
+
* Not a distinct wire mode — just a state.
|
|
48
|
+
*/
|
|
49
|
+
readonly pilotOnly: boolean;
|
|
10
50
|
constructor(status: string);
|
|
11
51
|
toString(): string;
|
|
12
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fireplaceStatus.d.ts","sourceRoot":"","sources":["../../src/models/fireplaceStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,qBAAa,eAAe;IAC1B,SAAgB,KAAK,EAAE,OAAO,CAAS;IACvC,SAAgB,IAAI,EAAE,aAAa,CAAqB;IACxD,SAAgB,kBAAkB,EAAE,MAAM,CAAM;IAChD,SAAgB,iBAAiB,EAAE,MAAM,CAAM;IAC/C,SAAgB,QAAQ,EAAE,OAAO,CAAS;IAC1C,SAAgB,YAAY,EAAE,OAAO,CAAS;IAC9C,SAAgB,YAAY,EAAE,OAAO,CAAS;
|
|
1
|
+
{"version":3,"file":"fireplaceStatus.d.ts","sourceRoot":"","sources":["../../src/models/fireplaceStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,qBAAa,eAAe;IAC1B,SAAgB,KAAK,EAAE,OAAO,CAAS;IACvC,SAAgB,IAAI,EAAE,aAAa,CAAqB;IACxD,SAAgB,kBAAkB,EAAE,MAAM,CAAM;IAChD,SAAgB,iBAAiB,EAAE,MAAM,CAAM;IAC/C,SAAgB,QAAQ,EAAE,OAAO,CAAS;IAC1C,SAAgB,YAAY,EAAE,OAAO,CAAS;IAC9C,SAAgB,YAAY,EAAE,OAAO,CAAS;IAC9C,oFAAoF;IACpF,SAAgB,aAAa,EAAE,MAAM,CAAM;IAC3C;;;;;;;OAOG;IACH,SAAgB,gBAAgB,EAAE,OAAO,CAAS;IAClD;;;OAGG;IACH,SAAgB,cAAc,EAAE,OAAO,CAAS;IAChD,0EAA0E;IAC1E,SAAgB,OAAO,EAAE,OAAO,CAAS;IACzC;;;OAGG;IACH,SAAgB,eAAe,EAAE,MAAM,CAAK;IAC5C;;;OAGG;IACH,SAAgB,QAAQ,EAAE,MAAM,CAAK;IACrC;;;;;OAKG;IACH,SAAgB,YAAY,EAAE,MAAM,CAAK;IACzC;;;OAGG;IACH,SAAgB,SAAS,EAAE,OAAO,CAAS;gBAE/B,MAAM,EAAE,MAAM;IA0BnB,QAAQ,IAAI,MAAM;CAc1B"}
|
|
@@ -11,14 +11,63 @@ class FireplaceStatus {
|
|
|
11
11
|
this.igniting = false;
|
|
12
12
|
this.guardFlameOn = false;
|
|
13
13
|
this.shuttingDown = false;
|
|
14
|
+
/** Raw 4-char hex of the status bit field (chars 16-19). Useful for diagnostics. */
|
|
15
|
+
this.statusBitsHex = '';
|
|
16
|
+
/**
|
|
17
|
+
* Heuristic: a Mertik GV60 ignition lockout looks like `igniting` set with
|
|
18
|
+
* no `guardFlameOn` and no `shuttingDown`. The valve tried to light, the
|
|
19
|
+
* thermopile never confirmed flame, and the receiver killed the gas. The
|
|
20
|
+
* `igniting` bit stays set until a power-cycle or paperclip reset.
|
|
21
|
+
* Empirically observed at the cabin on 2026-05-16. See PROTOCOL.md in the
|
|
22
|
+
* `valor-fireplace-cli` repo for the full empirical decode.
|
|
23
|
+
*/
|
|
24
|
+
this.lockoutSuspected = false;
|
|
25
|
+
/**
|
|
26
|
+
* Schedule / timer / remote-program overlay active (status bit 9). Set when
|
|
27
|
+
* the handheld remote is driving the setpoint from a P1/P2 timer or schedule.
|
|
28
|
+
*/
|
|
29
|
+
this.scheduleActive = false;
|
|
30
|
+
/** Decorative light on/off (status bit 13). Independent of brightness. */
|
|
31
|
+
this.lightOn = false;
|
|
32
|
+
/**
|
|
33
|
+
* Decorative light brightness setpoint, 0-255 (chars 20-21). Persists across
|
|
34
|
+
* light on/off — the controller remembers your last dim level.
|
|
35
|
+
*/
|
|
36
|
+
this.lightBrightness = 0;
|
|
37
|
+
/**
|
|
38
|
+
* Circulating fan speed, 0-4 (chars 22-23). 0 = off, 1-4 = the four speed
|
|
39
|
+
* bars exposed by the Valor 10 handheld remote.
|
|
40
|
+
*/
|
|
41
|
+
this.fanSpeed = 0;
|
|
42
|
+
/**
|
|
43
|
+
* Current main-burner output level, 0-255 (chars 14-15). `0x00` means pilot
|
|
44
|
+
* only (no main burner flame). `0xFF` means full output (Step11). Uses the
|
|
45
|
+
* same calibration as the outbound FlameHeight command, but in temperature
|
|
46
|
+
* or eco mode the firmware may report any intermediate modulated value.
|
|
47
|
+
*/
|
|
48
|
+
this.burnerOutput = 0;
|
|
49
|
+
/**
|
|
50
|
+
* Pilot lit but main burner off (`guardFlameOn && burnerOutput === 0`).
|
|
51
|
+
* Not a distinct wire mode — just a state.
|
|
52
|
+
*/
|
|
53
|
+
this.pilotOnly = false;
|
|
14
54
|
const modeBits = status.substring(24, 25);
|
|
15
55
|
const statusBits = status.substring(16, 20);
|
|
56
|
+
this.statusBitsHex = statusBits;
|
|
16
57
|
this.shuttingDown = fromBitStatus(statusBits, 7);
|
|
17
58
|
this.guardFlameOn = fromBitStatus(statusBits, 8);
|
|
59
|
+
this.scheduleActive = fromBitStatus(statusBits, 9);
|
|
18
60
|
this.igniting = fromBitStatus(statusBits, 11);
|
|
61
|
+
this.auxOn = fromBitStatus(statusBits, 12);
|
|
62
|
+
this.lightOn = fromBitStatus(statusBits, 13);
|
|
63
|
+
this.burnerOutput = parseInt('0x' + status.substring(14, 16));
|
|
64
|
+
this.lightBrightness = parseInt('0x' + status.substring(20, 22));
|
|
65
|
+
this.fanSpeed = parseInt('0x' + status.substring(22, 24));
|
|
19
66
|
this.currentTemperature = parseInt('0x' + status.substring(28, 32)) / 10;
|
|
20
67
|
this.targetTemperature = parseInt('0x' + status.substring(32, 36)) / 10;
|
|
21
|
-
this.
|
|
68
|
+
this.lockoutSuspected =
|
|
69
|
+
this.igniting && !this.guardFlameOn && !this.shuttingDown;
|
|
70
|
+
this.pilotOnly = this.guardFlameOn && this.burnerOutput === 0;
|
|
22
71
|
const endByte = status.substring(status.length - 2);
|
|
23
72
|
let opMode = getOperationMode(modeBits, endByte);
|
|
24
73
|
if (!this.guardFlameOn || this.shuttingDown) {
|
|
@@ -32,8 +81,13 @@ class FireplaceStatus {
|
|
|
32
81
|
+ `target:${this.targetTemperature} `
|
|
33
82
|
+ `aux:${this.auxOn} `
|
|
34
83
|
+ `current:${this.currentTemperature} `
|
|
84
|
+
+ `burner:${this.burnerOutput} `
|
|
85
|
+
+ `fan:${this.fanSpeed} `
|
|
86
|
+
+ `light:${this.lightOn}/${this.lightBrightness} `
|
|
35
87
|
+ `shutdown:${this.shuttingDown} `
|
|
36
|
-
+ `guardOn:${this.guardFlameOn}
|
|
88
|
+
+ `guardOn:${this.guardFlameOn} `
|
|
89
|
+
+ `lockout:${this.lockoutSuspected} `
|
|
90
|
+
+ `bits:0x${this.statusBitsHex}`;
|
|
37
91
|
}
|
|
38
92
|
}
|
|
39
93
|
exports.FireplaceStatus = FireplaceStatus;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fireplaceStatus.js","sourceRoot":"","sources":["../../src/models/fireplaceStatus.ts"],"names":[],"mappings":";;;AAAA,mDAAgD;AAEhD,MAAa,eAAe;
|
|
1
|
+
{"version":3,"file":"fireplaceStatus.js","sourceRoot":"","sources":["../../src/models/fireplaceStatus.ts"],"names":[],"mappings":";;;AAAA,mDAAgD;AAEhD,MAAa,eAAe;IAiD1B,YAAY,MAAc;QAhDV,UAAK,GAAY,KAAK,CAAC;QACvB,SAAI,GAAkB,6BAAa,CAAC,GAAG,CAAC;QACxC,uBAAkB,GAAW,EAAE,CAAC;QAChC,sBAAiB,GAAW,EAAE,CAAC;QAC/B,aAAQ,GAAY,KAAK,CAAC;QAC1B,iBAAY,GAAY,KAAK,CAAC;QAC9B,iBAAY,GAAY,KAAK,CAAC;QAC9C,oFAAoF;QACpE,kBAAa,GAAW,EAAE,CAAC;QAC3C;;;;;;;WAOG;QACa,qBAAgB,GAAY,KAAK,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