@camstack/addon-provider-hikvision 1.2.175 → 1.2.176

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.mjs CHANGED
@@ -13,7 +13,7 @@ import { Agent as Agent$1, request as request$1 } from "node:https";
13
13
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
14
14
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
15
15
  //#endregion
16
- //#region ../types/dist/event-category-DHXxB8t9.mjs
16
+ //#region ../types/dist/event-category-CT-hz5Rb.mjs
17
17
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
18
18
  EventCategory["SystemBoot"] = "system.boot";
19
19
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -339,6 +339,14 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
339
339
  /** The recovery edge of {@link PipelineMotionNoisy}: the motion fell back, or a detection arrived. */
340
340
  EventCategory["PipelineMotionCalm"] = "pipeline.motion-calm";
341
341
  /**
342
+ * A camera's package LLM confirm has failed closed three times in a row
343
+ * (D931, 2026-10-26). One edge per camera until
344
+ * {@link PipelinePackageLlmAnswered}.
345
+ */
346
+ EventCategory["PipelinePackageLlmSilent"] = "pipeline.package-llm-silent";
347
+ /** The recovery edge of {@link PipelinePackageLlmSilent}: a confirm returned yes or no. */
348
+ EventCategory["PipelinePackageLlmAnswered"] = "pipeline.package-llm-answered";
349
+ /**
342
350
  * Per-camera pipeline config was mutated by the orchestrator
343
351
  * (a settings change via `setAgentInferenceDevices` /
344
352
  * `setCameraStepToggle` / `setCameraStepSettings`). Orchestrator
@@ -5448,7 +5456,7 @@ var ZodIssueCode = {
5448
5456
  var ZodFirstPartyTypeKind;
5449
5457
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5450
5458
  //#endregion
5451
- //#region ../types/dist/sleep-BErAxhul.mjs
5459
+ //#region ../types/dist/sleep-bykKrTgu.mjs
5452
5460
  /**
5453
5461
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5454
5462
  * window to float samples (D455).
@@ -8002,6 +8010,99 @@ var RecordKindDeclarationSchema = object({
8002
8010
  }).strict();
8003
8011
  /** The kind names: lower-case, dash separated, short enough for an index name. */
8004
8012
  var RecordKindNameSchema = string().regex(/^[a-z][a-z0-9-]{0,47}$/);
8013
+ var READING_QUANTITIES = [
8014
+ "temperature",
8015
+ "pressure",
8016
+ "speed",
8017
+ "precipitation",
8018
+ "precipitation-rate",
8019
+ "length",
8020
+ "area",
8021
+ "illuminance",
8022
+ "irradiance",
8023
+ "power",
8024
+ "energy",
8025
+ "voltage",
8026
+ "current",
8027
+ "apparent-power",
8028
+ "humidity",
8029
+ "percentage",
8030
+ "concentration-volume",
8031
+ "concentration-mass",
8032
+ "concentration-ppb",
8033
+ "volume",
8034
+ "duration",
8035
+ "duration-ms",
8036
+ "information",
8037
+ "sound-level",
8038
+ "signal-level",
8039
+ "colour-temperature",
8040
+ "angle",
8041
+ "bitrate",
8042
+ "rate",
8043
+ "mass",
8044
+ "index",
8045
+ "ratio",
8046
+ "count",
8047
+ "none",
8048
+ "device"
8049
+ ];
8050
+ var ReadingQuantitySchema = _enum(READING_QUANTITIES);
8051
+ new Set(READING_QUANTITIES);
8052
+ /**
8053
+ * Stored unit symbol for a quantity. `none` means the number is dimensionless
8054
+ * (or an index / ratio / count). `device` means the cap has no single unit.
8055
+ */
8056
+ var QUANTITY_BASE = {
8057
+ temperature: "°C",
8058
+ pressure: "hPa",
8059
+ speed: "m/s",
8060
+ precipitation: "mm",
8061
+ "precipitation-rate": "mm/h",
8062
+ length: "m",
8063
+ area: "m²",
8064
+ illuminance: "lx",
8065
+ irradiance: "W/m²",
8066
+ power: "W",
8067
+ energy: "kWh",
8068
+ voltage: "V",
8069
+ current: "A",
8070
+ "apparent-power": "VA",
8071
+ humidity: "%",
8072
+ percentage: "%",
8073
+ "concentration-volume": "ppm",
8074
+ "concentration-mass": "µg/m³",
8075
+ "concentration-ppb": "ppb",
8076
+ volume: "L",
8077
+ duration: "s",
8078
+ "duration-ms": "ms",
8079
+ information: "B",
8080
+ "sound-level": "dBFS",
8081
+ "signal-level": "dBm",
8082
+ "colour-temperature": "mired",
8083
+ angle: "°",
8084
+ bitrate: "kbps",
8085
+ rate: "fps",
8086
+ mass: "kg",
8087
+ index: "none",
8088
+ ratio: "none",
8089
+ count: "none",
8090
+ none: "none",
8091
+ device: "device"
8092
+ };
8093
+ /** The stored unit, or `undefined` when the quantity has no unit symbol. */
8094
+ function baseUnitOf(quantity) {
8095
+ const symbol = QUANTITY_BASE[quantity];
8096
+ if (symbol === "none" || symbol === "device") return void 0;
8097
+ return symbol;
8098
+ }
8099
+ function readingMeta(quantity, extras) {
8100
+ return {
8101
+ quantity,
8102
+ ...extras?.precision !== void 0 ? { precision: extras.precision } : {},
8103
+ ...extras?.label !== void 0 ? { label: extras.label } : {}
8104
+ };
8105
+ }
8005
8106
  /** Shared Zod schemas used across streaming capabilities. */
