@camstack/addon-provider-rademacher 0.2.96 → 0.2.98
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/dist/addon.js +151 -22
- package/dist/addon.mjs +151 -22
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -8288,6 +8288,23 @@ function errMsg(err) {
|
|
|
8288
8288
|
if (typeof err === "string") return err;
|
|
8289
8289
|
return String(err);
|
|
8290
8290
|
}
|
|
8291
|
+
new Set([
|
|
8292
|
+
"track",
|
|
8293
|
+
"summary",
|
|
8294
|
+
"face",
|
|
8295
|
+
"identity",
|
|
8296
|
+
"plate",
|
|
8297
|
+
"vehicle",
|
|
8298
|
+
"scene",
|
|
8299
|
+
"motion",
|
|
8300
|
+
"object",
|
|
8301
|
+
"audio"
|
|
8302
|
+
]);
|
|
8303
|
+
new Set([
|
|
8304
|
+
"motion",
|
|
8305
|
+
"object",
|
|
8306
|
+
"audio"
|
|
8307
|
+
]);
|
|
8291
8308
|
var EncodeProfileSchema = object({
|
|
8292
8309
|
video: object({
|
|
8293
8310
|
codec: _enum([
|
|
@@ -13488,8 +13505,17 @@ method(object({
|
|
|
13488
13505
|
}), array(SettingsRecordSchema).readonly()), method(object({
|
|
13489
13506
|
namespace: string().optional(),
|
|
13490
13507
|
collection: string(),
|
|
13491
|
-
record:
|
|
13492
|
-
|
|
13508
|
+
record: object({
|
|
13509
|
+
id: string().optional(),
|
|
13510
|
+
data: record(string(), unknown())
|
|
13511
|
+
})
|
|
13512
|
+
}), object({
|
|
13513
|
+
/**
|
|
13514
|
+
* The id the row ACTUALLY got (D473): the one supplied, the UUID minted
|
|
13515
|
+
* for an absent one, or the ROWID SQLite assigned on an `INTEGER`
|
|
13516
|
+
* primary key — which is the only place an auto key is knowable.
|
|
13517
|
+
*/
|
|
13518
|
+
id: union([string(), number()]) }), { kind: "mutation" }), method(object({
|
|
13493
13519
|
namespace: string().optional(),
|
|
13494
13520
|
collection: string(),
|
|
13495
13521
|
records: array(BulkRecordSchema).readonly()
|
|
@@ -13598,8 +13624,17 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
|
13598
13624
|
}), array(SettingsRecordSchema).readonly(), { auth: "admin" }), method(object({
|
|
13599
13625
|
namespace: string().optional(),
|
|
13600
13626
|
collection: string(),
|
|
13601
|
-
record:
|
|
13602
|
-
|
|
13627
|
+
record: object({
|
|
13628
|
+
id: string().optional(),
|
|
13629
|
+
data: record(string(), unknown())
|
|
13630
|
+
})
|
|
13631
|
+
}), object({
|
|
13632
|
+
/**
|
|
13633
|
+
* The id the row ACTUALLY got (D473): the one supplied, the UUID minted
|
|
13634
|
+
* for an absent one, or the ROWID SQLite assigned on an `INTEGER`
|
|
13635
|
+
* primary key — which is the only place an auto key is knowable.
|
|
13636
|
+
*/
|
|
13637
|
+
id: union([string(), number()]) }), {
|
|
13603
13638
|
kind: "mutation",
|
|
13604
13639
|
auth: "admin"
|
|
13605
13640
|
}), method(object({
|
|
@@ -20507,7 +20542,20 @@ var TrackSchema = object({
|
|
|
20507
20542
|
...TrackRetrainFields
|
|
20508
20543
|
});
|
|
20509
20544
|
var BaseEventFields = {
|
|
20510
|
-
|
|
20545
|
+
/**
|
|
20546
|
+
* A SQLite ROWID, assigned by the database (D474).
|
|
20547
|
+
*
|
|
20548
|
+
* Was a 36-character UUID and cost 263 MB of a 1 117 MB database — paid
|
|
20549
|
+
* TWICE per row, in the row and in the primary-key index, across 2.1 million
|
|
20550
|
+
* motion, audio and object events. An `INTEGER PRIMARY KEY` in SQLite **is**
|
|
20551
|
+
* the rowid: the table itself is that B-tree, so the index stops existing
|
|
20552
|
+
* rather than getting smaller. No shorter string does that.
|
|
20553
|
+
*
|
|
20554
|
+
* Defined once here for all three event kinds, which is why they move
|
|
20555
|
+
* together: a per-table migration would have forked this and
|
|
20556
|
+
* `COMMON_BASE_COLUMNS` and reunited them two stages later.
|
|
20557
|
+
*/
|
|
20558
|
+
id: number().int(),
|
|
20511
20559
|
deviceId: number(),
|
|
20512
20560
|
timestamp: number()
|
|
20513
20561
|
};
|
|
@@ -20526,7 +20574,34 @@ var MotionEventSchema = object({
|
|
|
20526
20574
|
/** Omitted in slim projection. */
|
|
20527
20575
|
frameHeight: number().optional(),
|
|
20528
20576
|
/** Populated by B5 (recording playback URL for this event). */
|
|
20529
|
-
mediaUrl: string().optional()
|
|
20577
|
+
mediaUrl: string().optional(),
|
|
20578
|
+
/**
|
|
20579
|
+
* One row per motion EPISODE, not one per push (D475). `null` while the
|
|
20580
|
+
* episode is still open — a further rising edge extends it in place rather
|
|
20581
|
+
* than inserting a new row. Set once, at close, to `lastOnAt - startedAt`
|
|
20582
|
+
* (the span from the first rising edge to the LAST one, deliberately NOT
|
|
20583
|
+
* `closedAt - startedAt` — the close delay is a quiet CONFIRMATION, not
|
|
20584
|
+
* movement, and folding it in would report `MOTION_CLOSE_AFTER_MS` of
|
|
20585
|
+
* motion for an instantaneous trigger).
|
|
20586
|
+
*
|
|
20587
|
+
* **Absent** (not merely `null`) on a row written before D475 — that means
|
|
20588
|
+
* "closed the old way, before this column existed", never "still open".
|
|
20589
|
+
* Nothing in this codebase may read an absent `durationMs` as an open
|
|
20590
|
+
* episode; only `null` means open.
|
|
20591
|
+
*/
|
|
20592
|
+
durationMs: number().nullable().optional(),
|
|
20593
|
+
/**
|
|
20594
|
+
* Ms offsets from `timestamp` (the episode's own first rising edge, so the
|
|
20595
|
+
* first entry is always `0`) of every genuine off→on transition the
|
|
20596
|
+
* episode saw — "ogni evento on si deve salvare" (D475). NOT one entry per
|
|
20597
|
+
* push: a firmware source that keepalives at ~1 Hz for the whole burst
|
|
20598
|
+
* (Reolink, Hikvision) produces exactly one edge; a source that reports an
|
|
20599
|
+
* explicit `false` mid-episode and then resumes before the quiet window
|
|
20600
|
+
* elapses produces another. Stored compactly — see `motion-edge-codec.ts`
|
|
20601
|
+
* — and decoded back to this shape on read. Absent/empty on a legacy row,
|
|
20602
|
+
* which must never be read as "no episode happened here".
|
|
20603
|
+
*/
|
|
20604
|
+
edges: array(number()).readonly().optional()
|
|
20530
20605
|
});
|
|
20531
20606
|
/**
|
|
20532
20607
|
* Which detection SOURCE produced an object event. `pipeline` = the ML
|
|
@@ -20581,6 +20656,23 @@ var ObjectEventSchema = object({
|
|
|
20581
20656
|
* includes it (it is light). Absent on rows written before this field.
|
|
20582
20657
|
*/
|
|
20583
20658
|
frameId: string().optional(),
|
|
20659
|
+
/**
|
|
20660
|
+
* A PRODUCER-chosen key that makes a synthetic event's emission idempotent
|
|
20661
|
+
* (D474).
|
|
20662
|
+
*
|
|
20663
|
+
* Only the package detector writes it, and it exists because the event id
|
|
20664
|
+
* stopped being choosable: the delivery and pick-up rows used to BE their
|
|
20665
|
+
* dedupe key (`pa-pkg-<entryId>-delivered`), which is how "never emit a
|
|
20666
|
+
* second delivery for this entry" survived a restart. An `INTEGER` rowid is
|
|
20667
|
+
* assigned by SQLite, so that key had to move off the primary key rather
|
|
20668
|
+
* than be dropped — a detector that cannot recognise its own row re-delivers
|
|
20669
|
+
* every parcel on every boot.
|
|
20670
|
+
*
|
|
20671
|
+
* Absent on every other object event, and on every row written before this
|
|
20672
|
+
* field. Never a substitute for `id`: it is unique per (producer, occasion),
|
|
20673
|
+
* not per row, and nothing addresses a row by it.
|
|
20674
|
+
*/
|
|
20675
|
+
idempotencyKey: string().optional(),
|
|
20584
20676
|
/** Omitted in slim projection. */
|
|
20585
20677
|
trackId: string().optional(),
|
|
20586
20678
|
className: string(),
|
|
@@ -28830,26 +28922,59 @@ authKey: string().optional() }), object({
|
|
|
28830
28922
|
/** Human-readable error when `ok: false`. */
|
|
28831
28923
|
error: string().optional()
|
|
28832
28924
|
}), { kind: "mutation" });
|
|
28833
|
-
/**
|
|
28834
|
-
* Hardware / firmware motion sensor cap — binary detected state plus
|
|
28835
|
-
* a timestamp of the last observation. Distinct from
|
|
28836
|
-
* `motion-detection.cap.ts` which owns the LOCAL ML motion pipeline;
|
|
28837
|
-
* `motion` is the lightweight readout from on-camera motion (Reolink
|
|
28838
|
-
* `GetMdState`, Baichuan push `type: motion`, ONVIF analytics).
|
|
28839
|
-
*
|
|
28840
|
-
* Native-motion providers also fan out to `detection.camera-native`
|
|
28841
|
-
* with `source: 'onboard'` so cross-cutting system services
|
|
28842
|
-
* (alert-center, advanced-notifier) can subscribe once and receive
|
|
28843
|
-
* motion from every camera.
|
|
28844
|
-
*/
|
|
28845
28925
|
var MotionStatusSchema = object({
|
|
28846
28926
|
detected: boolean(),
|
|
28847
28927
|
/** Ms epoch of the last detected-true observation. Null if never detected. */
|
|
28848
28928
|
lastDetectedAt: number().nullable(),
|
|
28849
28929
|
/**
|
|
28850
|
-
*
|
|
28851
|
-
*
|
|
28852
|
-
*
|
|
28930
|
+
* `MOTION_CLOSE_AFTER_MS` while `detected: true` on a `Camera` device,
|
|
28931
|
+
* `null` while false and on every `Sensor` device (D475) — see that
|
|
28932
|
+
* constant's doc for the one-authority rule.
|
|
28933
|
+
*
|
|
28934
|
+
* ## Reading this field still arms nothing
|
|
28935
|
+
*
|
|
28936
|
+
* It reads like an instruction to the consumer ("revert after N ms if
|
|
28937
|
+
* no fresh push arrives") and it is not one: nothing in this repo reads
|
|
28938
|
+
* the LIVE cap value to drive a timer. `pipeline-analytics`'s motion-episode
|
|
28939
|
+
* close DOES now use the same number — `MOTION_CLOSE_AFTER_MS` — but as an
|
|
28940
|
+
* imported constant, not as a read of `device.state.motion.value`, so this
|
|
28941
|
+
* field stays what it always was: DESCRIPTIVE output, mirroring an answer
|
|
28942
|
+
* computed elsewhere. Building a self-clear timer out of a READ of this
|
|
28943
|
+
* field would add a second falling-edge authority beside whichever one
|
|
28944
|
+
* already owns the device, and two that can disagree are worse than one.
|
|
28945
|
+
* Consumers that need a falling edge SHAPED differently — held open across
|
|
28946
|
+
* a flapping source — debounce on their own side and say so, as
|
|
28947
|
+
* `addon-export-alexa/src/motion-clear-hold.ts` and
|
|
28948
|
+
* `addon-export-hap`'s `RESET_DEBOUNCE_MS` both do.
|
|
28949
|
+
*
|
|
28950
|
+
* ## Who writes it
|
|
28951
|
+
*
|
|
28952
|
+
* - **Cameras** — the runner's phase machine, `active → watching` on
|
|
28953
|
+
* `cooldown_expired`, which then writes this slice with
|
|
28954
|
+
* `detected: false` (`handlePhaseChanged` in
|
|
28955
|
+
* `pipeline-runner/index.ts`). It produces the FALLING edge, which
|
|
28956
|
+
* matters most for the sources that only ever push a rising one:
|
|
28957
|
+
* Reolink emits `MotionOnMotionChanged { detected: true }` and never
|
|
28958
|
+
* a false.
|
|
28959
|
+
* - **Sensors** (Home Assistant binary sensors, Homematic) — the
|
|
28960
|
+
* provider pushes the false itself, from the upstream system's own
|
|
28961
|
+
* state change. No phase machine is involved.
|
|
28962
|
+
*
|
|
28963
|
+
* ### The phase machine is CANONICAL, not sole — and that is a defect
|
|
28964
|
+
*
|
|
28965
|
+
* An earlier revision of this docblock (mine, 2026-09-12) claimed the
|
|
28966
|
+
* phase machine is the sole writer for a camera. It is not.
|
|
28967
|
+
* `hikvision-camera.ts:3464` and `amcrest-camera.ts:445` both call
|
|
28968
|
+
* `setCapSlice(motionCapability, …)` on their own rising edge, and
|
|
28969
|
+
* Hikvision's comment says why: it read THIS docblock, agreed the
|
|
28970
|
+
* runner is canonical, and wrote anyway to avoid per-tick churn. So
|
|
28971
|
+
* two authorities can disagree about one slice, which this repo
|
|
28972
|
+
* forbids, and the doc said otherwise — which is worse than saying
|
|
28973
|
+
* nothing, because it reads as verification.
|
|
28974
|
+
*
|
|
28975
|
+
* This predates D475 and is not fixed there: the fix touches every
|
|
28976
|
+
* camera provider. Recorded in D475's Consequences. Do not restore the
|
|
28977
|
+
* "sole writer" wording without also removing the other writers.
|
|
28853
28978
|
*/
|
|
28854
28979
|
autoClearAfterMs: number().nullable()
|
|
28855
28980
|
});
|
|
@@ -28919,7 +29044,11 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
|
|
|
28919
29044
|
*/
|
|
28920
29045
|
runtimeState: MotionStatusSchema,
|
|
28921
29046
|
/**
|
|
28922
|
-
* Runtime-state durability: **session** —
|
|
29047
|
+
* Runtime-state durability: **session** — every writer of this slice
|
|
29048
|
+
* writes only on an EDGE, so a restored `detected: true` would stay
|
|
29049
|
+
* frozen until the next one instead of being corrected. The next edge
|
|
29050
|
+
* re-publishes the real state. (On who the writers are, and why there
|
|
29051
|
+
* is more than one, see `autoClearAfterMs` above.)
|
|
28923
29052
|
*
|
|
28924
29053
|
* See `RuntimeStateDurability`. Enforced by
|
|
28925
29054
|
* `scripts/check-runtime-state-durability.ts`.
|
package/dist/addon.mjs
CHANGED
|
@@ -8287,6 +8287,23 @@ function errMsg(err) {
|
|
|
8287
8287
|
if (typeof err === "string") return err;
|
|
8288
8288
|
return String(err);
|
|
8289
8289
|
}
|
|
8290
|
+
new Set([
|
|
8291
|
+
"track",
|
|
8292
|
+
"summary",
|
|
8293
|
+
"face",
|
|
8294
|
+
"identity",
|
|
8295
|
+
"plate",
|
|
8296
|
+
"vehicle",
|
|
8297
|
+
"scene",
|
|
8298
|
+
"motion",
|
|
8299
|
+
"object",
|
|
8300
|
+
"audio"
|
|
8301
|
+
]);
|
|
8302
|
+
new Set([
|
|
8303
|
+
"motion",
|
|
8304
|
+
"object",
|
|
8305
|
+
"audio"
|
|
8306
|
+
]);
|
|
8290
8307
|
var EncodeProfileSchema = object({
|
|
8291
8308
|
video: object({
|
|
8292
8309
|
codec: _enum([
|
|
@@ -13487,8 +13504,17 @@ method(object({
|
|
|
13487
13504
|
}), array(SettingsRecordSchema).readonly()), method(object({
|
|
13488
13505
|
namespace: string().optional(),
|
|
13489
13506
|
collection: string(),
|
|
13490
|
-
record:
|
|
13491
|
-
|
|
13507
|
+
record: object({
|
|
13508
|
+
id: string().optional(),
|
|
13509
|
+
data: record(string(), unknown())
|
|
13510
|
+
})
|
|
13511
|
+
}), object({
|
|
13512
|
+
/**
|
|
13513
|
+
* The id the row ACTUALLY got (D473): the one supplied, the UUID minted
|
|
13514
|
+
* for an absent one, or the ROWID SQLite assigned on an `INTEGER`
|
|
13515
|
+
* primary key — which is the only place an auto key is knowable.
|
|
13516
|
+
*/
|
|
13517
|
+
id: union([string(), number()]) }), { kind: "mutation" }), method(object({
|
|
13492
13518
|
namespace: string().optional(),
|
|
13493
13519
|
collection: string(),
|
|
13494
13520
|
records: array(BulkRecordSchema).readonly()
|
|
@@ -13597,8 +13623,17 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
|
13597
13623
|
}), array(SettingsRecordSchema).readonly(), { auth: "admin" }), method(object({
|
|
13598
13624
|
namespace: string().optional(),
|
|
13599
13625
|
collection: string(),
|
|
13600
|
-
record:
|
|
13601
|
-
|
|
13626
|
+
record: object({
|
|
13627
|
+
id: string().optional(),
|
|
13628
|
+
data: record(string(), unknown())
|
|
13629
|
+
})
|
|
13630
|
+
}), object({
|
|
13631
|
+
/**
|
|
13632
|
+
* The id the row ACTUALLY got (D473): the one supplied, the UUID minted
|
|
13633
|
+
* for an absent one, or the ROWID SQLite assigned on an `INTEGER`
|
|
13634
|
+
* primary key — which is the only place an auto key is knowable.
|
|
13635
|
+
*/
|
|
13636
|
+
id: union([string(), number()]) }), {
|
|
13602
13637
|
kind: "mutation",
|
|
13603
13638
|
auth: "admin"
|
|
13604
13639
|
}), method(object({
|
|
@@ -20506,7 +20541,20 @@ var TrackSchema = object({
|
|
|
20506
20541
|
...TrackRetrainFields
|
|
20507
20542
|
});
|
|
20508
20543
|
var BaseEventFields = {
|
|
20509
|
-
|
|
20544
|
+
/**
|
|
20545
|
+
* A SQLite ROWID, assigned by the database (D474).
|
|
20546
|
+
*
|
|
20547
|
+
* Was a 36-character UUID and cost 263 MB of a 1 117 MB database — paid
|
|
20548
|
+
* TWICE per row, in the row and in the primary-key index, across 2.1 million
|
|
20549
|
+
* motion, audio and object events. An `INTEGER PRIMARY KEY` in SQLite **is**
|
|
20550
|
+
* the rowid: the table itself is that B-tree, so the index stops existing
|
|
20551
|
+
* rather than getting smaller. No shorter string does that.
|
|
20552
|
+
*
|
|
20553
|
+
* Defined once here for all three event kinds, which is why they move
|
|
20554
|
+
* together: a per-table migration would have forked this and
|
|
20555
|
+
* `COMMON_BASE_COLUMNS` and reunited them two stages later.
|
|
20556
|
+
*/
|
|
20557
|
+
id: number().int(),
|
|
20510
20558
|
deviceId: number(),
|
|
20511
20559
|
timestamp: number()
|
|
20512
20560
|
};
|
|
@@ -20525,7 +20573,34 @@ var MotionEventSchema = object({
|
|
|
20525
20573
|
/** Omitted in slim projection. */
|
|
20526
20574
|
frameHeight: number().optional(),
|
|
20527
20575
|
/** Populated by B5 (recording playback URL for this event). */
|
|
20528
|
-
mediaUrl: string().optional()
|
|
20576
|
+
mediaUrl: string().optional(),
|
|
20577
|
+
/**
|
|
20578
|
+
* One row per motion EPISODE, not one per push (D475). `null` while the
|
|
20579
|
+
* episode is still open — a further rising edge extends it in place rather
|
|
20580
|
+
* than inserting a new row. Set once, at close, to `lastOnAt - startedAt`
|
|
20581
|
+
* (the span from the first rising edge to the LAST one, deliberately NOT
|
|
20582
|
+
* `closedAt - startedAt` — the close delay is a quiet CONFIRMATION, not
|
|
20583
|
+
* movement, and folding it in would report `MOTION_CLOSE_AFTER_MS` of
|
|
20584
|
+
* motion for an instantaneous trigger).
|
|
20585
|
+
*
|
|
20586
|
+
* **Absent** (not merely `null`) on a row written before D475 — that means
|
|
20587
|
+
* "closed the old way, before this column existed", never "still open".
|
|
20588
|
+
* Nothing in this codebase may read an absent `durationMs` as an open
|
|
20589
|
+
* episode; only `null` means open.
|
|
20590
|
+
*/
|
|
20591
|
+
durationMs: number().nullable().optional(),
|
|
20592
|
+
/**
|
|
20593
|
+
* Ms offsets from `timestamp` (the episode's own first rising edge, so the
|
|
20594
|
+
* first entry is always `0`) of every genuine off→on transition the
|
|
20595
|
+
* episode saw — "ogni evento on si deve salvare" (D475). NOT one entry per
|
|
20596
|
+
* push: a firmware source that keepalives at ~1 Hz for the whole burst
|
|
20597
|
+
* (Reolink, Hikvision) produces exactly one edge; a source that reports an
|
|
20598
|
+
* explicit `false` mid-episode and then resumes before the quiet window
|
|
20599
|
+
* elapses produces another. Stored compactly — see `motion-edge-codec.ts`
|
|
20600
|
+
* — and decoded back to this shape on read. Absent/empty on a legacy row,
|
|
20601
|
+
* which must never be read as "no episode happened here".
|
|
20602
|
+
*/
|
|
20603
|
+
edges: array(number()).readonly().optional()
|
|
20529
20604
|
});
|
|
20530
20605
|
/**
|
|
20531
20606
|
* Which detection SOURCE produced an object event. `pipeline` = the ML
|
|
@@ -20580,6 +20655,23 @@ var ObjectEventSchema = object({
|
|
|
20580
20655
|
* includes it (it is light). Absent on rows written before this field.
|
|
20581
20656
|
*/
|
|
20582
20657
|
frameId: string().optional(),
|
|
20658
|
+
/**
|
|
20659
|
+
* A PRODUCER-chosen key that makes a synthetic event's emission idempotent
|
|
20660
|
+
* (D474).
|
|
20661
|
+
*
|
|
20662
|
+
* Only the package detector writes it, and it exists because the event id
|
|
20663
|
+
* stopped being choosable: the delivery and pick-up rows used to BE their
|
|
20664
|
+
* dedupe key (`pa-pkg-<entryId>-delivered`), which is how "never emit a
|
|
20665
|
+
* second delivery for this entry" survived a restart. An `INTEGER` rowid is
|
|
20666
|
+
* assigned by SQLite, so that key had to move off the primary key rather
|
|
20667
|
+
* than be dropped — a detector that cannot recognise its own row re-delivers
|
|
20668
|
+
* every parcel on every boot.
|
|
20669
|
+
*
|
|
20670
|
+
* Absent on every other object event, and on every row written before this
|
|
20671
|
+
* field. Never a substitute for `id`: it is unique per (producer, occasion),
|
|
20672
|
+
* not per row, and nothing addresses a row by it.
|
|
20673
|
+
*/
|
|
20674
|
+
idempotencyKey: string().optional(),
|
|
20583
20675
|
/** Omitted in slim projection. */
|
|
20584
20676
|
trackId: string().optional(),
|
|
20585
20677
|
className: string(),
|
|
@@ -28829,26 +28921,59 @@ authKey: string().optional() }), object({
|
|
|
28829
28921
|
/** Human-readable error when `ok: false`. */
|
|
28830
28922
|
error: string().optional()
|
|
28831
28923
|
}), { kind: "mutation" });
|
|
28832
|
-
/**
|
|
28833
|
-
* Hardware / firmware motion sensor cap — binary detected state plus
|
|
28834
|
-
* a timestamp of the last observation. Distinct from
|
|
28835
|
-
* `motion-detection.cap.ts` which owns the LOCAL ML motion pipeline;
|
|
28836
|
-
* `motion` is the lightweight readout from on-camera motion (Reolink
|
|
28837
|
-
* `GetMdState`, Baichuan push `type: motion`, ONVIF analytics).
|
|
28838
|
-
*
|
|
28839
|
-
* Native-motion providers also fan out to `detection.camera-native`
|
|
28840
|
-
* with `source: 'onboard'` so cross-cutting system services
|
|
28841
|
-
* (alert-center, advanced-notifier) can subscribe once and receive
|
|
28842
|
-
* motion from every camera.
|
|
28843
|
-
*/
|
|
28844
28924
|
var MotionStatusSchema = object({
|
|
28845
28925
|
detected: boolean(),
|
|
28846
28926
|
/** Ms epoch of the last detected-true observation. Null if never detected. */
|
|
28847
28927
|
lastDetectedAt: number().nullable(),
|
|
28848
28928
|
/**
|
|
28849
|
-
*
|
|
28850
|
-
*
|
|
28851
|
-
*
|
|
28929
|
+
* `MOTION_CLOSE_AFTER_MS` while `detected: true` on a `Camera` device,
|
|
28930
|
+
* `null` while false and on every `Sensor` device (D475) — see that
|
|
28931
|
+
* constant's doc for the one-authority rule.
|
|
28932
|
+
*
|
|
28933
|
+
* ## Reading this field still arms nothing
|
|
28934
|
+
*
|
|
28935
|
+
* It reads like an instruction to the consumer ("revert after N ms if
|
|
28936
|
+
* no fresh push arrives") and it is not one: nothing in this repo reads
|
|
28937
|
+
* the LIVE cap value to drive a timer. `pipeline-analytics`'s motion-episode
|
|
28938
|
+
* close DOES now use the same number — `MOTION_CLOSE_AFTER_MS` — but as an
|
|
28939
|
+
* imported constant, not as a read of `device.state.motion.value`, so this
|
|
28940
|
+
* field stays what it always was: DESCRIPTIVE output, mirroring an answer
|
|
28941
|
+
* computed elsewhere. Building a self-clear timer out of a READ of this
|
|
28942
|
+
* field would add a second falling-edge authority beside whichever one
|
|
28943
|
+
* already owns the device, and two that can disagree are worse than one.
|
|
28944
|
+
* Consumers that need a falling edge SHAPED differently — held open across
|
|
28945
|
+
* a flapping source — debounce on their own side and say so, as
|
|
28946
|
+
* `addon-export-alexa/src/motion-clear-hold.ts` and
|
|
28947
|
+
* `addon-export-hap`'s `RESET_DEBOUNCE_MS` both do.
|
|
28948
|
+
*
|
|
28949
|
+
* ## Who writes it
|
|
28950
|
+
*
|
|
28951
|
+
* - **Cameras** — the runner's phase machine, `active → watching` on
|
|
28952
|
+
* `cooldown_expired`, which then writes this slice with
|
|
28953
|
+
* `detected: false` (`handlePhaseChanged` in
|
|
28954
|
+
* `pipeline-runner/index.ts`). It produces the FALLING edge, which
|
|
28955
|
+
* matters most for the sources that only ever push a rising one:
|
|
28956
|
+
* Reolink emits `MotionOnMotionChanged { detected: true }` and never
|
|
28957
|
+
* a false.
|
|
28958
|
+
* - **Sensors** (Home Assistant binary sensors, Homematic) — the
|
|
28959
|
+
* provider pushes the false itself, from the upstream system's own
|
|
28960
|
+
* state change. No phase machine is involved.
|
|
28961
|
+
*
|
|
28962
|
+
* ### The phase machine is CANONICAL, not sole — and that is a defect
|
|
28963
|
+
*
|
|
28964
|
+
* An earlier revision of this docblock (mine, 2026-09-12) claimed the
|
|
28965
|
+
* phase machine is the sole writer for a camera. It is not.
|
|
28966
|
+
* `hikvision-camera.ts:3464` and `amcrest-camera.ts:445` both call
|
|
28967
|
+
* `setCapSlice(motionCapability, …)` on their own rising edge, and
|
|
28968
|
+
* Hikvision's comment says why: it read THIS docblock, agreed the
|
|
28969
|
+
* runner is canonical, and wrote anyway to avoid per-tick churn. So
|
|
28970
|
+
* two authorities can disagree about one slice, which this repo
|
|
28971
|
+
* forbids, and the doc said otherwise — which is worse than saying
|
|
28972
|
+
* nothing, because it reads as verification.
|
|
28973
|
+
*
|
|
28974
|
+
* This predates D475 and is not fixed there: the fix touches every
|
|
28975
|
+
* camera provider. Recorded in D475's Consequences. Do not restore the
|
|
28976
|
+
* "sole writer" wording without also removing the other writers.
|
|
28852
28977
|
*/
|
|
28853
28978
|
autoClearAfterMs: number().nullable()
|
|
28854
28979
|
});
|
|
@@ -28918,7 +29043,11 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
|
|
|
28918
29043
|
*/
|
|
28919
29044
|
runtimeState: MotionStatusSchema,
|
|
28920
29045
|
/**
|
|
28921
|
-
* Runtime-state durability: **session** —
|
|
29046
|
+
* Runtime-state durability: **session** — every writer of this slice
|
|
29047
|
+
* writes only on an EDGE, so a restored `detected: true` would stay
|
|
29048
|
+
* frozen until the next one instead of being corrected. The next edge
|
|
29049
|
+
* re-publishes the real state. (On who the writers are, and why there
|
|
29050
|
+
* is more than one, see `autoClearAfterMs` above.)
|
|
28922
29051
|
*
|
|
28923
29052
|
* See `RuntimeStateDurability`. Enforced by
|
|
28924
29053
|
* `scripts/check-runtime-state-durability.ts`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-rademacher",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.98",
|
|
4
4
|
"description": "Rademacher HomePilot device-provider addon for CamStack — wraps the @apocaliss92/noderademacher local-hub client (roller shutters over the cover cap)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|