8006
8107
  var CamProfileSchema = _enum([
8007
8108
  "high",
@@ -8029,8 +8130,8 @@ var CamStreamKindSchema = _enum([
8029
8130
  "derived"
8030
8131
  ]);
8031
8132
  var CamStreamResolutionSchema = object({
8032
- width: number().int().positive(),
8033
- height: number().int().positive()
8133
+ width: number().int().positive().meta(readingMeta("none")),
8134
+ height: number().int().positive().meta(readingMeta("none"))
8034
8135
  });
8035
8136
  var CameraStreamSchema = object({
8036
8137
  /** Stable, provider-assigned id unique within the (deviceId) scope. */
@@ -8560,6 +8661,8 @@ var CAP_NAMES = Object.freeze([
8560
8661
  "filesystem-browse",
8561
8662
  "flood",
8562
8663
  "gas",
8664
+ "group-commands",
8665
+ "group-status",
8563
8666
  "heating-valve",
8564
8667
  "humidifier",
8565
8668
  "humidity-sensor",
@@ -8689,14 +8792,6 @@ Object.freeze({
8689
8792
  {
8690
8793
  "path": "aqi",
8691
8794
  "valueType": "number"
8692
- },
8693
- {
8694
- "path": "unit",
8695
- "valueType": "string"
8696
- },
8697
- {
8698
- "path": "precision",
8699
- "valueType": "number"
8700
8795
  }
8701
8796
  ],
8702
8797
  "alarm-panel": [
@@ -8732,20 +8827,10 @@ Object.freeze({
8732
8827
  "valueType": "boolean"
8733
8828
  }
8734
8829
  ],
8735
- "ambient-light-sensor": [
8736
- {
8737
- "path": "lux",
8738
- "valueType": "number"
8739
- },
8740
- {
8741
- "path": "unit",
8742
- "valueType": "string"
8743
- },
8744
- {
8745
- "path": "precision",
8746
- "valueType": "number"
8747
- }
8748
- ],
8830
+ "ambient-light-sensor": [{
8831
+ "path": "lux",
8832
+ "valueType": "number"
8833
+ }],
8749
8834
  "audio-metrics": [
8750
8835
  {
8751
8836
  "path": "ts",
@@ -8825,6 +8910,10 @@ Object.freeze({
8825
8910
  "path": "lastUpdated",
8826
8911
  "valueType": "number"
8827
8912
  },
8913
+ {
8914
+ "path": "volts",
8915
+ "valueType": "number"
8916
+ },
8828
8917
  {
8829
8918
  "path": "lastContactAt",
8830
8919
  "valueType": "number"
@@ -9067,10 +9156,6 @@ Object.freeze({
9067
9156
  "datetime"
9068
9157
  ]
9069
9158
  },
9070
- {
9071
- "path": "unit",
9072
- "valueType": "string"
9073
- },
9074
9159
  {
9075
9160
  "path": "min",
9076
9161
  "valueType": "number"
@@ -9082,19 +9167,6 @@ Object.freeze({
9082
9167
  {
9083
9168
  "path": "step",
9084
9169
  "valueType": "number"
9085
- },
9086
- {
9087
- "path": "precision",
9088
- "valueType": "number"
9089
- },
9090
- {
9091
- "path": "format",
9092
- "valueType": "enum",
9093
- "enumValues": [
9094
- "date",
9095
- "time",
9096
- "datetime"
9097
- ]
9098
9170
  }
9099
9171
  ],
9100
9172
  "cover": [
@@ -9335,13 +9407,8 @@ Object.freeze({
9335
9407
  "path": "value",
9336
9408
  "valueType": "string"
9337
9409
  }, {
9338
- "path": "format",
9339
- "valueType": "enum",
9340
- "enumValues": [
9341
- "date",
9342
- "time",
9343
- "datetime"
9344
- ]
9410
+ "path": "timestamp",
9411
+ "valueType": "boolean"
9345
9412
  }],
9346
9413
  "event-emitter": [
9347
9414
  {
@@ -9414,6 +9481,20 @@ Object.freeze({
9414
9481
  "path": "detected",
9415
9482
  "valueType": "boolean"
9416
9483
  }],
9484
+ "group-status": [
9485
+ {
9486
+ "path": "included",
9487
+ "valueType": "number"
9488
+ },
9489
+ {
9490
+ "path": "excluded",
9491
+ "valueType": "number"
9492
+ },
9493
+ {
9494
+ "path": "total",
9495
+ "valueType": "number"
9496
+ }
9497
+ ],
9417
9498
  "heating-valve": [{
9418
9499
  "path": "position",
9419
9500
  "valueType": "number"
@@ -9448,20 +9529,10 @@ Object.freeze({
9448
9529
  "valueType": "number"
9449
9530
  }
9450
9531
  ],
9451
- "humidity-sensor": [
9452
- {
9453
- "path": "percent",
9454
- "valueType": "number"
9455
- },
9456
- {
9457
- "path": "unit",
9458
- "valueType": "string"
9459
- },
9460
- {
9461
- "path": "precision",
9462
- "valueType": "number"
9463
- }
9464
- ],
9532
+ "humidity-sensor": [{
9533
+ "path": "percent",
9534
+ "valueType": "number"
9535
+ }],
9465
9536
  "image": [{
9466
9537
  "path": "url",
9467
9538
  "valueType": "string"
@@ -9800,20 +9871,10 @@ Object.freeze({
9800
9871
  "valueType": "boolean"
9801
9872
  }
9802
9873
  ],
9803
- "numeric-sensor": [
9804
- {
9805
- "path": "value",
9806
- "valueType": "number"
9807
- },
9808
- {
9809
- "path": "unit",
9810
- "valueType": "string"
9811
- },
9812
- {
9813
- "path": "precision",
9814
- "valueType": "number"
9815
- }
9816
- ],
9874
+ "numeric-sensor": [{
9875
+ "path": "value",
9876
+ "valueType": "number"
9877
+ }],
9817
9878
  "pet-feeder": [
9818
9879
  {
9819
9880
  "path": "foodLevel",
@@ -9905,14 +9966,6 @@ Object.freeze({
9905
9966
  {
9906
9967
  "path": "powerFactor",
9907
9968
  "valueType": "number"
9908
- },
9909
- {
9910
- "path": "unit",
9911
- "valueType": "string"
9912
- },
9913
- {
9914
- "path": "precision",
9915
- "valueType": "number"
9916
9969
  }
9917
9970
  ],
9918
9971
  "presence": [
@@ -9941,20 +9994,10 @@ Object.freeze({
9941
9994
  "valueType": "number"
9942
9995
  }
9943
9996
  ],
9944
- "pressure-sensor": [
9945
- {
9946
- "path": "hpa",
9947
- "valueType": "number"
9948
- },
9949
- {
9950
- "path": "unit",
9951
- "valueType": "string"
9952
- },
9953
- {
9954
- "path": "precision",
9955
- "valueType": "number"
9956
- }
9957
- ],
9997
+ "pressure-sensor": [{
9998
+ "path": "hpa",
9999
+ "valueType": "number"
10000
+ }],
9958
10001
  "privacy-mask": [{
9959
10002
  "path": "enabled",
9960
10003
  "valueType": "boolean"
@@ -10265,20 +10308,10 @@ Object.freeze({
10265
10308
  "path": "tampered",
10266
10309
  "valueType": "boolean"
10267
10310
  }],
10268
- "temperature-sensor": [
10269
- {
10270
- "path": "celsius",
10271
- "valueType": "number"
10272
- },
10273
- {
10274
- "path": "unit",
10275
- "valueType": "string"
10276
- },
10277
- {
10278
- "path": "precision",
10279
- "valueType": "number"
10280
- }
10281
- ],
10311
+ "temperature-sensor": [{
10312
+ "path": "celsius",
10313
+ "valueType": "number"
10314
+ }],
10282
10315
  "update": [
10283
10316
  {
10284
10317
  "path": "currentVersion",
@@ -10389,10 +10422,6 @@ Object.freeze({
10389
10422
  "path": "temperature",
10390
10423
  "valueType": "number"
10391
10424
  },
10392
- {
10393
- "path": "temperatureUnit",
10394
- "valueType": "string"
10395
- },
10396
10425
  {
10397
10426
  "path": "humidity",
10398
10427
  "valueType": "number"
@@ -10401,18 +10430,10 @@ Object.freeze({
10401
10430
  "path": "pressure",
10402
10431
  "valueType": "number"
10403
10432
  },
10404
- {
10405
- "path": "pressureUnit",
10406
- "valueType": "string"
10407
- },
10408
10433
  {
10409
10434
  "path": "windSpeed",
10410
10435
  "valueType": "number"
10411
10436
  },
10412
- {
10413
- "path": "windSpeedUnit",
10414
- "valueType": "string"
10415
- },
10416
10437
  {
10417
10438
  "path": "windBearing",
10418
10439
  "valueType": "number"
@@ -10819,7 +10840,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
10819
10840
  return DeviceRole;
10820
10841
  }({});
10821
10842
  //#endregion
10822
- //#region ../types/dist/composition-kEl9mevu.mjs
10843
+ //#region ../types/dist/composition-OhpuespA.mjs
10823
10844
  /**
10824
10845
  * The ffmpeg build every CamStack node downloads, per platform and arch.
10825
10846
  *
@@ -11574,15 +11595,74 @@ function validateExpressionSource(src) {
11574
11595
  }
11575
11596
  return null;
11576
11597
  }
11577
- /** A composed device's stableId is this prefix plus the block id. */
11578
- var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
11579
- /** Longest snippet a `code` source may carry (slice 4). */
11580
- var MAX_COMPOSITION_CODE_LENGTH = 2e4;
11598
+ /**
11599
+ * A composition source identity: `(addonId, stableId)`, never a numeric device
11600
+ * id. Split out so helper schemas can name it without a cycle through
11601
+ * `composition.ts` (D659).
11602
+ */
11581
11603
  var CompositionSourceRefSchema = object({
11582
11604
  /** The owning addon; `stableId` is unique only within it. */
11583
11605
  addonId: string().min(1),
11584
11606
  stableId: string().min(1)
11585
11607
  });
11608
+ var GROUP_TEMPLATE_IDS = [
11609
+ "temperature",
11610
+ "humidity",
11611
+ "pressure",
11612
+ "illuminance",
11613
+ "power",
11614
+ "energy",
11615
+ "battery",
11616
+ "numeric",
11617
+ "motion",
11618
+ "contact",
11619
+ "leak",
11620
+ "smoke",
11621
+ "occupancy",
11622
+ "binary",
11623
+ "switch",
11624
+ "light"
11625
+ ];
11626
+ var NUMERIC_AGGREGATES = [
11627
+ "mean",
11628
+ "median",
11629
+ "min",
11630
+ "max",
11631
+ "sum"
11632
+ ];
11633
+ var BINARY_AGGREGATES = ["any", "all"];
11634
+ /** How an actuator group decides it is on. Unknown members never count as off. */
11635
+ var ACTIVE_CRITERIA = ["at-least-one", "all"];
11636
+ var AGGREGATE_REDUCERS = [
11637
+ "mean",
11638
+ "median",
11639
+ "min",
11640
+ "max",
11641
+ "sum",
11642
+ "any",
11643
+ "all"
11644
+ ];
11645
+ var GroupTemplateIdSchema = _enum(GROUP_TEMPLATE_IDS);
11646
+ var AggregateReducerSchema = _enum(AGGREGATE_REDUCERS);
11647
+ var ActiveCriterionSchema = _enum(ACTIVE_CRITERIA);
11648
+ /** One member. The field is stored so occupancy can name motion or binary. */
11649
+ var HelperMemberSchema = object({
11650
+ source: CompositionSourceRefSchema,
11651
+ cap: string().min(1),
11652
+ fieldPath: string().min(1)
11653
+ });
11654
+ var HelperSpecSchema = discriminatedUnion("kind", [object({
11655
+ kind: literal("group"),
11656
+ templateId: GroupTemplateIdSchema,
11657
+ aggregate: AggregateReducerSchema,
11658
+ members: array(HelperMemberSchema).min(1).max(64),
11659
+ /** Actuator groups only. Readings leave this unset. */
11660
+ active: ActiveCriterionSchema.optional()
11661
+ })]);
11662
+ /** A composed device's stableId is this prefix plus the block id. */
11663
+ var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
11664
+ /** Longest snippet a `code` source may carry (slice 4). */
11665
+ var MAX_COMPOSITION_CODE_LENGTH = 2e4;
11586
11666
  /** One field of one capability of one source device. */
11587
11667
  var CompositionFieldReadSchema = object({
11588
11668
  source: CompositionSourceRefSchema,
@@ -11626,7 +11706,33 @@ var CompositionCodeSourceSchema = object({
11626
11706
  var CompositionFieldSourceSchema = discriminatedUnion("kind", [
11627
11707
  CompositionFromSourceSchema,
11628
11708
  CompositionExpressionSourceSchema,
11629
- CompositionCodeSourceSchema
11709
+ CompositionCodeSourceSchema,
11710
+ object({
11711
+ kind: literal("aggregate"),
11712
+ reducer: _enum([
11713
+ "mean",
11714
+ "median",
11715
+ "min",
11716
+ "max",
11717
+ "sum",
11718
+ "any",
11719
+ "all"
11720
+ ]),
11721
+ reads: array(CompositionFieldReadSchema).min(1).max(64),
11722
+ /** `value` is the reading; the others are the member counts. */
11723
+ publish: _enum([
11724
+ "value",
11725
+ "included",
11726
+ "excluded",
11727
+ "total"
11728
+ ]),
11729
+ /** What a `value` publish does when nobody is included. Counts ignore this. */
11730
+ empty: _enum([
11731
+ "null",
11732
+ "omit",
11733
+ "offline"
11734
+ ])
11735
+ })
11630
11736
  ]);
11631
11737
  var CompositionCommandTargetSchema = discriminatedUnion("kind", [object({
11632
11738
  kind: literal("forward"),
@@ -11672,7 +11778,13 @@ var CompositionSchema = object({
11672
11778
  kind: literal("existing"),
11673
11779
  device: CompositionSourceRefSchema
11674
11780
  })]),
11675
- features: array(CompositionFeatureSchema).min(1).max(16)
11781
+ features: array(CompositionFeatureSchema).min(1).max(16),
11782
+ /**
11783
+ * Present when the block is a helper template. Absent on a free
11784
+ * composition (the room example, device 4603). The editor reads this,
11785
+ * never the compiled features.
11786
+ */
11787
+ helper: HelperSpecSchema.optional()
11676
11788
  }).superRefine((composition, ctx) => {
11677
11789
  const seen = /* @__PURE__ */ new Set();
11678
11790
  composition.features.forEach((feature, index) => {
@@ -18199,7 +18311,11 @@ var CompositionProblemSchema = object({
18199
18311
  "item-field-reserved",
18200
18312
  "target-missing",
18201
18313
  "target-unreadable",
18202
- "not-replaceable"
18314
+ "not-replaceable",
18315
+ "native-capability-replace",
18316
+ "mixed-quantity",
18317
+ "helper-mismatch",
18318
+ "member-constraint"
18203
18319
  ]),
18204
18320
  path: string(),
18205
18321
  message: string()
@@ -18220,7 +18336,8 @@ var CompositionUnavailableModeSchema = _enum([
18220
18336
  "null",
18221
18337
  "offline",
18222
18338
  "unknown",
18223
- "release"
18339
+ "release",
18340
+ "omit"
18224
18341
  ]);
18225
18342
  /**
18226
18343
  * `derived` reads a source · `clock` reads only `now`, recomputed when a sibling
@@ -18257,9 +18374,11 @@ var CompositionFieldPlanSchema = object({
18257
18374
  reads: array(CompositionFieldReadSchema)
18258
18375
  });
18259
18376
  /**
18260
- * What a feature does to its target (D663): `new` builds a capability on a new
18261
- * device; on an existing device it `add`s a capability the device lacks, or
18262
- * `replace`s named fields of one it has natively.
18377
+ * What a feature does to its target (D663, D944): `new` builds a capability on a
18378
+ * new device; on an existing device it `add`s a capability the device lacks.
18379
+ * Replacing a capability the device already serves is refused
18380
+ * (`native-capability-replace`), not planned. `replace` remains on the claim
18381
+ * wire for a claim the hub already holds.
18263
18382
  */
18264
18383
  var CompositionFeatureModeSchema = _enum([
18265
18384
  "new",
@@ -18432,6 +18551,275 @@ Object.freeze({
18432
18551
  result: ["number", "null"]
18433
18552
  }
18434
18553
  });
18554
+ /**
18555
+ * One catalog row per base reading a group helper can build (D944 §3).
18556
+ * Data, not a form default written into the block.
18557
+ */
18558
+ var NOW = {
18559
+ fieldPath: "lastFetchedAt",
18560
+ expr: "now"
18561
+ };
18562
+ var CHANGED = {
18563
+ fieldPath: "lastChangedAt",
18564
+ expr: "now"
18565
+ };
18566
+ function numeric(input) {
18567
+ return {
18568
+ ...input,
18569
+ family: "numeric",
18570
+ deviceType: DeviceType.Sensor,
18571
+ memberDeviceType: DeviceType.Sensor,
18572
+ commandCaps: [],
18573
+ baseUnit: baseUnitOf(input.quantity),
18574
+ aggregates: NUMERIC_AGGREGATES,
18575
+ accept: [{
18576
+ cap: input.outputCap,
18577
+ fieldPath: input.outputField
18578
+ }]
18579
+ };
18580
+ }
18581
+ function binary(input) {
18582
+ return {
18583
+ ...input,
18584
+ family: "binary",
18585
+ deviceType: DeviceType.Sensor,
18586
+ memberDeviceType: DeviceType.Sensor,
18587
+ commandCaps: [],
18588
+ quantity: "none",
18589
+ baseUnit: void 0,
18590
+ aggregates: BINARY_AGGREGATES,
18591
+ empty: "offline"
18592
+ };
18593
+ }
18594
+ var GROUP_TEMPLATES = [
18595
+ numeric({
18596
+ id: "temperature",
18597
+ summary: "Mean, median, min, max or sum of temperatures. Offline and unknown members are left out, never read as 0 °C.",
18598
+ role: DeviceRole.TemperatureSensor,
18599
+ outputCap: "temperature-sensor",
18600
+ outputField: "celsius",
18601
+ quantity: "temperature",
18602
+ defaultAggregate: "mean",
18603
+ empty: "null",
18604
+ companions: [NOW]
18605
+ }),
18606
+ numeric({
18607
+ id: "humidity",
18608
+ summary: "Humidity in percent. Offline and unknown members are left out, never read as 0 %.",
18609
+ role: DeviceRole.HumiditySensor,
18610
+ outputCap: "humidity-sensor",
18611
+ outputField: "percent",
18612
+ quantity: "humidity",
18613
+ defaultAggregate: "mean",
18614
+ empty: "null",
18615
+ companions: [NOW]
18616
+ }),
18617
+ numeric({
18618
+ id: "pressure",
18619
+ summary: "Pressure in hectopascals. Offline and unknown members are left out, never read as 0 hPa.",
18620
+ role: DeviceRole.PressureSensor,
18621
+ outputCap: "pressure-sensor",
18622
+ outputField: "hpa",
18623
+ quantity: "pressure",
18624
+ defaultAggregate: "mean",
18625
+ empty: "null",
18626
+ companions: [NOW]
18627
+ }),
18628
+ numeric({
18629
+ id: "illuminance",
18630
+ summary: "Illuminance in lux. Offline and unknown members are left out, never read as 0 lx.",
18631
+ role: DeviceRole.AmbientLightSensor,
18632
+ outputCap: "ambient-light-sensor",
18633
+ outputField: "lux",
18634
+ quantity: "illuminance",
18635
+ defaultAggregate: "mean",
18636
+ empty: "null",
18637
+ companions: [NOW]
18638
+ }),
18639
+ numeric({
18640
+ id: "power",
18641
+ summary: "Power in watts, summed by default. Nobody reporting omits the key rather than writing 0 W.",
18642
+ role: DeviceRole.PowerSensor,
18643
+ outputCap: "power-meter",
18644
+ outputField: "watts",
18645
+ quantity: "power",
18646
+ defaultAggregate: "sum",
18647
+ empty: "omit",
18648
+ companions: [NOW]
18649
+ }),
18650
+ numeric({
18651
+ id: "energy",
18652
+ summary: "Energy in kilowatt-hours, summed by default. Nobody reporting omits the key rather than writing 0 kWh.",
18653
+ role: DeviceRole.EnergySensor,
18654
+ outputCap: "power-meter",
18655
+ outputField: "kwhTotal",
18656
+ quantity: "energy",
18657
+ defaultAggregate: "sum",
18658
+ empty: "omit",
18659
+ companions: [NOW]
18660
+ }),
18661
+ numeric({
18662
+ id: "battery",
18663
+ summary: "Battery charge in percent. Offline and unknown members are left out, never read as 0 %.",
18664
+ role: DeviceRole.BatterySensor,
18665
+ outputCap: "battery",
18666
+ outputField: "percentage",
18667
+ quantity: "percentage",
18668
+ defaultAggregate: "mean",
18669
+ empty: "null",
18670
+ companions: [
18671
+ {
18672
+ fieldPath: "charging",
18673
+ expr: "\"unknown\""
18674
+ },
18675
+ {
18676
+ fieldPath: "sleeping",
18677
+ expr: "false"
18678
+ },
18679
+ {
18680
+ fieldPath: "lastUpdated",
18681
+ expr: "now"
18682
+ }
18683
+ ]
18684
+ }),
18685
+ numeric({
18686
+ id: "numeric",
18687
+ summary: "A numeric reading in the members’ shared quantity. Mixed quantities are refused. Nobody reporting publishes null, not 0.",
18688
+ role: DeviceRole.NumericSensor,
18689
+ outputCap: "numeric-sensor",
18690
+ outputField: "value",
18691
+ quantity: "device",
18692
+ defaultAggregate: "mean",
18693
+ empty: "null",
18694
+ companions: [NOW]
18695
+ }),
18696
+ binary({
18697
+ id: "motion",
18698
+ summary: "Any or all motion. Offline and unknown members are left out, never read as off. Nobody reporting takes the device offline.",
18699
+ role: DeviceRole.MotionSensor,
18700
+ outputCap: "motion",
18701
+ outputField: "detected",
18702
+ defaultAggregate: "any",
18703
+ accept: [{
18704
+ cap: "motion",
18705
+ fieldPath: "detected"
18706
+ }],
18707
+ companions: [{
18708
+ fieldPath: "lastDetectedAt",
18709
+ expr: "null"
18710
+ }, {
18711
+ fieldPath: "autoClearAfterMs",
18712
+ expr: "null"
18713
+ }]
18714
+ }),
18715
+ binary({
18716
+ id: "contact",
18717
+ summary: "Any or all open contacts. Offline and unknown members are left out, never read as closed.",
18718
+ role: DeviceRole.ContactSensor,
18719
+ outputCap: "contact",
18720
+ outputField: "entryOpen",
18721
+ defaultAggregate: "any",
18722
+ accept: [{
18723
+ cap: "contact",
18724
+ fieldPath: "entryOpen"
18725
+ }],
18726
+ companions: [CHANGED]
18727
+ }),
18728
+ binary({
18729
+ id: "leak",
18730
+ summary: "Any or all leak detections. Offline and unknown members are left out, never read as dry.",
18731
+ role: DeviceRole.LeakSensor,
18732
+ outputCap: "flood",
18733
+ outputField: "flooded",
18734
+ defaultAggregate: "any",
18735
+ accept: [{
18736
+ cap: "flood",
18737
+ fieldPath: "flooded"
18738
+ }],
18739
+ companions: [CHANGED]
18740
+ }),
18741
+ binary({
18742
+ id: "smoke",
18743
+ summary: "Any or all smoke detections. Offline and unknown members are left out, never read as clear.",
18744
+ role: DeviceRole.SmokeSensor,
18745
+ outputCap: "smoke",
18746
+ outputField: "detected",
18747
+ defaultAggregate: "any",
18748
+ accept: [{
18749
+ cap: "smoke",
18750
+ fieldPath: "detected"
18751
+ }],
18752
+ companions: [CHANGED]
18753
+ }),
18754
+ binary({
18755
+ id: "occupancy",
18756
+ summary: "Any or all of motion or binary sensors, published as a binary. Presence zones are not aggregated. Nobody reporting is offline, not off.",
18757
+ role: DeviceRole.BinarySensor,
18758
+ outputCap: "binary",
18759
+ outputField: "on",
18760
+ defaultAggregate: "any",
18761
+ accept: [{
18762
+ cap: "motion",
18763
+ fieldPath: "detected"
18764
+ }, {
18765
+ cap: "binary",
18766
+ fieldPath: "on"
18767
+ }],
18768
+ companions: [CHANGED]
18769
+ }),
18770
+ binary({
18771
+ id: "binary",
18772
+ summary: "Any or all generic binary sensors. Offline and unknown members are left out, never read as off.",
18773
+ role: DeviceRole.BinarySensor,
18774
+ outputCap: "binary",
18775
+ outputField: "on",
18776
+ defaultAggregate: "any",
18777
+ accept: [{
18778
+ cap: "binary",
18779
+ fieldPath: "on"
18780
+ }],
18781
+ companions: [CHANGED]
18782
+ }),
18783
+ actuator({
18784
+ id: "switch",
18785
+ summary: "On when at least one switch is on, or when all of them are. Offline and unknown members are left out of that decision, never read as off, and still receive the command.",
18786
+ deviceType: DeviceType.Switch,
18787
+ outputCap: "switch",
18788
+ commandCaps: ["switch"]
18789
+ }),
18790
+ actuator({
18791
+ id: "light",
18792
+ summary: "On when at least one light is on, or when all of them are. Brightness and colour are offered only when every member has them. A command is not sent to a member that lacks it.",
18793
+ deviceType: DeviceType.Light,
18794
+ outputCap: "switch",
18795
+ commandCaps: [
18796
+ "switch",
18797
+ "brightness",
18798
+ "color"
18799
+ ]
18800
+ })
18801
+ ];
18802
+ function actuator(input) {
18803
+ return {
18804
+ ...input,
18805
+ family: "actuator",
18806
+ role: void 0,
18807
+ memberDeviceType: input.deviceType,
18808
+ outputField: "on",
18809
+ quantity: "none",
18810
+ baseUnit: void 0,
18811
+ aggregates: BINARY_AGGREGATES,
18812
+ defaultAggregate: "any",
18813
+ empty: "offline",
18814
+ accept: [{
18815
+ cap: "switch",
18816
+ fieldPath: "on"
18817
+ }],
18818
+ companions: [CHANGED]
18819
+ };
18820
+ }
18821
+ new Map(GROUP_TEMPLATES.map((template) => [template.id, template]));
18822
+ DeviceFeature.LightColorRgb, DeviceFeature.LightColorHsv, DeviceFeature.LightColorMired;
18435
18823
  `${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
18436
18824
  /**
18437
18825
  * What a composition may BUILD on a device type (G2, D676): the caps a new
@@ -20258,12 +20646,12 @@ function buildDeviceAdminUrl(parts) {
20258
20646
  * providers detect renames by matching `uniqueId` and patch `id`
20259
20647
  * in-place so dispatch keeps working.
20260
20648
  *
20261
- * **Rendering metadata is NOT stored here.** Display fields (`unit`,
20262
- * `precision`) live in the cap STATUS SLICE so they flow live with every
20263
- * state push and are the single source of truth. The `device_class` tag is
20264
- * an HA-specific input that is consumed at the discovery boundary
20265
- * (`ha-domain-mapping`) to derive the CamStack `DeviceRole`; it is never
20266
- * stored after that point.
20649
+ * **Display unit and precision are NOT stored here.** They are a read-time
20650
+ * preference (D944). A polymorphic reading stores its `quantity` here once,
20651
+ * at adopt, and a date/time value stores `dateTimeShape` the same way —
20652
+ * neither is repeated on each sample. The `device_class` tag is an
20653
+ * HA-specific input consumed at the discovery boundary (`ha-domain-mapping`)
20654
+ * to derive the CamStack `DeviceRole`; it is never stored after that point.
20267
20655
  *
20268
20656
  * The `raw` escape hatch carries provider-specific attributes that don't
20269
20657
  * fit the structured slots (HA `attributes` whitelist, Reolink `deviceCache`
@@ -20277,6 +20665,14 @@ var SourceInfoSchema = object({
20277
20665
  /** Immutable upstream identifier when available (HA `unique_id`, … ).
20278
20666
  * Used to detect rename when `id` changes. */
20279
20667
  uniqueId: string().optional(),
20668
+ /** Quantity of a polymorphic reading, written once at adopt (D944). */
20669
+ quantity: ReadingQuantitySchema.optional(),
20670
+ /** Date / time / datetime shape of a string reading, written once at adopt. */
20671
+ dateTimeShape: _enum([
20672
+ "date",
20673
+ "time",
20674
+ "datetime"
20675
+ ]).optional(),
20280
20676
  /** Provider-specific extras that don't fit the structured slots.
20281
20677
  * Whitelist what goes here per provider — do NOT dump entire HA
20282
20678
  * attribute blobs (would explode the meta JSON column). */
@@ -41381,7 +41777,8 @@ method(object({
41381
41777
  "enum"
41382
41778
  ]),
41383
41779
  enumValues: array(string()).optional(),
41384
- item: boolean().optional()
41780
+ item: boolean().optional(),
41781
+ quantity: ReadingQuantitySchema.optional()
41385
41782
  })).readonly(),
41386
41783
  itemArray: object({
41387
41784
  path: string(),
@@ -45244,8 +45641,8 @@ var MaskPolygonShapeSchema = object({
45244
45641
  /** Boolean cell grid — row-major, length === gridWidth*gridHeight. */
45245
45642
  var MaskGridShapeSchema = object({
45246
45643
  kind: literal("grid"),
45247
- gridWidth: number(),
45248
- gridHeight: number(),
45644
+ gridWidth: number().meta(readingMeta("none")),
45645
+ gridHeight: number().meta(readingMeta("none")),
45249
45646
  cells: array(boolean())
45250
45647
  });
45251
45648
  discriminatedUnion("kind", [
@@ -45357,6 +45754,8 @@ var NcSystemEventKindSchema = _enum([
45357
45754
  "detection-blind",
45358
45755
  "motion-noisy",
45359
45756
  "motion-calm",
45757
+ "package-llm-silent",
45758
+ "package-llm-answered",
45360
45759
  "recording-stalled",
45361
45760
  "recording-healthy",
45362
45761
  "recording-degraded",
@@ -56970,6 +57369,28 @@ var PackageVersionInfoSchema = object({
56970
57369
  deprecated: string().optional(),
56971
57370
  distTags: array(string()).readonly()
56972
57371
  });
57372
+ /**
57373
+ * One published document. `ok` is markdown from the registry. `missing` means
57374
+ * the registry answered and the file was not there. `error` is a registry or
57375
+ * tarball failure — never an empty string standing in for either.
57376
+ */
57377
+ var PackageDocBodySchema = discriminatedUnion("status", [
57378
+ object({
57379
+ status: literal("ok"),
57380
+ markdown: string()
57381
+ }),
57382
+ object({ status: literal("missing") }),
57383
+ object({
57384
+ status: literal("error"),
57385
+ message: string()
57386
+ })
57387
+ ]);
57388
+ var PackageDocsSchema = object({
57389
+ name: string(),
57390
+ version: string(),
57391
+ readme: PackageDocBodySchema,
57392
+ changelog: PackageDocBodySchema
57393
+ });
56973
57394
  var SearchResultSchema = object({
56974
57395
  name: string(),
56975
57396
  version: string(),
@@ -57188,7 +57609,10 @@ method(object({ nodeId: string().optional() }).optional(), array(AddonListItemSc
57188
57609
  }), object({ success: literal(true) }), {
57189
57610
  kind: "mutation",
57190
57611
  auth: "admin"
57191
- }), method(object({ name: string() }), array(PackageVersionInfoSchema).readonly()), method(object({ addonId: string() }), RestartAddonResultSchema, {
57612
+ }), method(object({ name: string() }), array(PackageVersionInfoSchema).readonly()), method(object({
57613
+ name: string().min(1),
57614
+ version: string().min(1).optional()
57615
+ }), PackageDocsSchema, { auth: "admin" }), method(object({ addonId: string() }), RestartAddonResultSchema, {
57192
57616
  kind: "mutation",
57193
57617
  auth: "admin"
57194
57618
  }), method(object({ packageName: string() }), object({ success: literal(true) }), {
@@ -57247,27 +57671,17 @@ method(object({ nodeId: string().optional() }).optional(), array(AddonListItemSc
57247
57671
  */
57248
57672
  var AirQualitySensorStatusSchema = object({
57249
57673
  /** Carbon dioxide concentration in ppm. */
57250
- co2Ppm: number().min(0).optional(),
57674
+ co2Ppm: number().min(0).optional().meta(readingMeta("concentration-volume")),
57251
57675
  /** Total volatile organic compounds in ppb. */
57252
- vocPpb: number().min(0).optional(),
57676
+ vocPpb: number().min(0).optional().meta(readingMeta("concentration-ppb")),
57253
57677
  /** Particulate matter ≤ 2.5 μm in µg/m³. */
57254
- pm25: number().min(0).optional(),
57678
+ pm25: number().min(0).optional().meta(readingMeta("concentration-mass")),
57255
57679
  /** Particulate matter ≤ 10 μm in µg/m³. */
57256
- pm10: number().min(0).optional(),
57680
+ pm10: number().min(0).optional().meta(readingMeta("concentration-mass")),
57257
57681
  /** Composite AQI value (typically 0..500). */
57258
- aqi: number().optional(),
57682
+ aqi: number().optional().meta(readingMeta("index")),
57259
57683
  /** Ms epoch when the slice was last updated. */
57260
- lastFetchedAt: number(),
57261
- /** Live display unit of the single metric this slice carries (e.g. HA
57262
- * `attributes.unit_of_measurement` → 'ppm' / 'ppb' / 'µg/m³'). Each
57263
- * upstream `sensor.*` entity surfaces ONE device_class, so one unit
57264
- * per slice is unambiguous. */
57265
- unit: string().optional(),
57266
- /** Suggested decimal places for numeric display.
57267
- * Populated live from the upstream source when provided (e.g. HA
57268
- * `attributes.suggested_display_precision`). Falls back to
57269
- * auto-formatting when absent. */
57270
- precision: number().int().min(0).max(10).optional()
57684
+ lastFetchedAt: number()
57271
57685
  });
57272
57686
  var airQualitySensorCapability = {
57273
57687
  name: "air-quality-sensor",
@@ -57304,12 +57718,12 @@ var airQualitySensorCapability = {
57304
57718
  },
57305
57719
  pm25: {
57306
57720
  kind: "gauge",
57307
- unit: "ug/m3",
57721
+ unit: "µg/m³",
57308
57722
  deadband: 1
57309
57723
  },
57310
57724
  pm10: {
57311
57725
  kind: "gauge",
57312
- unit: "ug/m3",
57726
+ unit: "µg/m³",
57313
57727
  deadband: 1
57314
57728
  },
57315
57729
  aqi: {
@@ -57327,22 +57741,13 @@ var airQualitySensorCapability = {
57327
57741
  * entries with `device_class: illuminance`.
57328
57742
  */
57329
57743
  var AmbientLightSensorStatusSchema = object({
57330
- /** Current illuminance in lux (lx). */
57331
- lux: number().min(0).meta({
57332
- unit: "lx",
57744
+ /** Current illuminance in lux (lx). `null` when the sample was refused (D393). */
57745
+ lux: number().min(0).nullable().meta(readingMeta("illuminance", {
57746
+ precision: 0,
57333
57747
  label: "Illuminance"
57334
- }),
57748
+ })),
57335
57749
  /** Ms epoch when the slice was last updated. */
57336
- lastFetchedAt: number(),
57337
- /** Live display unit from the upstream source (e.g. HA
57338
- * `attributes.unit_of_measurement`). The UI prefers this over the
57339
- * role's canonical unit. Absent → fall back to the canonical unit. */
57340
- unit: string().optional(),
57341
- /** Suggested decimal places for numeric display.
57342
- * Populated live from the upstream source when provided (e.g. HA
57343
- * `attributes.suggested_display_precision`). Falls back to
57344
- * auto-formatting when absent. */
57345
- precision: number().int().min(0).max(10).optional()
57750
+ lastFetchedAt: number()
57346
57751
  });
57347
57752
  var ambientLightSensorCapability = {
57348
57753
  name: "ambient-light-sensor",
@@ -57374,12 +57779,7 @@ var ambientLightSensorCapability = {
57374
57779
  } } },
57375
57780
  /** Clock fields: written, but excluded from the compare that decides
57376
57781
  * whether persisting is worth a SQLite commit. */
57377
- volatileStateFields: ["lastFetchedAt"],
57378
- customize: {
57379
- version: 1,
57380
- advanced: "derive",
57381
- targets: []
57382
- }
57782
+ volatileStateFields: ["lastFetchedAt"]
57383
57783
  };
57384
57784
  /**
57385
57785
  * Per-class audio metrics aggregated over a sliding window.
@@ -57606,10 +58006,7 @@ var BatteryStatusSchema = object({
57606
58006
  * Consumers must SKIP a null rather than coerce it — `battery-band` already
57607
58007
  * declines to band a non-finite reading, which is the correct shape.
57608
58008
  */
57609
- percentage: number().min(0).max(100).nullable().meta({
57610
- unit: "%",
57611
- label: "Charge"
57612
- }),
58009
+ percentage: number().min(0).max(100).nullable().meta(readingMeta("percentage", { label: "Charge" })),
57613
58010
  /**
57614
58011
  * Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
57615
58012
  * Reolink-specific for the Solar Panel 2 accessory (will become
@@ -57636,7 +58033,14 @@ var BatteryStatusSchema = object({
57636
58033
  */
57637
58034
  sleeping: boolean().meta({ label: "Sleeping" }),
57638
58035
  /** Ms epoch of the last observation. Lets consumers reason about freshness. */
57639
- lastUpdated: number(),
58036
+ lastUpdated: number().meta(readingMeta("none")),
58037
+ /**
58038
+ * Battery voltage in volts, for a cell the firmware reports as voltage
58039
+ * rather than a percentage (Ecowitt capacitor packs). Absent on cameras
58040
+ * that only report charge. A second reading on this cap, not a second
58041
+ * `numeric-sensor` on the same device.
58042
+ */
58043
+ volts: number().nullable().optional().meta(readingMeta("voltage", { label: "Voltage" })),
57640
58044
  /**
57641
58045
  * Ms epoch of the last time the device PROVED it was reachable — a
57642
58046
  * completed firmware round-trip, an observed wake, or an inbound push
@@ -57688,7 +58092,6 @@ var BATTERY_DEVICE_TYPES = [
57688
58092
  /** Generic Customize target for the percentage reading (D936). */
57689
58093
  var batteryCustomize = {
57690
58094
  version: 1,
57691
- advanced: "derive",
57692
58095
  targets: [{
57693
58096
  id: "percentage",
57694
58097
  cardinality: "scalar",
@@ -57697,7 +58100,7 @@ var batteryCustomize = {
57697
58100
  stateField: "percentage"
57698
58101
  },
57699
58102
  deviceTypes: BATTERY_DEVICE_TYPES,
57700
- apply: "add-or-replace",
58103
+ apply: "add",
57701
58104
  path: "percentage",
57702
58105
  sources: [{
57703
58106
  kind: "field",
@@ -57818,10 +58221,16 @@ onStatusChanged: { data: object({
57818
58221
  /**
57819
58222
  * History (D850): recorded series. The generic capture replaces the `battery` series of `pipeline-analytics:stats-5m`.
57820
58223
  */
57821
- history: { fields: { percentage: {
57822
- kind: "gauge",
57823
- unit: "%"
57824
- } } },
58224
+ history: { fields: {
58225
+ percentage: {
58226
+ kind: "gauge",
58227
+ unit: "%"
58228
+ },
58229
+ volts: {
58230
+ kind: "gauge",
58231
+ unit: "V"
58232
+ }
58233
+ } },
57825
58234
  customize: batteryCustomize,
57826
58235
  /** Clock fields: written, but excluded from the compare that decides
57827
58236
  * whether persisting is worth a SQLite commit. */
@@ -57868,12 +58277,7 @@ var binaryCapability = {
57868
58277
  history: { fields: { on: { kind: "boolean" } } },
57869
58278
  /** Clock fields: written, but excluded from the compare that decides
57870
58279
  * whether persisting is worth a SQLite commit. */
57871
- volatileStateFields: ["lastChangedAt"],
57872
- customize: {
57873
- version: 1,
57874
- advanced: "derive",
57875
- targets: []
57876
- }
58280
+ volatileStateFields: ["lastChangedAt"]
57877
58281
  };
57878
58282
  /**
57879
58283
  * Dimmable-light brightness control. Co-exists with `switch` on the
@@ -57889,7 +58293,7 @@ var binaryCapability = {
57889
58293
  */
57890
58294
  var BrightnessStatusSchema = object({
57891
58295
  /** Current level as 0..100 inclusive. Firmware-reported. */
57892
- percentage: number().min(0).max(100),
58296
+ percentage: number().min(0).max(100).meta(readingMeta("percentage")),
57893
58297
  /** Ms epoch of the last operator-driven change. Useful for UI freshness. */
57894
58298
  lastChangedAt: number()
57895
58299
  });
@@ -58343,21 +58747,21 @@ var ClimateControlStatusSchema = object({
58343
58747
  /** Single setpoint in Celsius. Used by single-target modes
58344
58748
  * (heat / cool / dry). Null when the device is in a range mode
58345
58749
  * (`heat_cool`) or has no setpoint at all (`fan_only`/`off`). */
58346
- target: number().nullable(),
58750
+ target: number().nullable().meta(readingMeta("temperature")),
58347
58751
  /** Upper bound of the dual setpoint in Celsius. Populated only
58348
58752
  * in `heat_cool` mode. */
58349
- targetHigh: number().nullable(),
58753
+ targetHigh: number().nullable().meta(readingMeta("temperature")),
58350
58754
  /** Lower bound of the dual setpoint in Celsius. Populated only
58351
58755
  * in `heat_cool` mode. */
58352
- targetLow: number().nullable(),
58756
+ targetLow: number().nullable().meta(readingMeta("temperature")),
58353
58757
  /** Target relative humidity (0..100). Null when the device has no
58354
58758
  * humidity control. */
58355
- targetHumidity: number().min(0).max(100).nullable(),
58759
+ targetHumidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
58356
58760
  /** Current measured temperature in Celsius. Read-only — pushed by
58357
58761
  * the device's internal sensor. */
58358
- currentTemp: number().nullable(),
58762
+ currentTemp: number().nullable().meta(readingMeta("temperature")),
58359
58763
  /** Current measured relative humidity (0..100). Read-only. */
58360
- currentHumidity: number().min(0).max(100).nullable(),
58764
+ currentHumidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
58361
58765
  /** Vertical louver swing on/off. Null when the device has no vertical
58362
58766
  * swing surface (gate with `DeviceFeature.ClimateSwingVertical`). */
58363
58767
  swingVertical: boolean().nullable(),
@@ -58365,11 +58769,11 @@ var ClimateControlStatusSchema = object({
58365
58769
  * horizontal swing surface (gate with `DeviceFeature.ClimateSwingHorizontal`). */
58366
58770
  swingHorizontal: boolean().nullable(),
58367
58771
  /** Lowest setpoint the device accepts, Celsius. Absent / null = not reported. */
58368
- minTemp: number().nullable().optional(),
58772
+ minTemp: number().nullable().optional().meta(readingMeta("temperature")),
58369
58773
  /** Highest setpoint the device accepts, Celsius. Absent / null = not reported. */
58370
- maxTemp: number().nullable().optional(),
58774
+ maxTemp: number().nullable().optional().meta(readingMeta("temperature")),
58371
58775
  /** Setpoint granularity, Celsius (0.5, 1). Absent / null = not reported. */
58372
- tempStep: number().positive().nullable().optional(),
58776
+ tempStep: number().positive().nullable().optional().meta(readingMeta("temperature")),
58373
58777
  /** Ms epoch when the slice was last updated (push or command). */
58374
58778
  lastFetchedAt: number()
58375
58779
  });
@@ -58511,17 +58915,17 @@ var climateControlCapability = {
58511
58915
  * modes to expose in the picker without a slice fetch.
58512
58916
  */
58513
58917
  var RgbTripletSchema = object({
58514
- r: number().int().min(0).max(255),
58515
- g: number().int().min(0).max(255),
58516
- b: number().int().min(0).max(255)
58918
+ r: number().int().min(0).max(255).meta(readingMeta("none")),
58919
+ g: number().int().min(0).max(255).meta(readingMeta("none")),
58920
+ b: number().int().min(0).max(255).meta(readingMeta("none"))
58517
58921
  });
58518
58922
  var HsvTripletSchema = object({
58519
58923
  /** Hue in degrees, 0..360. */
58520
- h: number().min(0).max(360),
58924
+ h: number().min(0).max(360).meta(readingMeta("none")),
58521
58925
  /** Saturation as 0..100 inclusive. */
58522
- s: number().min(0).max(100),
58926
+ s: number().min(0).max(100).meta(readingMeta("none")),
58523
58927
  /** Value/brightness as 0..100 inclusive. */
58524
- v: number().min(0).max(100)
58928
+ v: number().min(0).max(100).meta(readingMeta("none"))
58525
58929
  });
58526
58930
  var ColorInputSchema = discriminatedUnion("mode", [
58527
58931
  object({
@@ -58550,7 +58954,7 @@ var ColorStatusSchema = object({
58550
58954
  /** Populated when `mode === 'hsv'`. */
58551
58955
  hsv: HsvTripletSchema.optional(),
58552
58956
  /** Populated when `mode === 'mired'`. */
58553
- mireds: number().int().optional(),
58957
+ mireds: number().int().optional().meta(readingMeta("colour-temperature")),
58554
58958
  /** Ms epoch of the last operator-driven change. */
58555
58959
  lastChangedAt: number()
58556
58960
  });
@@ -58745,18 +59149,12 @@ _enum([
58745
59149
  "empty",
58746
59150
  "full"
58747
59151
  ]);
58748
- /** Units a remaining-life counter is reported in. Closed: the panel renders
58749
- * each. */
58750
- var ConsumableRemainingUnitSchema = _enum([
58751
- "days",
58752
- "hours",
58753
- "cycles"
58754
- ]);
58755
- /** Remaining life as a COUNT, not a percentage (the PetKit desiccant reports
58756
- * days). `value` null = unknown (D393). */
59152
+ /** Whether `remaining.value` is a duration in seconds or a dimensionless count. */
59153
+ var ConsumableRemainingKindSchema = _enum(["duration", "count"]);
59154
+ /** Remaining life. `value` null = unknown (D393). Duration is seconds. */
58757
59155
  var ConsumableRemainingSchema = object({
58758
- value: number().min(0).nullable(),
58759
- unit: ConsumableRemainingUnitSchema
59156
+ value: number().min(0).nullable().meta(readingMeta("device")),
59157
+ kind: ConsumableRemainingKindSchema
58760
59158
  });
58761
59159
  /** A single consumable item. Either a continuous `level` (remaining
58762
59160
  * life %, or fill % for a `supply` / `waste` item) or a discrete `status`
@@ -58769,7 +59167,7 @@ var ConsumableItemSchema = object({
58769
59167
  /** Display name. */
58770
59168
  label: string().min(1),
58771
59169
  /** Remaining life % (`wear`) or fill % (`supply`, `waste`) when known (0..100). */
58772
- level: number().min(0).max(100).nullable(),
59170
+ level: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
58773
59171
  /** The provider's discrete verdict when known (binary mode). */
58774
59172
  status: ConsumableStatusSchema.nullable(),
58775
59173
  /** What the item is — decides whether low or full is bad. Absent = `wear`. */
@@ -58851,8 +59249,8 @@ var consumablesCustomize = {
58851
59249
  transforms: [{ kind: "identity" }]
58852
59250
  }],
58853
59251
  literals: [{
58854
- path: "remaining.unit",
58855
- values: [...ConsumableRemainingUnitSchema.options]
59252
+ path: "remaining.kind",
59253
+ values: [...ConsumableRemainingKindSchema.options]
58856
59254
  }]
58857
59255
  },
58858
59256
  {
@@ -58981,7 +59379,6 @@ reset: method(object({
58981
59379
  },
58982
59380
  "remaining.value": {
58983
59381
  kind: "gauge",
58984
- unitFrom: "remaining.unit",
58985
59382
  deadband: 1,
58986
59383
  displayName: "Remaining"
58987
59384
  }
@@ -59051,10 +59448,9 @@ var contactCapability = {
59051
59448
  * (empty array for the other kinds). It lives in the slice because
59052
59449
  * HA `select.*` entities may update their options at runtime.
59053
59450
  *
59054
- * The `unit`/`min`/`max`/`step` fields are meaningful for
59055
- * `kind === 'numeric'` and are absent (undefined) for all other
59056
- * kinds. They are populated live from HA attributes on each state
59057
- * push — consistent with `options` and the sensor-unit approach.
59451
+ * Numeric `min` / `max` / `step` live in the slice and share the device
59452
+ * quantity (`SourceInfo.quantity`, D944). Display precision is a read-time
59453
+ * preference. A datetime control's shape is `SourceInfo.dateTimeShape`.
59058
59454
  */
59059
59455
  var ControlStatusSchema = object({
59060
59456
  kind: _enum([
@@ -59066,39 +59462,17 @@ var ControlStatusSchema = object({
59066
59462
  /** Current value. Numeric kind → number; select/text/datetime → string.
59067
59463
  * Datetime values are ISO 8601 strings (full timestamp, date-only,
59068
59464
  * or time-only — HA accepts all three forms). */
59069
- value: union([number(), string()]),
59465
+ value: union([number().meta(readingMeta("device")), string()]),
59070
59466
  /** Acceptable values when `kind === 'select'`. Empty for other kinds. */
59071
59467
  options: array(string()),
59072
59468
  /** Ms epoch when the slice was last updated. */
59073
59469
  lastChangedAt: number(),
59074
- /** Display unit-of-measurement (e.g. '°C', '%', 'lx').
59075
- * Populated live from HA `attributes.unit_of_measurement` on each push.
59076
- * Meaningful for `kind === 'numeric'`; absent for other kinds. */
59077
- unit: string().optional(),
59078
- /** Minimum allowed value. Populated live from HA `attributes.min`.
59079
- * Meaningful for `kind === 'numeric'`; absent for other kinds. */
59080
- min: number().optional(),
59081
- /** Maximum allowed value. Populated live from HA `attributes.max`.
59082
- * Meaningful for `kind === 'numeric'`; absent for other kinds. */
59083
- max: number().optional(),
59084
- /** Step increment. Populated live from HA `attributes.step`.
59085
- * Meaningful for `kind === 'numeric'`; absent for other kinds. */
59086
- step: number().optional(),
59087
- /** Suggested decimal places for numeric display. Populated live from HA
59088
- * `attributes.suggested_display_precision`, or derived from `step` when the
59089
- * HA attribute is absent. Meaningful for `kind === 'numeric'`; absent for
59090
- * other kinds. Falls back to auto-formatting when absent. */
59091
- precision: number().int().min(0).max(10).optional(),
59092
- /** Date-picker granularity for `kind === 'datetime'`. 'date' → date-only,
59093
- * 'time' → time-only, 'datetime' → full timestamp. Absent for other kinds
59094
- * (UI defaults to 'datetime'). Derived live from the device's HA domain
59095
- * (date.* / time.* / datetime.*) or, for input_datetime, from the entity's
59096
- * `has_date`/`has_time` attributes on each push. */
59097
- format: _enum([
59098
- "date",
59099
- "time",
59100
- "datetime"
59101
- ]).optional()
59470
+ /** Minimum allowed value, in the device quantity's base unit. */
59471
+ min: number().optional().meta(readingMeta("device")),
59472
+ /** Maximum allowed value, in the device quantity's base unit. */
59473
+ max: number().optional().meta(readingMeta("device")),
59474
+ /** Step increment, in the device quantity's base unit. */
59475
+ step: number().optional().meta(readingMeta("device"))
59102
59476
  });
59103
59477
  var ControlSetValueInputSchema = discriminatedUnion("kind", [
59104
59478
  object({
@@ -59164,9 +59538,9 @@ var CoverStatusSchema = object({
59164
59538
  ]),
59165
59539
  /** 0 = fully closed, 100 = fully open. Null when the device has
59166
59540
  * no intermediate position surface. */
59167
- position: number().min(0).max(100).nullable(),
59541
+ position: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
59168
59542
  /** 0 = closed slats, 100 = open slats. Null when no tilt support. */
59169
- tiltPosition: number().min(0).max(100).nullable(),
59543
+ tiltPosition: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
59170
59544
  /** Ms epoch when the slice was last updated. */
59171
59545
  lastChangedAt: number()
59172
59546
  });
@@ -59269,9 +59643,9 @@ var NormalizedRangeSchema$1 = object({
59269
59643
  var DayNightStatusSchema = object({
59270
59644
  mode: DayNightModeSchema,
59271
59645
  /** IR-cut trigger sensitivity, NORMALIZED 0–100 (higher = switches to night sooner). */
59272
- sensitivity: number().optional(),
59646
+ sensitivity: number().optional().meta(readingMeta("none")),
59273
59647
  /** Delay before the IR-cut filter flips, in seconds. */
59274
- switchDelaySec: number().optional(),
59648
+ switchDelaySec: number().optional().meta(readingMeta("duration")),
59275
59649
  lastFetchedAt: number()
59276
59650
  });
59277
59651
  /**
@@ -59489,11 +59863,11 @@ var DishwasherStatusSchema = object({
59489
59863
  /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
59490
59864
  availablePrograms: array(string()),
59491
59865
  /** Seconds remaining on the active cycle, or null when not running / not known. */
59492
- remainingSeconds: number().int().nonnegative().nullable(),
59866
+ remainingSeconds: number().int().nonnegative().nullable().meta(readingMeta("duration")),
59493
59867
  /** Seconds the delayed start is set to (time until the cycle starts), or null. */
59494
- delayedStartSeconds: number().int().nonnegative().nullable(),
59868
+ delayedStartSeconds: number().int().nonnegative().nullable().meta(readingMeta("duration")),
59495
59869
  /** Cycle completion 0..100, or null when not applicable. */
59496
- progressPercent: number().min(0).max(100).nullable(),
59870
+ progressPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
59497
59871
  /** True when the door is reported open; null when the door state is not known. */
59498
59872
  doorOpen: boolean().nullable(),
59499
59873
  /** True when the door is latched (locked) during a cycle; null when not reported. */
@@ -59517,7 +59891,7 @@ var DishwasherStatusSchema = object({
59517
59891
  /** True while the machine-care (descaling / cleaning-program) reminder is raised; false when clear; null when not reported. */
59518
59892
  machineCareDue: boolean().nullable(),
59519
59893
  /** Program runs left before the machine-care reminder is due; null when the appliance does not say. */
59520
- machineCareRemainingRuns: number().int().nonnegative().nullable(),
59894
+ machineCareRemainingRuns: number().int().nonnegative().nullable().meta(readingMeta("count")),
59521
59895
  /** Option states: null when the appliance does not expose the option or has not said. */
59522
59896
  halfLoad: boolean().nullable(),
59523
59897
  hygienePlus: boolean().nullable(),
@@ -59532,7 +59906,7 @@ var DishwasherStatusSchema = object({
59532
59906
  /** Feature keys of the events currently raised (salt low, rinse aid low, program finished, …). */
59533
59907
  activeEvents: array(string()),
59534
59908
  /** Numeric error code when the appliance reports one; null otherwise. */
59535
- errorCode: number().nullable(),
59909
+ errorCode: number().nullable().meta(readingMeta("none")),
59536
59910
  /** Name of the raised alert-level event while the appliance is in error; null otherwise. */
59537
59911
  errorLabel: string().nullable(),
59538
59912
  /** Ms epoch of the last value received from the appliance; 0 = never. */
@@ -59763,7 +60137,7 @@ var DoorbellStatusSchema = object({
59763
60137
  /** Ms epoch of the last press. null = never observed since this provider started. */
59764
60138
  lastPressedAt: number().nullable(),
59765
60139
  /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
59766
- pressCountSinceStart: number()
60140
+ pressCountSinceStart: number().meta(readingMeta("count"))
59767
60141
  });
59768
60142
  var DoorbellPressEventSchema = object({
59769
60143
  deviceId: number(),
@@ -59828,17 +60202,7 @@ onPressed: {
59828
60202
  history: "none",
59829
60203
  customize: doorbellCustomize
59830
60204
  };
59831
- /**
59832
- * Enum-state sensor — a string value picked from a finite option set.
59833
- * Drives HA `sensor` entries with `state_class: enum` (HVAC action
59834
- * states, weather conditions, contact-source channels, mode strings).
59835
- * The option set is stable across observations; it is persisted in the
59836
- * device config blob (via the control slice at adoption) and is NOT
59837
- * stored in `sourceInfo`.
59838
- */
59839
- /** Locale-render shape for an ISO `value` carried by a `DateTimeSensor`-role
59840
- * enum sensor: `date` (date-only), `time` (time-only), `datetime` (both). */
59841
- var EnumSensorDateTimeFormatSchema = _enum([
60205
+ _enum([
59842
60206
  "date",
59843
60207
  "time",
59844
60208
  "datetime"
@@ -59846,12 +60210,11 @@ var EnumSensorDateTimeFormatSchema = _enum([
59846
60210
  var EnumSensorStatusSchema = object({
59847
60211
  value: string(),
59848
60212
  /**
59849
- * Set for `DateTimeSensor`-role sensors so the UI renders the ISO `value`
59850
- * as a locale date/time/datetime; absent for plain enum sensors. HA
59851
- * `device_class=timestamp` → `'datetime'`, `device_class=date` → `'date'`,
59852
- * a time-only sensor → `'time'`.
60213
+ * Set when `value` is a timestamp rather than an enum state, so history
60214
+ * does not learn ISO strings as states. The display shape (date / time /
60215
+ * datetime) lives on `SourceInfo.dateTimeShape`, written once at adopt.
59853
60216
  */
59854
- format: EnumSensorDateTimeFormatSchema.optional(),
60217
+ timestamp: boolean().optional(),
59855
60218
  /** Ms epoch when the slice was last updated. */
59856
60219
  lastFetchedAt: number()
59857
60220
  });
@@ -59878,11 +60241,11 @@ var enumSensorCapability = {
59878
60241
  * History (D850): the value as an `enum` series (an appliance's program or
59879
60242
  * operation state, an HVAC action). The option set is per device, so the
59880
60243
  * value list is LEARNED as values are first seen (bounded). A sensor with a
59881
- * `format` carries a timestamp, not a state, and is not recorded.
60244
+ * `timestamp` carries a clock, not a state, and is not recorded.
59882
60245
  */
59883
60246
  history: { fields: { value: {
59884
60247
  kind: "enum",
59885
- skipWhenSet: "format"
60248
+ skipWhenSet: "timestamp"
59886
60249
  } } },
59887
60250
  /** Clock fields: written, but excluded from the compare that decides
59888
60251
  * whether persisting is worth a SQLite commit. */
@@ -59902,13 +60265,13 @@ var EventFireSchema = object({
59902
60265
  deviceId: number(),
59903
60266
  eventType: string(),
59904
60267
  data: record(string(), unknown()).nullable(),
59905
- timestamp: number(),
59906
- seq: number()
60268
+ timestamp: number().meta(readingMeta("none")),
60269
+ seq: number().meta(readingMeta("count"))
59907
60270
  });
59908
60271
  var EventEmitterStatusSchema = object({
59909
60272
  eventTypes: array(string()),
59910
60273
  lastEvent: EventFireSchema.nullable(),
59911
- eventCountSinceStart: number()
60274
+ eventCountSinceStart: number().meta(readingMeta("count"))
59912
60275
  });
59913
60276
  var eventEmitterCapability = {
59914
60277
  name: "event-emitter",
@@ -60321,10 +60684,10 @@ var FanDirectionSchema = _enum(["forward", "reverse"]);
60321
60684
  var FanControlStatusSchema = object({
60322
60685
  /** Active speed as 0..100 inclusive. Null when the device has no
60323
60686
  * speed surface (single-speed fan). */
60324
- percentage: number().min(0).max(100).nullable(),
60687
+ percentage: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
60325
60688
  /** Speed granularity the device accepts (HA `percentage_step`, e.g. 25 for
60326
60689
  * a 4-speed fan). Absent when unknown — the UI then falls back to step 1. */
60327
- percentageStep: number().positive().optional(),
60690
+ percentageStep: number().positive().optional().meta(readingMeta("percentage")),
60328
60691
  /** Active preset mode (`auto` / `quiet` / `turbo` / vendor-specific)
60329
60692
  * — empty string when no preset is active or supported. */
60330
60693
  preset: string(),
@@ -60445,7 +60808,7 @@ var FeatureProbeStatusSchema = object({
60445
60808
  /** Camera/firmware model string. `null` when the firmware doesn't expose it. */
60446
60809
  model: string().nullable(),
60447
60810
  /** Channel count for NVR/Hub devices; `1` for standalone cameras; `null` pre-probe. */
60448
- channelCount: number().nullable(),
60811
+ channelCount: number().nullable().meta(readingMeta("count")),
60449
60812
  /**
60450
60813
  * Ms epoch of the last SUCCESSFUL probe. `0` before the first probe
60451
60814
  * completes — drivers' `getAccessoryChildren()` should treat zero as
@@ -60568,9 +60931,91 @@ var gasCapability = {
60568
60931
  * whether persisting is worth a SQLite commit. */
60569
60932
  volatileStateFields: ["lastChangedAt"]
60570
60933
  };
60934
+ var GroupCommandsSchema = object({
60935
+ /** One row per member that has been commanded. A later command replaces that member's row. */
60936
+ results: array(object({
60937
+ deviceId: number().int().nonnegative(),
60938
+ cap: string().min(1),
60939
+ method: string().min(1),
60940
+ ok: boolean(),
60941
+ error: string().optional(),
60942
+ /** Ms epoch of the attempt. */
60943
+ at: number()
60944
+ })) });
60945
+ var groupCommandsCapability = {
60946
+ name: "group-commands",
60947
+ scope: "device",
60948
+ deviceNative: true,
60949
+ mode: "singleton",
60950
+ deviceTypes: [DeviceType.Switch, DeviceType.Light],
60951
+ methods: {},
60952
+ status: {
60953
+ schema: GroupCommandsSchema,
60954
+ kind: "push"
60955
+ },
60956
+ runtimeState: GroupCommandsSchema,
60957
+ /**
60958
+ * Runtime-state durability: **session** — the last attempt. A restored
60959
+ * failure would outlive the command that caused it.
60960
+ *
60961
+ * See `RuntimeStateDurability`. Enforced by
60962
+ * `scripts/check-runtime-state-durability.ts`.
60963
+ */
60964
+ durability: "session",
60965
+ history: "none"
60966
+ };
60967
+ /**
60968
+ * How many members of a helper group answered (D944). Counts are integers,
60969
+ * not measurements: zero included is a real count, never a stand-in reading.
60970
+ * The reading itself stays on the output capability. History is none — the
60971
+ * series that later statistics read is the output cap's own history block.
60972
+ */
60973
+ var GroupStatusSchema = object({
60974
+ /** Members whose current value entered the aggregate. */
60975
+ included: number().int().nonnegative().meta(readingMeta("count", {
60976
+ precision: 0,
60977
+ label: "Reporting"
60978
+ })),
60979
+ /** Members left out: offline, unknown, or not a finite reading (D393). */
60980
+ excluded: number().int().nonnegative().meta(readingMeta("count", {
60981
+ precision: 0,
60982
+ label: "Excluded"
60983
+ })),
60984
+ /** `included` + `excluded`. */
60985
+ total: number().int().nonnegative().meta(readingMeta("count", {
60986
+ precision: 0,
60987
+ label: "Members"
60988
+ }))
60989
+ });
60990
+ var groupStatusCapability = {
60991
+ name: "group-status",
60992
+ scope: "device",
60993
+ deviceNative: true,
60994
+ mode: "singleton",
60995
+ deviceTypes: [
60996
+ DeviceType.Sensor,
60997
+ DeviceType.Switch,
60998
+ DeviceType.Light
60999
+ ],
61000
+ methods: {},
61001
+ status: {
61002
+ schema: GroupStatusSchema,
61003
+ kind: "push"
61004
+ },
61005
+ runtimeState: GroupStatusSchema,
61006
+ /**
61007
+ * Runtime-state durability: **session** — recomputed from members on the
61008
+ * next source event; a restored count would outlive the readings it named.
61009
+ *
61010
+ * See `RuntimeStateDurability`. Enforced by
61011
+ * `scripts/check-runtime-state-durability.ts`.
61012
+ */
61013
+ durability: "session",
61014
+ history: "none"
61015
+ };
60571
61016
  var HeatingValveStatusSchema = object({
60572
61017
  /** Radiator valve opening 0 (closed) .. 100 (open). Null = not yet known. */
60573
- position: number().min(0).max(100).nullable(),
61018
+ position: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
60574
61019
  /** Ms epoch when the slice was last updated (push or poll). */
60575
61020
  lastFetchedAt: number()
60576
61021
  });
@@ -60613,9 +61058,9 @@ var HumidifierStatusSchema = object({
60613
61058
  /** Whether the humidifier is currently on. */
60614
61059
  on: boolean(),
60615
61060
  /** Current measured relative humidity (0..100). Null when not reported. */
60616
- currentHumidity: number().min(0).max(100).nullable(),
61061
+ currentHumidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
60617
61062
  /** Target relative humidity (0..100). Null when no setpoint surface. */
60618
- targetHumidity: number().min(0).max(100).nullable(),
61063
+ targetHumidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
60619
61064
  /** Active mode (`auto` / `normal` / `baby` / vendor). Null when the
60620
61065
  * device has no mode surface. */
60621
61066
  mode: string().nullable(),
@@ -60625,9 +61070,9 @@ var HumidifierStatusSchema = object({
60625
61070
  * `idle` / `off`). Null when the device doesn't report it. */
60626
61071
  action: string().nullable(),
60627
61072
  /** HA `min_humidity` attribute. Null → UI uses 0. */
60628
- minHumidity: number().nullable(),
61073
+ minHumidity: number().nullable().meta(readingMeta("humidity")),
60629
61074
  /** HA `max_humidity` attribute. Null → UI uses 100. */
60630
- maxHumidity: number().nullable(),
61075
+ maxHumidity: number().nullable().meta(readingMeta("humidity")),
60631
61076
  /** Ms epoch when the slice was last updated. */
60632
61077
  lastChangedAt: number()
60633
61078
  });
@@ -60697,22 +61142,13 @@ var humidifierCapability = {
60697
61142
  * `sourceInfo`.
60698
61143
  */
60699
61144
  var HumiditySensorStatusSchema = object({
60700
- /** Current relative humidity, 0..100. */
60701
- percent: number().min(0).max(100).meta({
60702
- unit: "%",
61145
+ /** Current relative humidity, 0..100. `null` when the sample was refused (D393). */
61146
+ percent: number().min(0).max(100).nullable().meta(readingMeta("humidity", {
61147
+ precision: 0,
60703
61148
  label: "Humidity"
60704
- }),
61149
+ })),
60705
61150
  /** Ms epoch when the slice was last updated. */
60706
- lastFetchedAt: number(),
60707
- /** Live display unit from the upstream source (e.g. HA
60708
- * `attributes.unit_of_measurement`). The UI prefers this over the
60709
- * role's canonical unit. Absent → fall back to the canonical unit. */
60710
- unit: string().optional(),
60711
- /** Suggested decimal places for numeric display.
60712
- * Populated live from the upstream source when provided (e.g. HA
60713
- * `attributes.suggested_display_precision`). Falls back to
60714
- * auto-formatting when absent. */
60715
- precision: number().int().min(0).max(10).optional()
61151
+ lastFetchedAt: number()
60716
61152
  });
60717
61153
  var humiditySensorCapability = {
60718
61154
  name: "humidity-sensor",
@@ -60743,12 +61179,7 @@ var humiditySensorCapability = {
60743
61179
  } } },
60744
61180
  /** Clock fields: written, but excluded from the compare that decides
60745
61181
  * whether persisting is worth a SQLite commit. */
60746
- volatileStateFields: ["lastFetchedAt"],
60747
- customize: {
60748
- version: 1,
60749
- advanced: "derive",
60750
- targets: []
60751
- }
61182
+ volatileStateFields: ["lastFetchedAt"]
60752
61183
  };
60753
61184
  /**
60754
61185
  * Image display cap. Models a single still image exposed by an integration —
@@ -60769,7 +61200,7 @@ var ImageStatusSchema = object({
60769
61200
  * entity exposes no `entity_picture` (yet). */
60770
61201
  url: string().nullable(),
60771
61202
  /** Ms epoch of the upstream last-updated timestamp. Null at cold-start. */
60772
- lastUpdated: number().nullable()
61203
+ lastUpdated: number().nullable().meta(readingMeta("none"))
60773
61204
  });
60774
61205
  var imageCapability = {
60775
61206
  name: "image",
@@ -60857,19 +61288,19 @@ var NormalizedRangeSchema = object({
60857
61288
  */
60858
61289
  var ImageSettingsStatusSchema = object({
60859
61290
  /** Normalized 0–100. */
60860
- brightness: number().optional(),
61291
+ brightness: number().optional().meta(readingMeta("none")),
60861
61292
  /** Normalized 0–100. */
60862
- contrast: number().optional(),
61293
+ contrast: number().optional().meta(readingMeta("none")),
60863
61294
  /** Normalized 0–100. */
60864
- saturation: number().optional(),
61295
+ saturation: number().optional().meta(readingMeta("none")),
60865
61296
  /** Normalized 0–100. */
60866
- sharpness: number().optional(),
61297
+ sharpness: number().optional().meta(readingMeta("none")),
60867
61298
  mirror: boolean().optional(),
60868
61299
  flip: boolean().optional(),
60869
61300
  rotate: ImageRotateSchema.optional(),
60870
61301
  whiteBalance: WhiteBalanceModeSchema.optional(),
60871
61302
  /** Manual white-balance warmth, NORMALIZED 0–100. Meaningful only when `whiteBalance === 'manual'`. */
60872
- warmth: number().optional(),
61303
+ warmth: number().optional().meta(readingMeta("none")),
60873
61304
  exposureMode: ExposureModeSchema.optional(),
60874
61305
  backlightMode: BacklightModeSchema.optional(),
60875
61306
  lastFetchedAt: number()
@@ -61148,10 +61579,10 @@ var IntercomAbilitySchema = object({
61148
61579
  /** Codecs accepted by firmware, in preference order. Driver-authored strings. */
61149
61580
  codecs: array(string()),
61150
61581
  /** Sample rate (Hz) the firmware expects. Reolink typical: 16000. */
61151
- sampleRate: number(),
61582
+ sampleRate: number().meta(readingMeta("none")),
61152
61583
  duplex: _enum(["half", "full"]),
61153
61584
  /** Max in-flight audio backlog before drop (ms). Server uses this to bound latency. */
61154
- maxBacklogMs: number()
61585
+ maxBacklogMs: number().meta(readingMeta("duration-ms"))
61155
61586
  });
61156
61587
  var IntercomStatusSchema = object({
61157
61588
  /** True while a talk session is open. */
@@ -61378,13 +61809,13 @@ var LawnMowerControlStatusSchema = object({
61378
61809
  activity: LawnMowerActivitySchema,
61379
61810
  /** 0..100 battery percentage. Null when the device has no battery
61380
61811
  * reading. */
61381
- batteryLevel: number().min(0).max(100).nullable(),
61812
+ batteryLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
61382
61813
  /** 0..100 mowing-completion percentage of the current task, or null when no
61383
61814
  * task is active / progress is unavailable. */
61384
- progressPercent: number().min(0).max(100).nullable(),
61815
+ progressPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
61385
61816
  /** Current device/event code (dynamic — mostly status, sometimes an error),
61386
61817
  * or null when unknown. */
61387
- currentCode: number().nullable(),
61818
+ currentCode: number().nullable().meta(readingMeta("none")),
61388
61819
  /** Human label for {@link currentCode}, or null when undecodable. */
61389
61820
  currentCodeLabel: string().nullable(),
61390
61821
  /** Severity of {@link currentCode}. `error` (and often `warning`) warrants UI
@@ -61917,7 +62348,7 @@ var MediaPlayerStatusSchema = object({
61917
62348
  state: MediaPlayerStateSchema,
61918
62349
  /** Volume as 0..100 inclusive. Null when the device has no volume
61919
62350
  * surface. Pair with `DeviceFeature.MediaPlayerVolume`. */
61920
- volumeLevel: number().min(0).max(100).nullable(),
62351
+ volumeLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
61921
62352
  /** Mute toggle distinct from volume=0. Null when no mute surface.
61922
62353
  * Pair with `DeviceFeature.MediaPlayerMute`. */
61923
62354
  isMuted: boolean().nullable(),
@@ -61930,10 +62361,10 @@ var MediaPlayerStatusSchema = object({
61930
62361
  currentMedia: MediaInfoSchema.nullable(),
61931
62362
  /** Current playback position in ms. Null when not seekable or
61932
62363
  * nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
61933
- positionMs: number().int().nonnegative().nullable(),
62364
+ positionMs: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
61934
62365
  /** Total duration of the current media in ms. Null when unknown
61935
62366
  * (live stream) or nothing is playing. */
61936
- durationMs: number().int().nonnegative().nullable(),
62367
+ durationMs: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
61937
62368
  /** Shuffle toggle. Null when no shuffle surface.
61938
62369
  * Pair with `DeviceFeature.MediaPlayerShuffle`. */
61939
62370
  shuffle: boolean().nullable(),
@@ -62242,7 +62673,7 @@ var motionCustomize = {
62242
62673
  eventName: "onMotionChanged"
62243
62674
  },
62244
62675
  deviceTypes: [DeviceType.Camera],
62245
- apply: "replace",
62676
+ apply: "add",
62246
62677
  applyAuthority: {
62247
62678
  kind: "camera-sensors",
62248
62679
  timeoutField: "motionCooldownMs"
@@ -62314,7 +62745,7 @@ var MotionStatusSchema = object({
62314
62745
  * it, every provider seeded it at boot, and every session left it
62315
62746
  * `detected: true` after its detach.
62316
62747
  */
62317
- autoClearAfterMs: number().nullable()
62748
+ autoClearAfterMs: number().nullable().meta(readingMeta("duration-ms"))
62318
62749
  });
62319
62750
  /**
62320
62751
  * Payload of `motion.onMotionChanged` event + the corresponding bus
@@ -62351,12 +62782,18 @@ var motionCapability = {
62351
62782
  methods: {
62352
62783
  /**
62353
62784
  * Pull the current motion state synchronously. Convenience shortcut
62354
- * for consumers that don't need the full status object; equivalent
62355
- * to `getStatus()?.detected ?? false`. Will likely be folded into
62356
- * `getStatus` once the auto-injected status surface lands in every
62357
- * consumer.
62785
+ * for consumers that don't need the full status object. A composed
62786
+ * group answers from its slice (D944): unknown throws, it is not off.
62358
62787
  */
62359
62788
  isDetected: method(object({ deviceId: number() }), boolean()) },
62789
+ /**
62790
+ * A composed motion group serves `isDetected` from `detected` (D944).
62791
+ * Without this the cap stays uncomposable (`has-commands`).
62792
+ */
62793
+ composedMethods: { isDetected: {
62794
+ kind: "slice",
62795
+ field: "detected"
62796
+ } },
62360
62797
  events: {
62361
62798
  /**
62362
62799
  * Fires every time the runner transitions a camera between
@@ -62496,7 +62933,7 @@ var MotionZoneRegionSchema = object({
62496
62933
  * the grid region(s). */
62497
62934
  var MotionZoneStatusSchema = object({
62498
62935
  enabled: boolean(),
62499
- sensitivity: number(),
62936
+ sensitivity: number().meta(readingMeta("none")),
62500
62937
  /** Grid region(s). Today exactly one `grid` shape. */
62501
62938
  regions: array(MotionZoneRegionSchema),
62502
62939
  lastFetchedAt: number()
@@ -62866,7 +63303,7 @@ var NavigationStatusSchema = object({
62866
63303
  following: boolean(),
62867
63304
  flash: boolean(),
62868
63305
  lightMode: NavigationLightModeSchema,
62869
- lightLevel: number().min(40).max(100),
63306
+ lightLevel: number().min(40).max(100).meta(readingMeta("none")),
62870
63307
  /** Ms epoch when the slice was last updated. */
62871
63308
  lastChangedAt: number()
62872
63309
  });
@@ -63000,13 +63437,13 @@ var NetworkLinkStatusSchema = object({
63000
63437
  * one whose reading has not landed must not be drawn at 0 %. Consumers
63001
63438
  * SKIP a null rather than coerce it.
63002
63439
  */
63003
- signalPercent: number().min(0).max(100).nullable(),
63440
+ signalPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
63004
63441
  /** Raw received signal strength in dBm, when the firmware reports one. */
63005
- rssiDbm: number().optional(),
63442
+ rssiDbm: number().optional().meta(readingMeta("signal-level")),
63006
63443
  /** Network name of a wireless link, when the firmware reports it. */
63007
63444
  ssid: string().optional(),
63008
63445
  /** Ms epoch of the last observation. Lets consumers reason about freshness. */
63009
- lastUpdated: number()
63446
+ lastUpdated: number().meta(readingMeta("none"))
63010
63447
  });
63011
63448
  var networkLinkCapability = {
63012
63449
  name: "network-link",
@@ -63391,7 +63828,7 @@ var NotifierStatusSchema = object({
63391
63828
  lastError: string().nullable(),
63392
63829
  /** Number of deliveries currently buffered server-side (rate-limited
63393
63830
  * notifiers may queue). 0 when the provider sends synchronously. */
63394
- queueDepth: number().int().nonnegative(),
63831
+ queueDepth: number().int().nonnegative().meta(readingMeta("count")),
63395
63832
  /** Per-feature capability matrix — authoritative source for the
63396
63833
  * compose-form field gating. */
63397
63834
  supports: NotifierSupportsSchema
@@ -63483,11 +63920,9 @@ onSent: { data: object({
63483
63920
  * cap fits (HA `sensor` whose `device_class` we don't have a typed cap
63484
63921
  * for: water flow, distance, weight, frequency, signal strength, …).
63485
63922
  *
63486
- * The `unit` and `precision` fields carry the live display metadata that
63487
- * the upstream source provides with each state push (HA
63488
- * `attributes.unit_of_measurement` / `attributes.suggested_display_precision`).
63489
- * The UI reads them directly from the slice — they are the single source
63490
- * of truth for generic numeric rendering and do NOT live on `sourceInfo`.
63923
+ * The quantity is not on this slice. It is chosen when the device is
63924
+ * adopted and stored once on `SourceInfo.quantity` (D944). `value` is in
63925
+ * that quantity's base unit. `null` is a refused sample (D393).
63491
63926
  *
63492
63927
  * Prefer the typed alternatives (`temperature-sensor`, `humidity-sensor`,
63493
63928
  * `ambient-light-sensor`, `pressure-sensor`, `power-meter`,
@@ -63496,15 +63931,8 @@ onSent: { data: object({
63496
63931
  * numeric values land here.
63497
63932
  */
63498
63933
  var NumericSensorStatusSchema = object({
63499
- value: number(),
63500
- /** Display unit-of-measurement (e.g. 'dBm', 's', 'rpm', 'steps').
63501
- * Populated live from the upstream source on each state push.
63502
- * Absent for unitless sensors. */
63503
- unit: string().optional(),
63504
- /** Suggested decimal places for numeric display.
63505
- * Populated live from the upstream source when provided.
63506
- * Falls back to auto-formatting when absent. */
63507
- precision: number().int().min(0).max(10).optional(),
63934
+ /** Reading in the device quantity's base unit. `null` when refused (D393). */
63935
+ value: number().nullable().meta(readingMeta("device")),
63508
63936
  /** Ms epoch when the slice was last updated. */
63509
63937
  lastFetchedAt: number()
63510
63938
  });
@@ -63528,11 +63956,11 @@ var numericSensorCapability = {
63528
63956
  */
63529
63957
  durability: "restored",
63530
63958
  /**
63531
- * History (D850): recorded series. The unit is per device, read from the sibling `unit` field.
63959
+ * History (D850): recorded series. The unit is the device quantity's base,
63960
+ * resolved when the series is read — the cap has no single unit.
63532
63961
  */
63533
63962
  history: { fields: { value: {
63534
63963
  kind: "gauge",
63535
- unitFrom: "unit",
63536
63964
  minIntervalMs: 3e4
63537
63965
  } } },
63538
63966
  /** Clock fields: written, but excluded from the compare that decides
@@ -63870,23 +64298,26 @@ var PetFeederStatusSchema = object({
63870
64298
  /** Food currently in the bowl (grams). Null when the device has not
63871
64299
  * reported a reading yet. On dual-hopper models this is the combined
63872
64300
  * bowl reading; per-hopper levels live in `food1`/`food2`. */
63873
- foodLevel: number().nullable(),
64301
+ foodLevel: number().nullable().meta(readingMeta("none")),
63874
64302
  /** Hopper-1 food level (grams) on dual-hopper feeders; null on
63875
64303
  * single-hopper models. */
63876
- food1: number().nullable(),
64304
+ food1: number().nullable().meta(readingMeta("none")),
63877
64305
  /** Hopper-2 food level (grams) on dual-hopper feeders; null on
63878
64306
  * single-hopper models. */
63879
- food2: number().nullable(),
64307
+ food2: number().nullable().meta(readingMeta("none")),
63880
64308
  /** Derived low-food flag — mirrors the HA `food_level` binary_sensor
63881
64309
  * (`device_class: problem`, on = low). True when the bowl is empty /
63882
64310
  * below the feeder's low threshold. */
63883
64311
  lowFood: boolean(),
63884
64312
  /** Battery charge 0..100 (%). Null on mains-powered models or when the
63885
64313
  * device has no battery reading. */
63886
- batteryPower: number().min(0).max(100).nullable(),
63887
- /** Days of desiccant life remaining. Null when the model has no
63888
- * desiccant sensor. */
63889
- desiccantLeftDays: number().nullable(),
64314
+ batteryPower: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
64315
+ /**
64316
+ * Desiccant life remaining, stored in seconds (duration base, D944).
64317
+ * Providers convert from the days the feeder reports. Null when the
64318
+ * model has no desiccant sensor.
64319
+ */
64320
+ desiccantLeftDays: number().nullable().meta(readingMeta("duration")),
63890
64321
  /** True while a feed is in progress. */
63891
64322
  feeding: boolean(),
63892
64323
  /** Decoded connectivity / power status (HA petkit device-status enum).
@@ -63897,7 +64328,7 @@ var PetFeederStatusSchema = object({
63897
64328
  * with `errorCode` for consumers that want the raw integer. */
63898
64329
  error: string().nullable(),
63899
64330
  /** Raw device error code (0 / null = no error). */
63900
- errorCode: number().nullable(),
64331
+ errorCode: number().nullable().meta(readingMeta("none")),
63901
64332
  /** True for D4S/D4SH dual-hopper hardware — gates the per-hopper UI. */
63902
64333
  isDualHopper: boolean(),
63903
64334
  /** Child-lock (manual-lock) setting — buttons on the unit are disabled. */
@@ -63907,7 +64338,7 @@ var PetFeederStatusSchema = object({
63907
64338
  /** Play a chime when dispensing. */
63908
64339
  feedSound: boolean(),
63909
64340
  /** Speaker / prompt volume level (device-scaled integer). */
63910
- volume: number(),
64341
+ volume: number().meta(readingMeta("none")),
63911
64342
  /** Ms epoch when the slice was last refreshed from the cloud. */
63912
64343
  lastFetchedAt: number()
63913
64344
  });
@@ -64026,7 +64457,7 @@ var petFeederCapability = {
64026
64457
  },
64027
64458
  desiccantLeftDays: {
64028
64459
  kind: "gauge",
64029
- unit: "days"
64460
+ unit: "s"
64030
64461
  }
64031
64462
  } }
64032
64463
  };
@@ -64427,36 +64858,19 @@ method(_void(), PlatformCapabilitiesSchema), method(_void(), HardwareInfoSchema)
64427
64858
  */
64428
64859
  var PowerMeterStatusSchema = object({
64429
64860
  /** Instantaneous power draw in watts. */
64430
- watts: number().optional().meta({
64431
- unit: "W",
64432
- label: "Power"
64433
- }),
64861
+ watts: number().optional().meta(readingMeta("power", { label: "Power" })),
64434
64862
  /** Cumulative energy in kilowatt-hours since the meter was reset. */
64435
- kwhTotal: number().optional().meta({
64436
- unit: "kWh",
64437
- label: "Energy"
64438
- }),
64863
+ kwhTotal: number().optional().meta(readingMeta("energy", { label: "Energy" })),
64439
64864
  /** Voltage in volts. */
64440
- volts: number().optional(),
64865
+ volts: number().optional().meta(readingMeta("voltage")),
64441
64866
  /** Current in amperes. */
64442
- amps: number().optional(),
64443
- /** Apparent power in volt-amperes (W × power-factor reciprocal). */
64444
- va: number().optional(),
64867
+ amps: number().optional().meta(readingMeta("current")),
64868
+ /** Apparent power in volt-amperes. */
64869
+ va: number().optional().meta(readingMeta("apparent-power")),
64445
64870
  /** Power factor (0..1) if reported. */
64446
- powerFactor: number().min(0).max(1).optional(),
64871
+ powerFactor: number().min(0).max(1).optional().meta(readingMeta("ratio")),
64447
64872
  /** Ms epoch when the slice was last updated. */
64448
- lastFetchedAt: number(),
64449
- /** Live display unit of the single metric this slice carries (e.g. HA
64450
- * `attributes.unit_of_measurement` → 'V' / 'A' / 'W' / 'kW' / 'kWh').
64451
- * Each upstream `sensor.*` entity surfaces ONE device_class, so one
64452
- * unit per slice is unambiguous. The UI prefers this over the role's
64453
- * canonical unit so a 'kW' / 'Wh' feed renders verbatim. */
64454
- unit: string().optional(),
64455
- /** Suggested decimal places for numeric display.
64456
- * Populated live from the upstream source when provided (e.g. HA
64457
- * `attributes.suggested_display_precision`). Falls back to
64458
- * auto-formatting when absent. */
64459
- precision: number().int().min(0).max(10).optional()
64873
+ lastFetchedAt: number()
64460
64874
  });
64461
64875
  var powerMeterCapability = {
64462
64876
  name: "power-meter",
@@ -64520,12 +64934,7 @@ var powerMeterCapability = {
64520
64934
  } },
64521
64935
  /** Clock fields: written, but excluded from the compare that decides
64522
64936
  * whether persisting is worth a SQLite commit. */
64523
- volatileStateFields: ["lastFetchedAt"],
64524
- customize: {
64525
- version: 1,
64526
- advanced: "derive",
64527
- targets: []
64528
- }
64937
+ volatileStateFields: ["lastFetchedAt"]
64529
64938
  };
64530
64939
  /**
64531
64940
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
@@ -64545,11 +64954,11 @@ var powerMeterCapability = {
64545
64954
  */
64546
64955
  var GpsLocationSchema = object({
64547
64956
  /** Latitude in decimal degrees, -90..90. */
64548
- latitude: number().min(-90).max(90),
64957
+ latitude: number().min(-90).max(90).meta(readingMeta("angle")),
64549
64958
  /** Longitude in decimal degrees, -180..180. */
64550
- longitude: number().min(-180).max(180),
64959
+ longitude: number().min(-180).max(180).meta(readingMeta("angle")),
64551
64960
  /** Reported accuracy in meters (lower = better). */
64552
- accuracyMeters: number().nonnegative()
64961
+ accuracyMeters: number().nonnegative().meta(readingMeta("length"))
64553
64962
  });
64554
64963
  var PresenceStatusSchema = object({
64555
64964
  /** `home` / `not_home` / any user-defined zone name. */
@@ -64561,7 +64970,7 @@ var PresenceStatusSchema = object({
64561
64970
  gps: GpsLocationSchema.nullable(),
64562
64971
  /** Optional battery level of the tracking device (0..100). Null
64563
64972
  * when not reported. */
64564
- batteryPercent: number().min(0).max(100).nullable(),
64973
+ batteryPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
64565
64974
  /** Ms epoch when the slice was last updated. */
64566
64975
  lastChangedAt: number()
64567
64976
  });
@@ -64611,19 +65020,10 @@ var presenceCapability = {
64611
65020
  * `sourceInfo`.
64612
65021
  */
64613
65022
  var PressureSensorStatusSchema = object({
64614
- /** Current pressure in hPa. */
64615
- hpa: number(),
65023
+ /** Current pressure in hPa. `null` when the sample was refused (D393). */
65024
+ hpa: number().nullable().meta(readingMeta("pressure", { precision: 0 })),
64616
65025
  /** Ms epoch when the slice was last updated. */
64617
- lastFetchedAt: number(),
64618
- /** Live display unit from the upstream source (e.g. HA
64619
- * `attributes.unit_of_measurement`). The UI prefers this over the
64620
- * role's canonical unit. Absent → fall back to the canonical unit. */
64621
- unit: string().optional(),
64622
- /** Suggested decimal places for numeric display.
64623
- * Populated live from the upstream source when provided (e.g. HA
64624
- * `attributes.suggested_display_precision`). Falls back to
64625
- * auto-formatting when absent. */
64626
- precision: number().int().min(0).max(10).optional()
65026
+ lastFetchedAt: number()
64627
65027
  });
64628
65028
  var pressureSensorCapability = {
64629
65029
  name: "pressure-sensor",
@@ -65149,8 +65549,8 @@ var ptzCapability = {
65149
65549
  };
65150
65550
  var PtzAutotrackSettingsSchema = object({
65151
65551
  targetType: string().describe("Vendor target string (people/vehicle/pet); empty = camera default"),
65152
- stopDelaySeconds: number().int().min(0).max(300),
65153
- disappearDelaySeconds: number().int().min(0).max(300)
65552
+ stopDelaySeconds: number().int().min(0).max(300).meta(readingMeta("duration")),
65553
+ disappearDelaySeconds: number().int().min(0).max(300).meta(readingMeta("duration"))
65154
65554
  });
65155
65555
  /**
65156
65556
  * One option the camera advertises as a valid `targetType`. Drivers
@@ -65304,7 +65704,7 @@ var RunningStateStatusSchema = object({
65304
65704
  /** null = unknown — never coerced to false (D393). */
65305
65705
  running: boolean().nullable(),
65306
65706
  /** Epoch ms the current boolean began; null while `running` is null. */
65307
- since: number().nullable(),
65707
+ since: number().nullable().meta(readingMeta("none")),
65308
65708
  source: RunningStateSourceSchema.meta({ label: "Source" }),
65309
65709
  phase: string().nullable(),
65310
65710
  /** null until a reading has been published (D393). */
@@ -65319,7 +65719,6 @@ var RUNNING_DEVICE_TYPES = Object.values(DeviceType);
65319
65719
  /** Generic Customize target for the running boolean (D936). */
65320
65720
  var runningCustomize = {
65321
65721
  version: 1,
65322
- advanced: "derive",
65323
65722
  targets: [{
65324
65723
  id: "running",
65325
65724
  cardinality: "scalar",
@@ -65339,7 +65738,7 @@ var runningCustomize = {
65339
65738
  DeviceType.Thermostat,
65340
65739
  DeviceType.PetFeeder
65341
65740
  ],
65342
- apply: "add-or-replace",
65741
+ apply: "add",
65343
65742
  path: "running",
65344
65743
  sources: [
65345
65744
  {
@@ -66632,9 +67031,9 @@ var RecordTriggerSchema = _enum([
66632
67031
  */
66633
67032
  var RecordWindowSchema = object({
66634
67033
  trigger: RecordTriggerSchema,
66635
- day: number().int().min(0).max(6),
66636
- startMinute: number().int().min(0).max(1439),
66637
- endMinute: number().int().min(1).max(1440)
67034
+ day: number().int().min(0).max(6).meta(readingMeta("none")),
67035
+ startMinute: number().int().min(0).max(1439).meta(readingMeta("none")),
67036
+ endMinute: number().int().min(1).max(1440).meta(readingMeta("none"))
66638
67037
  });
66639
67038
  /** Status of one physical volume, as the camera itself describes it. */
66640
67039
  var OnboardStorageVolumeSchema = object({
@@ -66710,10 +67109,10 @@ var RecordingOnboardStatusSchema = object({
66710
67109
  /** Master "record to the card at all" switch. */
66711
67110
  enabled: boolean().nullable(),
66712
67111
  overwriteWhenFull: boolean().nullable(),
66713
- preRecordSec: number().nullable(),
66714
- postRecordSec: number().nullable(),
67112
+ preRecordSec: number().nullable().meta(readingMeta("duration")),
67113
+ postRecordSec: number().nullable().meta(readingMeta("duration")),
66715
67114
  /** Length of one recorded file, in minutes. */
66716
- segmentMinutes: number().nullable(),
67115
+ segmentMinutes: number().nullable().meta(readingMeta("none")),
66717
67116
  /** The primary track's weekly windows, flattened. */
66718
67117
  windows: array(RecordWindowSchema),
66719
67118
  /**
@@ -66729,7 +67128,7 @@ var RecordingOnboardStatusSchema = object({
66729
67128
  * provider reporting a non-zero count also reports the schedule as not
66730
67129
  * writable.
66731
67130
  */
66732
- unreadableWindows: number(),
67131
+ unreadableWindows: number().meta(readingMeta("count")),
66733
67132
  /**
66734
67133
  * The camera is scheduled to record and has NO usable storage.
66735
67134
  *
@@ -67750,7 +68149,7 @@ var CamStreamDescriptorSchema = object({
67750
68149
  url: string().optional(),
67751
68150
  codec: string().optional(),
67752
68151
  resolution: CamStreamResolutionSchema.optional(),
67753
- fps: number().positive().optional(),
68152
+ fps: number().positive().optional().meta(readingMeta("rate")),
67754
68153
  label: string().optional(),
67755
68154
  /** Device-level features (e.g. `battery-operated`) — drives broker policy. */
67756
68155
  deviceFeatures: array(string()).optional(),
@@ -67837,18 +68236,18 @@ var StreamProfileSchema = _enum([
67837
68236
  ]);
67838
68237
  /** The current encoding config of one stream profile. */
67839
68238
  var StreamProfileConfigSchema = object({
67840
- width: number(),
67841
- height: number(),
68239
+ width: number().meta(readingMeta("none")),
68240
+ height: number().meta(readingMeta("none")),
67842
68241
  codec: _enum(["h264", "h265"]),
67843
- framerate: number(),
67844
- bitrate: number(),
68242
+ framerate: number().meta(readingMeta("rate")),
68243
+ bitrate: number().meta(readingMeta("bitrate")),
67845
68244
  bitrateMode: _enum(["vbr", "cbr"]).optional(),
67846
68245
  encoderProfile: _enum([
67847
68246
  "high",
67848
68247
  "main",
67849
68248
  "baseline"
67850
68249
  ]).optional(),
67851
- gop: number().optional(),
68250
+ gop: number().optional().meta(readingMeta("none")),
67852
68251
  /**
67853
68252
  * Whether THIS profile currently carries an audio track. READ-ONLY here.
67854
68253
  *
@@ -68267,12 +68666,7 @@ var switchCapability = {
68267
68666
  label: "On",
68268
68667
  kind: "boolean"
68269
68668
  }
68270
- }] },
68271
- customize: {
68272
- version: 1,
68273
- advanced: "derive",
68274
- targets: []
68275
- }
68669
+ }] }
68276
68670
  };
68277
68671
  /** C0 controls, DEL and the C1 range: none of them belongs in a name. */
68278
68672
  function hasControlCharacter(value) {
@@ -68855,35 +69249,21 @@ var tamperCapability = {
68855
69249
  * entries with `device_class: temperature` and any future native
68856
69250
  * thermometer.
68857
69251
  *
68858
- * Unit normalisation: providers convert to Celsius before storing.
68859
- * The slice value is always Celsius so cross-cap aggregators
68860
- * (climate-control's `currentTemp`, energy analytics) can compose
68861
- * without per-source unit fixups. The canonical display unit (`°C`) is
68862
- * a descriptor constant in the UI (ROLE_DESCRIPTOR), not stored in
68863
- * `sourceInfo`.
69252
+ * The number is Celsius (D944). Providers convert on ingest. A failed
69253
+ * conversion is `null`, never a guess. Display unit is a read-time preference.
68864
69254
  *
68865
69255
  * Status `lastFetchedAt` lets staleness-aware consumers detect a
68866
69256
  * frozen feed (provider hung) distinct from a "temperature hasn't
68867
69257
  * changed" steady state.
68868
69258
  */
68869
69259
  var TemperatureSensorStatusSchema = object({
68870
- /** Current temperature in Celsius. */
68871
- celsius: number().meta({
68872
- unit: "°C",
69260
+ /** Current temperature in Celsius. `null` when the sample was refused (D393). */
69261
+ celsius: number().nullable().meta(readingMeta("temperature", {
69262
+ precision: 1,
68873
69263
  label: "Temperature"
68874
- }),
69264
+ })),
68875
69265
  /** Ms epoch when the slice was last updated (push or poll). */
68876
- lastFetchedAt: number(),
68877
- /** Live display unit from the upstream source (e.g. HA
68878
- * `attributes.unit_of_measurement`). The UI prefers this over the
68879
- * role's canonical unit, so a Fahrenheit feed renders '°F' not '°C'.
68880
- * Absent → the UI falls back to the role's canonical unit. */
68881
- unit: string().optional(),
68882
- /** Suggested decimal places for numeric display.
68883
- * Populated live from the upstream source when provided (e.g. HA
68884
- * `attributes.suggested_display_precision`). Falls back to
68885
- * auto-formatting when absent. */
68886
- precision: number().int().min(0).max(10).optional()
69266
+ lastFetchedAt: number()
68887
69267
  });
68888
69268
  var temperatureSensorCapability = {
68889
69269
  name: "temperature-sensor",
@@ -68914,12 +69294,7 @@ var temperatureSensorCapability = {
68914
69294
  } } },
68915
69295
  /** Clock fields: written, but excluded from the compare that decides
68916
69296
  * whether persisting is worth a SQLite commit. */
68917
- volatileStateFields: ["lastFetchedAt"],
68918
- customize: {
68919
- version: 1,
68920
- advanced: "derive",
68921
- targets: []
68922
- }
69297
+ volatileStateFields: ["lastFetchedAt"]
68923
69298
  };
68924
69299
  /**
68925
69300
  * toast — system-scoped singleton capability that streams toast
@@ -69202,16 +69577,16 @@ var VacuumControlStatusSchema = object({
69202
69577
  ]),
69203
69578
  /** 0..100 battery percentage. Null when the device has no battery
69204
69579
  * reading. */
69205
- batteryLevel: number().min(0).max(100).nullable(),
69580
+ batteryLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
69206
69581
  /** Current fan-speed token (provider-verbatim). Null when unknown or
69207
69582
  * the vacuum has no speed control. */
69208
69583
  fanSpeed: string().nullable(),
69209
69584
  /** Speed tokens the hardware accepts — drives the UI selector. */
69210
69585
  availableFanSpeeds: array(string()),
69211
69586
  /** 0..100 cleaning-completion percentage of the current task, or null. */
69212
- progressPercent: number().min(0).max(100).nullable(),
69587
+ progressPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
69213
69588
  /** Current error code (0 / null = no error). */
69214
- errorCode: number().nullable(),
69589
+ errorCode: number().nullable().meta(readingMeta("none")),
69215
69590
  /** Human label for {@link errorCode}, or null when none / undecodable. */
69216
69591
  errorLabel: string().nullable(),
69217
69592
  /** Ms epoch when the slice was last updated. */
@@ -69289,7 +69664,7 @@ var ValveStatusSchema = object({
69289
69664
  ]),
69290
69665
  /** 0 = fully closed, 100 = fully open. Null when the device has no
69291
69666
  * intermediate position surface. */
69292
- position: number().min(0).max(100).nullable(),
69667
+ position: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
69293
69668
  /** Ms epoch when the slice was last updated. */
69294
69669
  lastChangedAt: number()
69295
69670
  });
@@ -69397,9 +69772,9 @@ var vibrationCapability = {
69397
69772
  */
69398
69773
  var WaterHeaterStatusSchema = object({
69399
69774
  /** Current measured temperature. Null when not reported. */
69400
- currentTemp: number().nullable(),
69775
+ currentTemp: number().nullable().meta(readingMeta("temperature")),
69401
69776
  /** Target temperature setpoint. Null when no setpoint surface. */
69402
- targetTemp: number().nullable(),
69777
+ targetTemp: number().nullable().meta(readingMeta("temperature")),
69403
69778
  /** Active operation mode = HA `state` (`eco` / `electric` / `gas` /
69404
69779
  * `heat_pump` / `high_demand` / `performance` / `off`). Null when the
69405
69780
  * device reports an unknown state. */
@@ -69410,9 +69785,9 @@ var WaterHeaterStatusSchema = object({
69410
69785
  * has no away surface. */
69411
69786
  away: boolean().nullable(),
69412
69787
  /** HA `min_temp` attribute. Null when not reported. */
69413
- minTemp: number().nullable(),
69788
+ minTemp: number().nullable().meta(readingMeta("temperature")),
69414
69789
  /** HA `max_temp` attribute. Null when not reported. */
69415
- maxTemp: number().nullable(),
69790
+ maxTemp: number().nullable().meta(readingMeta("temperature")),
69416
69791
  /** Ms epoch when the slice was last updated. */
69417
69792
  lastChangedAt: number()
69418
69793
  });
@@ -69497,25 +69872,18 @@ var waterHeaterCapability = {
69497
69872
  * Forecast deferred — current conditions only for v1.
69498
69873
  */
69499
69874
  var WeatherStatusSchema = object({
69500
- /** Verbatim HA condition state (`sunny`, `cloudy`, `rainy`, …). Null
69501
- * when no condition has been reported yet. */
69875
+ /** Verbatim condition state (`sunny`, `cloudy`, `rainy`, …). Null when none yet. */
69502
69876
  condition: string().nullable(),
69503
- /** Current temperature in the reported unit. Null when not provided. */
69504
- temperature: number().nullable(),
69505
- /** Temperature unit string (e.g. `°C` / `°F`). Null when not provided. */
69506
- temperatureUnit: string().nullable(),
69877
+ /** Current temperature in Celsius. Null when not provided or refused. */
69878
+ temperature: number().nullable().meta(readingMeta("temperature", { precision: 1 })),
69507
69879
  /** Relative humidity (0..100). Null when not provided. */
69508
- humidity: number().min(0).max(100).nullable(),
69509
- /** Barometric pressure in the reported unit. Null when not provided. */
69510
- pressure: number().nullable(),
69511
- /** Pressure unit string (e.g. `hPa` / `inHg`). Null when not provided. */
69512
- pressureUnit: string().nullable(),
69513
- /** Wind speed in the reported unit. Null when not provided. */
69514
- windSpeed: number().nullable(),
69515
- /** Wind-speed unit string (e.g. `km/h` / `mph`). Null when not provided. */
69516
- windSpeedUnit: string().nullable(),
69880
+ humidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
69881
+ /** Barometric pressure in hPa. Null when not provided or refused. */
69882
+ pressure: number().nullable().meta(readingMeta("pressure")),
69883
+ /** Wind speed in metres per second. Null when not provided or refused. */
69884
+ windSpeed: number().nullable().meta(readingMeta("speed")),
69517
69885
  /** Wind bearing in degrees (0..360, meteorological). Null when not provided. */
69518
- windBearing: number().nullable(),
69886
+ windBearing: number().nullable().meta(readingMeta("angle")),
69519
69887
  /** Ms epoch when the slice was last updated. */
69520
69888
  lastFetchedAt: number()
69521
69889
  });
@@ -69543,12 +69911,12 @@ var weatherCapability = {
69543
69911
  */
69544
69912
  durability: "session",
69545
69913
  /**
69546
- * History (D850): recorded series. Units follow the sibling `*Unit` fields.
69914
+ * History (D850): recorded series. Numbers are the quantity base (D944).
69547
69915
  */
69548
69916
  history: { fields: {
69549
69917
  temperature: {
69550
69918
  kind: "gauge",
69551
- unitFrom: "temperatureUnit",
69919
+ unit: "°C",
69552
69920
  deadband: .2
69553
69921
  },
69554
69922
  humidity: {
@@ -69558,12 +69926,12 @@ var weatherCapability = {
69558
69926
  },
69559
69927
  pressure: {
69560
69928
  kind: "gauge",
69561
- unitFrom: "pressureUnit",
69929
+ unit: "hPa",
69562
69930
  deadband: .5
69563
69931
  },
69564
69932
  windSpeed: {
69565
69933
  kind: "gauge",
69566
- unitFrom: "windSpeedUnit",
69934
+ unit: "m/s",
69567
69935
  deadband: .5
69568
69936
  }
69569
69937
  } }
@@ -70942,6 +71310,8 @@ var DEVICE_LOCAL_STATE_CAPS = {
70942
71310
  featureProbe: featureProbeCapability,
70943
71311
  flood: floodCapability,
70944
71312
  gas: gasCapability,
71313
+ groupCommands: groupCommandsCapability,
71314
+ groupStatus: groupStatusCapability,
70945
71315
  heatingValve: heatingValveCapability,
70946
71316
  humidifier: humidifierCapability,
70947
71317
  humiditySensor: humiditySensorCapability,
@@ -72322,6 +72692,13 @@ Object.freeze({
72322
72692
  access: "view",
72323
72693
  role: "admin"
72324
72694
  },
72695
+ "addons.getPackageDocs": {
72696
+ capName: "addons",
72697
+ capScope: "system",
72698
+ addonId: null,
72699
+ access: "view",
72700
+ role: "admin"
72701
+ },
72325
72702
  "addons.getVersions": {
72326
72703
  capName: "addons",
72327
72704
  capScope: "system",
@@ -75430,6 +75807,20 @@ Object.freeze({
75430
75807
  access: "view",
75431
75808
  role: "viewer"
75432
75809
  },
75810
+ "groupCommands.getStatus": {
75811
+ capName: "group-commands",
75812
+ capScope: "device",
75813
+ addonId: null,
75814
+ access: "view",
75815
+ role: "viewer"
75816
+ },
75817
+ "groupStatus.getStatus": {
75818
+ capName: "group-status",
75819
+ capScope: "device",
75820
+ addonId: null,
75821
+ access: "view",
75822
+ role: "viewer"
75823
+ },
75433
75824
  "heatingValve.getStatus": {
75434
75825
  capName: "heating-valve",
75435
75826
  capScope: "device",
@@ -85252,6 +85643,37 @@ var SENSOR_CAP_VOCABULARY = {
85252
85643
  icon: "flame"
85253
85644
  }]
85254
85645
  },
85646
+ "group-commands": {
85647
+ scope: "device",
85648
+ noun: t("Group command", "Comando di gruppo")
85649
+ },
85650
+ "group-status": {
85651
+ scope: "device",
85652
+ noun: t("Group", "Gruppo"),
85653
+ state: [
85654
+ {
85655
+ kind: "numeric",
85656
+ field: "included",
85657
+ quantity: t("the members reporting", "i membri che rispondono"),
85658
+ label: t("Reporting", "Rispondono"),
85659
+ icon: "users"
85660
+ },
85661
+ {
85662
+ kind: "numeric",
85663
+ field: "excluded",
85664
+ quantity: t("the members left out", "i membri esclusi"),
85665
+ label: t("Excluded", "Esclusi"),
85666
+ icon: "users"
85667
+ },
85668
+ {
85669
+ kind: "numeric",
85670
+ field: "total",
85671
+ quantity: t("the member count", "il numero di membri"),
85672
+ label: t("Members", "Membri"),
85673
+ icon: "sigma"
85674
+ }
85675
+ ]
85676
+ },
85255
85677
  "humidity-sensor": {
85256
85678
  scope: "device",
85257
85679
  noun: t("Humidity", "Umidità"),
@@ -85285,7 +85707,6 @@ var SENSOR_CAP_VOCABULARY = {
85285
85707
  field: "value",
85286
85708
  quantity: t("the reading", "il valore"),
85287
85709
  label: t("Reading", "Valore"),
85288
- unitField: "unit",
85289
85710
  icon: "gauge"
85290
85711
  }]
85291
85712
  },
@@ -85421,7 +85842,7 @@ var SENSOR_CAP_VOCABULARY = {
85421
85842
  field: "temperature",
85422
85843
  quantity: t("the outdoor temperature", "la temperatura esterna"),
85423
85844
  label: t("Temperature", "Temperatura"),
85424
- unitField: "temperatureUnit",
85845
+ unit: "°C",
85425
85846
  icon: "thermometer"
85426
85847
  },
85427
85848
  {
@@ -85437,7 +85858,7 @@ var SENSOR_CAP_VOCABULARY = {
85437
85858
  field: "windSpeed",
85438
85859
  quantity: t("the wind speed", "la velocità del vento"),
85439
85860
  label: t("Wind", "Vento"),
85440
- unitField: "windSpeedUnit",
85861
+ unit: "m/s",
85441
85862
  icon: "wind"
85442
85863
  },
85443
85864
  {
@@ -85445,7 +85866,7 @@ var SENSOR_CAP_VOCABULARY = {
85445
85866
  field: "pressure",
85446
85867
  quantity: t("the air pressure", "la pressione atmosferica"),
85447
85868
  label: t("Pressure", "Pressione"),
85448
- unitField: "pressureUnit",
85869
+ unit: "hPa",
85449
85870
  icon: "gauge"
85450
85871
  }
85451
85872
  ]
@@ -86936,6 +87357,16 @@ Object.freeze({
86936
87357
  form: "single",
86937
87358
  optional: false
86938
87359
  }],
87360
+ "groupCommands.getStatus": [{
87361
+ name: "deviceId",
87362
+ form: "single",
87363
+ optional: false
87364
+ }],
87365
+ "groupStatus.getStatus": [{
87366
+ name: "deviceId",
87367
+ form: "single",
87368
+ optional: false
87369
+ }],
86939
87370
  "heatingValve.getStatus": [{
86940
87371
  name: "deviceId",
86941
87372
  form: "single",
@@ -88920,6 +89351,8 @@ new Map(Object.entries({
88920
89351
  "detection-blind": "device-events",
88921
89352
  "motion-noisy": "device-events",
88922
89353
  "motion-calm": "device-events",
89354
+ "package-llm-silent": "device-events",
89355
+ "package-llm-answered": "device-events",
88923
89356
  "recording-stalled": "device-events",
88924
89357
  "recording-healthy": "device-events",
88925
89358
  "recording-degraded": "device-events",
@@ -89003,6 +89436,12 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
89003
89436
  label: "Motion without a subject",
89004
89437
  kinds: ["motion-noisy", "motion-calm"]
89005
89438
  },
89439
+ {
89440
+ id: "package-llm",
89441
+ family: "device-events",
89442
+ label: "Package confirm",
89443
+ kinds: ["package-llm-silent", "package-llm-answered"]
89444
+ },
89006
89445
  {
89007
89446
  id: "recording",
89008
89447
  family: "device-events",
@@ -89184,6 +89623,8 @@ var DEVICE_EVENTS = [
89184
89623
  "detection-blind",
89185
89624
  "motion-noisy",
89186
89625
  "motion-calm",
89626
+ "package-llm-silent",
89627
+ "package-llm-answered",
89187
89628
  "recording-stalled",
89188
89629
  "recording-healthy",
89189
89630
  "recording-degraded",
@@ -89452,6 +89893,15 @@ new Map([
89452
89893
  snapshotLabel: "Cameras with constant motion now",
89453
89894
  snapshotSection: null
89454
89895
  },
89896
+ {
89897
+ id: "package-llm-confirm",
89898
+ family: "device-events",
89899
+ label: "Package confirm (not answering / answering again)",
89900
+ bad: ["package-llm-silent"],
89901
+ recovery: ["package-llm-answered"],
89902
+ snapshotLabel: "Cameras whose package confirm is not answering",
89903
+ snapshotSection: null
89904
+ },
89455
89905
  {
89456
89906
  id: "recording-health",
89457
89907
  family: "device-events",