@camstack/addon-provider-hikvision 1.2.175 → 1.2.177

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/addon.js CHANGED
@@ -34,7 +34,7 @@ let node_os = require("node:os");
34
34
  let node_net = require("node:net");
35
35
  let node_http = require("node:http");
36
36
  let node_https = require("node:https");
37
- //#region ../types/dist/event-category-DHXxB8t9.mjs
37
+ //#region ../types/dist/event-category-CT-hz5Rb.mjs
38
38
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
39
39
  EventCategory["SystemBoot"] = "system.boot";
40
40
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -360,6 +360,14 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
360
360
  /** The recovery edge of {@link PipelineMotionNoisy}: the motion fell back, or a detection arrived. */
361
361
  EventCategory["PipelineMotionCalm"] = "pipeline.motion-calm";
362
362
  /**
363
+ * A camera's package LLM confirm has failed closed three times in a row
364
+ * (D931, 2026-10-26). One edge per camera until
365
+ * {@link PipelinePackageLlmAnswered}.
366
+ */
367
+ EventCategory["PipelinePackageLlmSilent"] = "pipeline.package-llm-silent";
368
+ /** The recovery edge of {@link PipelinePackageLlmSilent}: a confirm returned yes or no. */
369
+ EventCategory["PipelinePackageLlmAnswered"] = "pipeline.package-llm-answered";
370
+ /**
363
371
  * Per-camera pipeline config was mutated by the orchestrator
364
372
  * (a settings change via `setAgentInferenceDevices` /
365
373
  * `setCameraStepToggle` / `setCameraStepSettings`). Orchestrator
@@ -5469,7 +5477,7 @@ var ZodIssueCode = {
5469
5477
  var ZodFirstPartyTypeKind;
5470
5478
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5471
5479
  //#endregion
5472
- //#region ../types/dist/sleep-BErAxhul.mjs
5480
+ //#region ../types/dist/sleep--jXS9hWo.mjs
5473
5481
  /**
5474
5482
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5475
5483
  * window to float samples (D455).
@@ -8023,6 +8031,99 @@ var RecordKindDeclarationSchema = object({
8023
8031
  }).strict();
8024
8032
  /** The kind names: lower-case, dash separated, short enough for an index name. */
8025
8033
  var RecordKindNameSchema = string().regex(/^[a-z][a-z0-9-]{0,47}$/);
8034
+ var READING_QUANTITIES = [
8035
+ "temperature",
8036
+ "pressure",
8037
+ "speed",
8038
+ "precipitation",
8039
+ "precipitation-rate",
8040
+ "length",
8041
+ "area",
8042
+ "illuminance",
8043
+ "irradiance",
8044
+ "power",
8045
+ "energy",
8046
+ "voltage",
8047
+ "current",
8048
+ "apparent-power",
8049
+ "humidity",
8050
+ "percentage",
8051
+ "concentration-volume",
8052
+ "concentration-mass",
8053
+ "concentration-ppb",
8054
+ "volume",
8055
+ "duration",
8056
+ "duration-ms",
8057
+ "information",
8058
+ "sound-level",
8059
+ "signal-level",
8060
+ "colour-temperature",
8061
+ "angle",
8062
+ "bitrate",
8063
+ "rate",
8064
+ "mass",
8065
+ "index",
8066
+ "ratio",
8067
+ "count",
8068
+ "none",
8069
+ "device"
8070
+ ];
8071
+ var ReadingQuantitySchema = _enum(READING_QUANTITIES);
8072
+ new Set(READING_QUANTITIES);
8073
+ /**
8074
+ * Stored unit symbol for a quantity. `none` means the number is dimensionless
8075
+ * (or an index / ratio / count). `device` means the cap has no single unit.
8076
+ */
8077
+ var QUANTITY_BASE = {
8078
+ temperature: "°C",
8079
+ pressure: "hPa",
8080
+ speed: "m/s",
8081
+ precipitation: "mm",
8082
+ "precipitation-rate": "mm/h",
8083
+ length: "m",
8084
+ area: "m²",
8085
+ illuminance: "lx",
8086
+ irradiance: "W/m²",
8087
+ power: "W",
8088
+ energy: "kWh",
8089
+ voltage: "V",
8090
+ current: "A",
8091
+ "apparent-power": "VA",
8092
+ humidity: "%",
8093
+ percentage: "%",
8094
+ "concentration-volume": "ppm",
8095
+ "concentration-mass": "µg/m³",
8096
+ "concentration-ppb": "ppb",
8097
+ volume: "L",
8098
+ duration: "s",
8099
+ "duration-ms": "ms",
8100
+ information: "B",
8101
+ "sound-level": "dBFS",
8102
+ "signal-level": "dBm",
8103
+ "colour-temperature": "mired",
8104
+ angle: "°",
8105
+ bitrate: "kbps",
8106
+ rate: "fps",
8107
+ mass: "kg",
8108
+ index: "none",
8109
+ ratio: "none",
8110
+ count: "none",
8111
+ none: "none",
8112
+ device: "device"
8113
+ };
8114
+ /** The stored unit, or `undefined` when the quantity has no unit symbol. */
8115
+ function baseUnitOf(quantity) {
8116
+ const symbol = QUANTITY_BASE[quantity];
8117
+ if (symbol === "none" || symbol === "device") return void 0;
8118
+ return symbol;
8119
+ }
8120
+ function readingMeta(quantity, extras) {
8121
+ return {
8122
+ quantity,
8123
+ ...extras?.precision !== void 0 ? { precision: extras.precision } : {},
8124
+ ...extras?.label !== void 0 ? { label: extras.label } : {}
8125
+ };
8126
+ }
8026
8127
  /** Shared Zod schemas used across streaming capabilities. */
8027
8128
  var CamProfileSchema = _enum([
8028
8129
  "high",
@@ -8050,8 +8151,8 @@ var CamStreamKindSchema = _enum([
8050
8151
  "derived"
8051
8152
  ]);
8052
8153
  var CamStreamResolutionSchema = object({
8053
- width: number().int().positive(),
8054
- height: number().int().positive()
8154
+ width: number().int().positive().meta(readingMeta("none")),
8155
+ height: number().int().positive().meta(readingMeta("none"))
8055
8156
  });
8056
8157
  var CameraStreamSchema = object({
8057
8158
  /** Stable, provider-assigned id unique within the (deviceId) scope. */
@@ -8581,6 +8682,9 @@ var CAP_NAMES = Object.freeze([
8581
8682
  "filesystem-browse",
8582
8683
  "flood",
8583
8684
  "gas",
8685
+ "group-active",
8686
+ "group-commands",
8687
+ "group-status",
8584
8688
  "heating-valve",
8585
8689
  "humidifier",
8586
8690
  "humidity-sensor",
@@ -8601,6 +8705,7 @@ var CAP_NAMES = Object.freeze([
8601
8705
  "login-method",
8602
8706
  "media-player",
8603
8707
  "mesh-network",
8708
+ "meter",
8604
8709
  "metrics-provider",
8605
8710
  "model-convert",
8606
8711
  "model-distributor",
@@ -8710,14 +8815,6 @@ Object.freeze({
8710
8815
  {
8711
8816
  "path": "aqi",
8712
8817
  "valueType": "number"
8713
- },
8714
- {
8715
- "path": "unit",
8716
- "valueType": "string"
8717
- },
8718
- {
8719
- "path": "precision",
8720
- "valueType": "number"
8721
8818
  }
8722
8819
  ],
8723
8820
  "alarm-panel": [
@@ -8753,20 +8850,10 @@ Object.freeze({
8753
8850
  "valueType": "boolean"
8754
8851
  }
8755
8852
  ],
8756
- "ambient-light-sensor": [
8757
- {
8758
- "path": "lux",
8759
- "valueType": "number"
8760
- },
8761
- {
8762
- "path": "unit",
8763
- "valueType": "string"
8764
- },
8765
- {
8766
- "path": "precision",
8767
- "valueType": "number"
8768
- }
8769
- ],
8853
+ "ambient-light-sensor": [{
8854
+ "path": "lux",
8855
+ "valueType": "number"
8856
+ }],
8770
8857
  "audio-metrics": [
8771
8858
  {
8772
8859
  "path": "ts",
@@ -8846,6 +8933,10 @@ Object.freeze({
8846
8933
  "path": "lastUpdated",
8847
8934
  "valueType": "number"
8848
8935
  },
8936
+ {
8937
+ "path": "volts",
8938
+ "valueType": "number"
8939
+ },
8849
8940
  {
8850
8941
  "path": "lastContactAt",
8851
8942
  "valueType": "number"
@@ -9088,10 +9179,6 @@ Object.freeze({
9088
9179
  "datetime"
9089
9180
  ]
9090
9181
  },
9091
- {
9092
- "path": "unit",
9093
- "valueType": "string"
9094
- },
9095
9182
  {
9096
9183
  "path": "min",
9097
9184
  "valueType": "number"
@@ -9103,19 +9190,6 @@ Object.freeze({
9103
9190
  {
9104
9191
  "path": "step",
9105
9192
  "valueType": "number"
9106
- },
9107
- {
9108
- "path": "precision",
9109
- "valueType": "number"
9110
- },
9111
- {
9112
- "path": "format",
9113
- "valueType": "enum",
9114
- "enumValues": [
9115
- "date",
9116
- "time",
9117
- "datetime"
9118
- ]
9119
9193
  }
9120
9194
  ],
9121
9195
  "cover": [
@@ -9356,13 +9430,8 @@ Object.freeze({
9356
9430
  "path": "value",
9357
9431
  "valueType": "string"
9358
9432
  }, {
9359
- "path": "format",
9360
- "valueType": "enum",
9361
- "enumValues": [
9362
- "date",
9363
- "time",
9364
- "datetime"
9365
- ]
9433
+ "path": "timestamp",
9434
+ "valueType": "boolean"
9366
9435
  }],
9367
9436
  "event-emitter": [
9368
9437
  {
@@ -9435,6 +9504,24 @@ Object.freeze({
9435
9504
  "path": "detected",
9436
9505
  "valueType": "boolean"
9437
9506
  }],
9507
+ "group-active": [{
9508
+ "path": "active",
9509
+ "valueType": "boolean"
9510
+ }],
9511
+ "group-status": [
9512
+ {
9513
+ "path": "included",
9514
+ "valueType": "number"
9515
+ },
9516
+ {
9517
+ "path": "excluded",
9518
+ "valueType": "number"
9519
+ },
9520
+ {
9521
+ "path": "total",
9522
+ "valueType": "number"
9523
+ }
9524
+ ],
9438
9525
  "heating-valve": [{
9439
9526
  "path": "position",
9440
9527
  "valueType": "number"
@@ -9469,20 +9556,10 @@ Object.freeze({
9469
9556
  "valueType": "number"
9470
9557
  }
9471
9558
  ],
9472
- "humidity-sensor": [
9473
- {
9474
- "path": "percent",
9475
- "valueType": "number"
9476
- },
9477
- {
9478
- "path": "unit",
9479
- "valueType": "string"
9480
- },
9481
- {
9482
- "path": "precision",
9483
- "valueType": "number"
9484
- }
9485
- ],
9559
+ "humidity-sensor": [{
9560
+ "path": "percent",
9561
+ "valueType": "number"
9562
+ }],
9486
9563
  "image": [{
9487
9564
  "path": "url",
9488
9565
  "valueType": "string"
@@ -9690,6 +9767,10 @@ Object.freeze({
9690
9767
  ]
9691
9768
  }
9692
9769
  ],
9770
+ "meter": [{
9771
+ "path": "value",
9772
+ "valueType": "number"
9773
+ }],
9693
9774
  "motion": [
9694
9775
  {
9695
9776
  "path": "detected",
@@ -9821,20 +9902,10 @@ Object.freeze({
9821
9902
  "valueType": "boolean"
9822
9903
  }
9823
9904
  ],
9824
- "numeric-sensor": [
9825
- {
9826
- "path": "value",
9827
- "valueType": "number"
9828
- },
9829
- {
9830
- "path": "unit",
9831
- "valueType": "string"
9832
- },
9833
- {
9834
- "path": "precision",
9835
- "valueType": "number"
9836
- }
9837
- ],
9905
+ "numeric-sensor": [{
9906
+ "path": "value",
9907
+ "valueType": "number"
9908
+ }],
9838
9909
  "pet-feeder": [
9839
9910
  {
9840
9911
  "path": "foodLevel",
@@ -9926,14 +9997,6 @@ Object.freeze({
9926
9997
  {
9927
9998
  "path": "powerFactor",
9928
9999
  "valueType": "number"
9929
- },
9930
- {
9931
- "path": "unit",
9932
- "valueType": "string"
9933
- },
9934
- {
9935
- "path": "precision",
9936
- "valueType": "number"
9937
10000
  }
9938
10001
  ],
9939
10002
  "presence": [
@@ -9962,20 +10025,10 @@ Object.freeze({
9962
10025
  "valueType": "number"
9963
10026
  }
9964
10027
  ],
9965
- "pressure-sensor": [
9966
- {
9967
- "path": "hpa",
9968
- "valueType": "number"
9969
- },
9970
- {
9971
- "path": "unit",
9972
- "valueType": "string"
9973
- },
9974
- {
9975
- "path": "precision",
9976
- "valueType": "number"
9977
- }
9978
- ],
10028
+ "pressure-sensor": [{
10029
+ "path": "hpa",
10030
+ "valueType": "number"
10031
+ }],
9979
10032
  "privacy-mask": [{
9980
10033
  "path": "enabled",
9981
10034
  "valueType": "boolean"
@@ -10286,20 +10339,10 @@ Object.freeze({
10286
10339
  "path": "tampered",
10287
10340
  "valueType": "boolean"
10288
10341
  }],
10289
- "temperature-sensor": [
10290
- {
10291
- "path": "celsius",
10292
- "valueType": "number"
10293
- },
10294
- {
10295
- "path": "unit",
10296
- "valueType": "string"
10297
- },
10298
- {
10299
- "path": "precision",
10300
- "valueType": "number"
10301
- }
10302
- ],
10342
+ "temperature-sensor": [{
10343
+ "path": "celsius",
10344
+ "valueType": "number"
10345
+ }],
10303
10346
  "update": [
10304
10347
  {
10305
10348
  "path": "currentVersion",
@@ -10410,10 +10453,6 @@ Object.freeze({
10410
10453
  "path": "temperature",
10411
10454
  "valueType": "number"
10412
10455
  },
10413
- {
10414
- "path": "temperatureUnit",
10415
- "valueType": "string"
10416
- },
10417
10456
  {
10418
10457
  "path": "humidity",
10419
10458
  "valueType": "number"
@@ -10422,18 +10461,10 @@ Object.freeze({
10422
10461
  "path": "pressure",
10423
10462
  "valueType": "number"
10424
10463
  },
10425
- {
10426
- "path": "pressureUnit",
10427
- "valueType": "string"
10428
- },
10429
10464
  {
10430
10465
  "path": "windSpeed",
10431
10466
  "valueType": "number"
10432
10467
  },
10433
- {
10434
- "path": "windSpeedUnit",
10435
- "valueType": "string"
10436
- },
10437
10468
  {
10438
10469
  "path": "windBearing",
10439
10470
  "valueType": "number"
@@ -10497,7 +10528,7 @@ function userError(code, params, englishFallback) {
10497
10528
  return new CamstackError(code, params, englishFallback);
10498
10529
  }
10499
10530
  //#endregion
10500
- //#region ../types/dist/err-msg-BXKzRBwg.mjs
10531
+ //#region ../types/dist/err-msg-DIorGYeC.mjs
10501
10532
  var DeviceType = /* @__PURE__ */ function(DeviceType) {
10502
10533
  DeviceType["Camera"] = "camera";
10503
10534
  DeviceType["Hub"] = "hub";
@@ -10591,8 +10622,14 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
10591
10622
  DeviceType["PetFeeder"] = "pet-feeder";
10592
10623
  /** Built-in dishwasher — program lifecycle, door / remote-start gates,
10593
10624
  * salt and rinse-aid levels. Installed with the `dishwasher` cap.
10594
- * Sources: native Bosch Home Connect, reusable by similar integrations. */
10625
+ * Sources: native Bosch Home Connect, reusable by similar integrations.
10626
+ * A plug-built dishwasher carries running-state and power instead. */
10595
10627
  DeviceType["Dishwasher"] = "dishwasher";
10628
+ /** Washing machine. A plug-built one is running while its power stays
10629
+ * above a threshold. No program cap — that surface is the dishwasher's. */
10630
+ DeviceType["Washer"] = "washer";
10631
+ /** Tumble dryer. Same plug-built running surface as {@link Washer}. */
10632
+ DeviceType["Dryer"] = "dryer";
10596
10633
  return DeviceType;
10597
10634
  }({});
10598
10635
  var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
@@ -10840,7 +10877,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
10840
10877
  return DeviceRole;
10841
10878
  }({});
10842
10879
  //#endregion
10843
- //#region ../types/dist/composition-kEl9mevu.mjs
10880
+ //#region ../types/dist/composition-Bb8iwHEJ.mjs
10844
10881
  /**
10845
10882
  * The ffmpeg build every CamStack node downloads, per platform and arch.
10846
10883
  *
@@ -11155,6 +11192,13 @@ var table = {
11155
11192
  apply: () => {
11156
11193
  throw new ExpressionEvalError("latchedAt: stateful evaluation context is required");
11157
11194
  }
11195
+ },
11196
+ schmitt: {
11197
+ minArgs: 3,
11198
+ maxArgs: 5,
11199
+ apply: () => {
11200
+ throw new ExpressionEvalError("schmitt: stateful evaluation context is required");
11201
+ }
11158
11202
  }
11159
11203
  };
11160
11204
  Object.freeze(Object.assign(Object.create(null), table));
@@ -11595,15 +11639,232 @@ function validateExpressionSource(src) {
11595
11639
  }
11596
11640
  return null;
11597
11641
  }
11598
- /** A composed device's stableId is this prefix plus the block id. */
11599
- var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
11600
- /** Longest snippet a `code` source may carry (slice 4). */
11601
- var MAX_COMPOSITION_CODE_LENGTH = 2e4;
11642
+ /**
11643
+ * One power reading becomes a washer, dryer or dishwasher (D944 helper).
11644
+ *
11645
+ * Standby of the control board is under 5 W; a motor or a heater is far
11646
+ * above that, so 5 W is the line. A door lock or a short pump spike is not
11647
+ * a cycle, so running starts only after 30 s above the line.
11648
+ *
11649
+ * A wash, dry or dishwasher pause (soak, heat-wait, heater off between
11650
+ * bursts) lasts several minutes. Ending the cycle on the first dip would
11651
+ * report "finished" in the middle of the program, so the stop dwell is
11652
+ * 10 minutes on every type. The number is stored per type so one machine
11653
+ * can move later without moving the others.
11654
+ */
11655
+ var APPLIANCE_TEMPLATE_ID = "appliance";
11656
+ var APPLIANCE_KINDS = [
11657
+ "washer",
11658
+ "dryer",
11659
+ "dishwasher"
11660
+ ];
11661
+ DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
11662
+ /**
11663
+ * Statistics and integrals over a history read (D944).
11664
+ *
11665
+ * Pure: the same points always give the same answer, so a restart recomputes
11666
+ * rather than trusting a buffer. A gauge mean is time-weighted (value × ms),
11667
+ * never the mean of the samples. A hole with no held value is not integrated
11668
+ * as zero. A truncated read is not published.
11669
+ */
11670
+ var STATISTIC_STATS = [
11671
+ "min",
11672
+ "max",
11673
+ "mean",
11674
+ "sum",
11675
+ "count",
11676
+ "change"
11677
+ ];
11678
+ /**
11679
+ * The range a statistics or integral helper asks history for (D944).
11680
+ *
11681
+ * Calendar edges are the hub's timezone, never UTC midnight: a day is 23, 24
11682
+ * or 25 hours across a DST change. A tier is eligible only when its retention
11683
+ * is strictly longer than the longest that range can be. Forever qualifies.
11684
+ * Equal to a tier's retention is a refusal, not a short answer.
11685
+ */
11686
+ var MINUTE_MS = 6e4;
11687
+ var HOUR_MS = 60 * MINUTE_MS;
11688
+ var DAY_MS = 24 * HOUR_MS;
11689
+ var ROLLING_SPANS = [
11690
+ "1h",
11691
+ "24h",
11692
+ "2d",
11693
+ "7d",
11694
+ "30d",
11695
+ "custom"
11696
+ ];
11697
+ var CALENDAR_PERIODS = [
11698
+ "today",
11699
+ "yesterday",
11700
+ "this-week",
11701
+ "this-month"
11702
+ ];
11703
+ var RESET_PERIODS = [
11704
+ "never",
11705
+ "daily",
11706
+ "weekly",
11707
+ "monthly"
11708
+ ];
11709
+ 5 * MINUTE_MS;
11710
+ 24 * HOUR_MS, 2 * DAY_MS, 7 * DAY_MS, 30 * DAY_MS;
11711
+ 7 * DAY_MS, 30 * DAY_MS, 365 * DAY_MS;
11712
+ var rollingWindowObject = object({
11713
+ kind: literal("rolling"),
11714
+ span: _enum(ROLLING_SPANS),
11715
+ customMinutes: number().int().min(5).optional()
11716
+ }).check((payload) => {
11717
+ if (payload.value.span === "custom" && payload.value.customMinutes === void 0) payload.issues.push({
11718
+ code: "custom",
11719
+ message: "a custom range needs a duration in minutes",
11720
+ path: ["customMinutes"],
11721
+ input: payload.value
11722
+ });
11723
+ if (payload.value.span !== "custom" && payload.value.customMinutes !== void 0) payload.issues.push({
11724
+ code: "custom",
11725
+ message: "only a custom range carries a duration",
11726
+ path: ["customMinutes"],
11727
+ input: payload.value
11728
+ });
11729
+ });
11730
+ var RollingWindowSchema = rollingWindowObject;
11731
+ var StatisticWindowSchema = discriminatedUnion("kind", [rollingWindowObject, object({
11732
+ kind: literal("calendar"),
11733
+ period: _enum(CALENDAR_PERIODS)
11734
+ })]);
11735
+ /**
11736
+ * A composition source identity: `(addonId, stableId)`, never a numeric device
11737
+ * id. Split out so helper schemas can name it without a cycle through
11738
+ * `composition.ts` (D659).
11739
+ */
11602
11740
  var CompositionSourceRefSchema = object({
11603
11741
  /** The owning addon; `stableId` is unique only within it. */
11604
11742
  addonId: string().min(1),
11605
11743
  stableId: string().min(1)
11606
11744
  });
11745
+ var GROUP_TEMPLATE_IDS = [
11746
+ "temperature",
11747
+ "humidity",
11748
+ "pressure",
11749
+ "illuminance",
11750
+ "power",
11751
+ "energy",
11752
+ "battery",
11753
+ "numeric",
11754
+ "motion",
11755
+ "contact",
11756
+ "leak",
11757
+ "smoke",
11758
+ "occupancy",
11759
+ "binary",
11760
+ "switch",
11761
+ "light",
11762
+ "fan",
11763
+ "cover",
11764
+ "valve",
11765
+ "lock",
11766
+ "media-player",
11767
+ "climate"
11768
+ ];
11769
+ var NUMERIC_AGGREGATES = [
11770
+ "mean",
11771
+ "median",
11772
+ "min",
11773
+ "max",
11774
+ "sum"
11775
+ ];
11776
+ var BINARY_AGGREGATES = ["any", "all"];
11777
+ /** How an actuator group decides it is on. Unknown members never count as off. */
11778
+ var ACTIVE_CRITERIA = ["at-least-one", "all"];
11779
+ var AGGREGATE_REDUCERS = [
11780
+ "mean",
11781
+ "median",
11782
+ "min",
11783
+ "max",
11784
+ "sum",
11785
+ "any",
11786
+ "all"
11787
+ ];
11788
+ var GroupTemplateIdSchema = _enum(GROUP_TEMPLATE_IDS);
11789
+ var AggregateReducerSchema = _enum(AGGREGATE_REDUCERS);
11790
+ var ActiveCriterionSchema = _enum(ACTIVE_CRITERIA);
11791
+ /** One member. The field is stored so occupancy can name motion or binary. */
11792
+ var HelperMemberSchema = object({
11793
+ source: CompositionSourceRefSchema,
11794
+ cap: string().min(1),
11795
+ fieldPath: string().min(1)
11796
+ });
11797
+ var HelperSpecSchema = discriminatedUnion("kind", [
11798
+ object({
11799
+ kind: literal("group"),
11800
+ templateId: GroupTemplateIdSchema,
11801
+ aggregate: AggregateReducerSchema,
11802
+ members: array(HelperMemberSchema).min(1).max(64),
11803
+ /** Actuator groups only. Readings leave this unset. */
11804
+ active: ActiveCriterionSchema.optional()
11805
+ }),
11806
+ object({
11807
+ kind: literal("appliance"),
11808
+ templateId: literal(APPLIANCE_TEMPLATE_ID),
11809
+ appliance: _enum(APPLIANCE_KINDS),
11810
+ thresholdWatts: number().positive(),
11811
+ startDwellMs: number().int().nonnegative(),
11812
+ stopDwellMs: number().int().nonnegative(),
11813
+ member: HelperMemberSchema
11814
+ }),
11815
+ object({
11816
+ kind: literal("statistic"),
11817
+ stat: _enum(STATISTIC_STATS),
11818
+ window: StatisticWindowSchema,
11819
+ source: HelperMemberSchema
11820
+ }),
11821
+ object({
11822
+ kind: literal("integral"),
11823
+ reset: _enum(RESET_PERIODS),
11824
+ output: _enum(["energy", "meter"]),
11825
+ source: HelperMemberSchema
11826
+ }),
11827
+ object({
11828
+ kind: literal("threshold"),
11829
+ source: HelperMemberSchema,
11830
+ high: number(),
11831
+ low: number(),
11832
+ onForMs: number().int().nonnegative(),
11833
+ offForMs: number().int().nonnegative()
11834
+ }),
11835
+ object({
11836
+ kind: literal("arithmetic"),
11837
+ op: _enum([
11838
+ "sum",
11839
+ "difference",
11840
+ "ratio"
11841
+ ]),
11842
+ inputs: array(HelperMemberSchema).min(2).max(64)
11843
+ }),
11844
+ object({
11845
+ kind: literal("expression"),
11846
+ expr: string().min(1),
11847
+ inputs: array(object({
11848
+ name: string().min(1),
11849
+ member: HelperMemberSchema
11850
+ })).min(1).max(64),
11851
+ output: _enum(["number", "boolean"])
11852
+ }),
11853
+ object({
11854
+ kind: literal("derivative"),
11855
+ window: RollingWindowSchema,
11856
+ per: _enum([
11857
+ "second",
11858
+ "minute",
11859
+ "hour"
11860
+ ]),
11861
+ source: HelperMemberSchema
11862
+ })
11863
+ ]);
11864
+ /** A composed device's stableId is this prefix plus the block id. */
11865
+ var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
11866
+ /** Longest snippet a `code` source may carry (slice 4). */
11867
+ var MAX_COMPOSITION_CODE_LENGTH = 2e4;
11607
11868
  /** One field of one capability of one source device. */
11608
11869
  var CompositionFieldReadSchema = object({
11609
11870
  source: CompositionSourceRefSchema,
@@ -11647,7 +11908,59 @@ var CompositionCodeSourceSchema = object({
11647
11908
  var CompositionFieldSourceSchema = discriminatedUnion("kind", [
11648
11909
  CompositionFromSourceSchema,
11649
11910
  CompositionExpressionSourceSchema,
11650
- CompositionCodeSourceSchema
11911
+ CompositionCodeSourceSchema,
11912
+ object({
11913
+ kind: literal("aggregate"),
11914
+ reducer: _enum([
11915
+ "mean",
11916
+ "median",
11917
+ "min",
11918
+ "max",
11919
+ "sum",
11920
+ "any",
11921
+ "all"
11922
+ ]),
11923
+ reads: array(CompositionFieldReadSchema).min(1).max(64),
11924
+ /**
11925
+ * Set when the reads are an enum state, not a yes/no: the listed states
11926
+ * count as active (a cover is `open`). A state outside the list is inactive;
11927
+ * a read that is not a state at all is left out. Only `any` / `all` use it.
11928
+ */
11929
+ activeWhen: array(string().min(1)).min(1).optional(),
11930
+ /** `value` is the reading; the others are the member counts. */
11931
+ publish: _enum([
11932
+ "value",
11933
+ "included",
11934
+ "excluded",
11935
+ "total"
11936
+ ]),
11937
+ /** What a `value` publish does when nobody is included. Counts ignore this. */
11938
+ empty: _enum([
11939
+ "null",
11940
+ "omit",
11941
+ "offline"
11942
+ ])
11943
+ }),
11944
+ object({
11945
+ kind: literal("series"),
11946
+ read: CompositionFieldReadSchema,
11947
+ /** `value` is the statistic or the integral. The others are the gap counts. */
11948
+ publish: _enum([
11949
+ "value",
11950
+ "included",
11951
+ "excluded",
11952
+ "total"
11953
+ ]),
11954
+ /**
11955
+ * What an unanswered `value` does. Counts ignore this. `offline` leaves the
11956
+ * device unseeded until history answers, so a restart cannot publish 0.
11957
+ */
11958
+ empty: _enum([
11959
+ "null",
11960
+ "omit",
11961
+ "offline"
11962
+ ])
11963
+ })
11651
11964
  ]);
11652
11965
  var CompositionCommandTargetSchema = discriminatedUnion("kind", [object({
11653
11966
  kind: literal("forward"),
@@ -11693,7 +12006,13 @@ var CompositionSchema = object({
11693
12006
  kind: literal("existing"),
11694
12007
  device: CompositionSourceRefSchema
11695
12008
  })]),
11696
- features: array(CompositionFeatureSchema).min(1).max(16)
12009
+ features: array(CompositionFeatureSchema).min(1).max(16),
12010
+ /**
12011
+ * Present when the block is a helper template. Absent on a free
12012
+ * composition (the room example, device 4603). The editor reads this,
12013
+ * never the compiled features.
12014
+ */
12015
+ helper: HelperSpecSchema.optional()
11697
12016
  }).superRefine((composition, ctx) => {
11698
12017
  const seen = /* @__PURE__ */ new Set();
11699
12018
  composition.features.forEach((feature, index) => {
@@ -17119,7 +17438,22 @@ var BrokerProviderInfoSchema = object({
17119
17438
  */
17120
17439
  interactiveConnectPath: string().min(1).optional(),
17121
17440
  /** Relative hub path to disconnect the linked account (same popup pattern). */
17122
- interactiveDisconnectPath: string().min(1).optional()
17441
+ interactiveDisconnectPath: string().min(1).optional(),
17442
+ /**
17443
+ * The kind signs in through a server-held interactive session instead of
17444
+ * (or before) typed credentials. `basePath` is a hub-relative route set
17445
+ * served by the owning addon (`/addon/<id>/...`) speaking the sign-in
17446
+ * contract: `POST {basePath}/start` (body: the form's settings) answers
17447
+ * `{ sessionId, loginUrl }`; `GET {basePath}/status?sessionId=` answers
17448
+ * `{ phase: 'starting' | 'awaiting-login' | 'captured' | 'error' |
17449
+ * 'cancelled', loginUrl, error }`; `POST {basePath}/commit`
17450
+ * (`{ sessionId, name, brokerId? }`) stores the credentials on a new or
17451
+ * existing broker and answers `{ brokerId }`; `POST {basePath}/cancel`
17452
+ * (`{ sessionId }`) drops the session. The dialog that edits a broker
17453
+ * offers it as the default path; the fields the session fills are
17454
+ * marked `filledBySignIn` in the kind's settings schema.
17455
+ */
17456
+ signIn: object({ basePath: string().min(1) }).optional()
17123
17457
  }))
17124
17458
  });
17125
17459
  var ListInputSchema = object({
@@ -18220,7 +18554,12 @@ var CompositionProblemSchema = object({
18220
18554
  "item-field-reserved",
18221
18555
  "target-missing",
18222
18556
  "target-unreadable",
18223
- "not-replaceable"
18557
+ "not-replaceable",
18558
+ "native-capability-replace",
18559
+ "mixed-quantity",
18560
+ "helper-mismatch",
18561
+ "member-constraint",
18562
+ "retention"
18224
18563
  ]),
18225
18564
  path: string(),
18226
18565
  message: string()
@@ -18241,7 +18580,8 @@ var CompositionUnavailableModeSchema = _enum([
18241
18580
  "null",
18242
18581
  "offline",
18243
18582
  "unknown",
18244
- "release"
18583
+ "release",
18584
+ "omit"
18245
18585
  ]);
18246
18586
  /**
18247
18587
  * `derived` reads a source · `clock` reads only `now`, recomputed when a sibling
@@ -18278,9 +18618,11 @@ var CompositionFieldPlanSchema = object({
18278
18618
  reads: array(CompositionFieldReadSchema)
18279
18619
  });
18280
18620
  /**
18281
- * What a feature does to its target (D663): `new` builds a capability on a new
18282
- * device; on an existing device it `add`s a capability the device lacks, or
18283
- * `replace`s named fields of one it has natively.
18621
+ * What a feature does to its target (D663, D944): `new` builds a capability on a
18622
+ * new device; on an existing device it `add`s a capability the device lacks.
18623
+ * Replacing a capability the device already serves is refused
18624
+ * (`native-capability-replace`), not planned. `replace` remains on the claim
18625
+ * wire for a claim the hub already holds.
18284
18626
  */
18285
18627
  var CompositionFeatureModeSchema = _enum([
18286
18628
  "new",
@@ -18451,8 +18793,392 @@ Object.freeze({
18451
18793
  latchedAt: {
18452
18794
  kind: "fixed",
18453
18795
  result: ["number", "null"]
18796
+ },
18797
+ schmitt: {
18798
+ kind: "fixed",
18799
+ result: ["boolean", "null"]
18454
18800
  }
18455
18801
  });
18802
+ /**
18803
+ * One catalog row per base reading a group helper can build (D944 §3).
18804
+ * Data, not a form default written into the block.
18805
+ */
18806
+ var NOW$2 = {
18807
+ fieldPath: "lastFetchedAt",
18808
+ expr: "now"
18809
+ };
18810
+ var CHANGED = {
18811
+ fieldPath: "lastChangedAt",
18812
+ expr: "now"
18813
+ };
18814
+ function numeric(input) {
18815
+ return {
18816
+ ...input,
18817
+ family: "numeric",
18818
+ deviceType: DeviceType.Sensor,
18819
+ memberDeviceType: DeviceType.Sensor,
18820
+ memberDeviceTypes: [DeviceType.Sensor],
18821
+ activeWhen: void 0,
18822
+ commandCaps: [],
18823
+ baseUnit: baseUnitOf(input.quantity),
18824
+ aggregates: NUMERIC_AGGREGATES,
18825
+ accept: [{
18826
+ cap: input.outputCap,
18827
+ fieldPath: input.outputField
18828
+ }]
18829
+ };
18830
+ }
18831
+ function binary(input) {
18832
+ return {
18833
+ ...input,
18834
+ family: "binary",
18835
+ deviceType: DeviceType.Sensor,
18836
+ memberDeviceType: DeviceType.Sensor,
18837
+ memberDeviceTypes: [DeviceType.Sensor],
18838
+ activeWhen: void 0,
18839
+ commandCaps: [],
18840
+ quantity: "none",
18841
+ baseUnit: void 0,
18842
+ aggregates: BINARY_AGGREGATES,
18843
+ empty: "offline"
18844
+ };
18845
+ }
18846
+ var GROUP_TEMPLATES = [
18847
+ numeric({
18848
+ id: "temperature",
18849
+ summary: "Mean, median, min, max or sum of temperatures. Offline and unknown members are left out, never read as 0 °C.",
18850
+ role: DeviceRole.TemperatureSensor,
18851
+ outputCap: "temperature-sensor",
18852
+ outputField: "celsius",
18853
+ quantity: "temperature",
18854
+ defaultAggregate: "mean",
18855
+ empty: "null",
18856
+ companions: [NOW$2]
18857
+ }),
18858
+ numeric({
18859
+ id: "humidity",
18860
+ summary: "Humidity in percent. Offline and unknown members are left out, never read as 0 %.",
18861
+ role: DeviceRole.HumiditySensor,
18862
+ outputCap: "humidity-sensor",
18863
+ outputField: "percent",
18864
+ quantity: "humidity",
18865
+ defaultAggregate: "mean",
18866
+ empty: "null",
18867
+ companions: [NOW$2]
18868
+ }),
18869
+ numeric({
18870
+ id: "pressure",
18871
+ summary: "Pressure in hectopascals. Offline and unknown members are left out, never read as 0 hPa.",
18872
+ role: DeviceRole.PressureSensor,
18873
+ outputCap: "pressure-sensor",
18874
+ outputField: "hpa",
18875
+ quantity: "pressure",
18876
+ defaultAggregate: "mean",
18877
+ empty: "null",
18878
+ companions: [NOW$2]
18879
+ }),
18880
+ numeric({
18881
+ id: "illuminance",
18882
+ summary: "Illuminance in lux. Offline and unknown members are left out, never read as 0 lx.",
18883
+ role: DeviceRole.AmbientLightSensor,
18884
+ outputCap: "ambient-light-sensor",
18885
+ outputField: "lux",
18886
+ quantity: "illuminance",
18887
+ defaultAggregate: "mean",
18888
+ empty: "null",
18889
+ companions: [NOW$2]
18890
+ }),
18891
+ numeric({
18892
+ id: "power",
18893
+ summary: "Power in watts, summed by default. Nobody reporting omits the key rather than writing 0 W.",
18894
+ role: DeviceRole.PowerSensor,
18895
+ outputCap: "power-meter",
18896
+ outputField: "watts",
18897
+ quantity: "power",
18898
+ defaultAggregate: "sum",
18899
+ empty: "omit",
18900
+ companions: [NOW$2]
18901
+ }),
18902
+ numeric({
18903
+ id: "energy",
18904
+ summary: "Energy in kilowatt-hours, summed by default. Nobody reporting omits the key rather than writing 0 kWh.",
18905
+ role: DeviceRole.EnergySensor,
18906
+ outputCap: "power-meter",
18907
+ outputField: "kwhTotal",
18908
+ quantity: "energy",
18909
+ defaultAggregate: "sum",
18910
+ empty: "omit",
18911
+ companions: [NOW$2]
18912
+ }),
18913
+ numeric({
18914
+ id: "battery",
18915
+ summary: "Battery charge in percent. Offline and unknown members are left out, never read as 0 %.",
18916
+ role: DeviceRole.BatterySensor,
18917
+ outputCap: "battery",
18918
+ outputField: "percentage",
18919
+ quantity: "percentage",
18920
+ defaultAggregate: "mean",
18921
+ empty: "null",
18922
+ companions: [
18923
+ {
18924
+ fieldPath: "charging",
18925
+ expr: "\"unknown\""
18926
+ },
18927
+ {
18928
+ fieldPath: "sleeping",
18929
+ expr: "false"
18930
+ },
18931
+ {
18932
+ fieldPath: "lastUpdated",
18933
+ expr: "now"
18934
+ }
18935
+ ]
18936
+ }),
18937
+ numeric({
18938
+ id: "numeric",
18939
+ summary: "A numeric reading in the members’ shared quantity. Mixed quantities are refused. Nobody reporting publishes null, not 0.",
18940
+ role: DeviceRole.NumericSensor,
18941
+ outputCap: "numeric-sensor",
18942
+ outputField: "value",
18943
+ quantity: "device",
18944
+ defaultAggregate: "mean",
18945
+ empty: "null",
18946
+ companions: [NOW$2]
18947
+ }),
18948
+ binary({
18949
+ id: "motion",
18950
+ summary: "Any or all motion. Offline and unknown members are left out, never read as off. Nobody reporting takes the device offline.",
18951
+ role: DeviceRole.MotionSensor,
18952
+ outputCap: "motion",
18953
+ outputField: "detected",
18954
+ defaultAggregate: "any",
18955
+ accept: [{
18956
+ cap: "motion",
18957
+ fieldPath: "detected"
18958
+ }],
18959
+ companions: [{
18960
+ fieldPath: "lastDetectedAt",
18961
+ expr: "null"
18962
+ }, {
18963
+ fieldPath: "autoClearAfterMs",
18964
+ expr: "null"
18965
+ }]
18966
+ }),
18967
+ binary({
18968
+ id: "contact",
18969
+ summary: "Any or all open contacts. Offline and unknown members are left out, never read as closed.",
18970
+ role: DeviceRole.ContactSensor,
18971
+ outputCap: "contact",
18972
+ outputField: "entryOpen",
18973
+ defaultAggregate: "any",
18974
+ accept: [{
18975
+ cap: "contact",
18976
+ fieldPath: "entryOpen"
18977
+ }],
18978
+ companions: [CHANGED]
18979
+ }),
18980
+ binary({
18981
+ id: "leak",
18982
+ summary: "Any or all leak detections. Offline and unknown members are left out, never read as dry.",
18983
+ role: DeviceRole.LeakSensor,
18984
+ outputCap: "flood",
18985
+ outputField: "flooded",
18986
+ defaultAggregate: "any",
18987
+ accept: [{
18988
+ cap: "flood",
18989
+ fieldPath: "flooded"
18990
+ }],
18991
+ companions: [CHANGED]
18992
+ }),
18993
+ binary({
18994
+ id: "smoke",
18995
+ summary: "Any or all smoke detections. Offline and unknown members are left out, never read as clear.",
18996
+ role: DeviceRole.SmokeSensor,
18997
+ outputCap: "smoke",
18998
+ outputField: "detected",
18999
+ defaultAggregate: "any",
19000
+ accept: [{
19001
+ cap: "smoke",
19002
+ fieldPath: "detected"
19003
+ }],
19004
+ companions: [CHANGED]
19005
+ }),
19006
+ binary({
19007
+ id: "occupancy",
19008
+ summary: "Any or all of motion or binary sensors, published as a binary. Presence zones are not aggregated. Nobody reporting is offline, not off.",
19009
+ role: DeviceRole.BinarySensor,
19010
+ outputCap: "binary",
19011
+ outputField: "on",
19012
+ defaultAggregate: "any",
19013
+ accept: [{
19014
+ cap: "motion",
19015
+ fieldPath: "detected"
19016
+ }, {
19017
+ cap: "binary",
19018
+ fieldPath: "on"
19019
+ }],
19020
+ companions: [CHANGED]
19021
+ }),
19022
+ binary({
19023
+ id: "binary",
19024
+ summary: "Any or all generic binary sensors. Offline and unknown members are left out, never read as off.",
19025
+ role: DeviceRole.BinarySensor,
19026
+ outputCap: "binary",
19027
+ outputField: "on",
19028
+ defaultAggregate: "any",
19029
+ accept: [{
19030
+ cap: "binary",
19031
+ fieldPath: "on"
19032
+ }],
19033
+ companions: [CHANGED]
19034
+ }),
19035
+ actuator({
19036
+ id: "switch",
19037
+ 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.",
19038
+ deviceType: DeviceType.Switch,
19039
+ outputCap: "switch",
19040
+ outputField: "on",
19041
+ member: {
19042
+ cap: "switch",
19043
+ fieldPath: "on"
19044
+ },
19045
+ commandCaps: ["switch"]
19046
+ }),
19047
+ actuator({
19048
+ id: "light",
19049
+ 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.",
19050
+ deviceType: DeviceType.Light,
19051
+ outputCap: "switch",
19052
+ outputField: "on",
19053
+ member: {
19054
+ cap: "switch",
19055
+ fieldPath: "on"
19056
+ },
19057
+ commandCaps: [
19058
+ "switch",
19059
+ "brightness",
19060
+ "color"
19061
+ ]
19062
+ }),
19063
+ actuator({
19064
+ id: "fan",
19065
+ summary: "On when at least one fan is on, or when all of them are. Speed, preset, direction and oscillation are offered only when every fan has them. A command is not sent to a fan that lacks it.",
19066
+ deviceType: DeviceType.Fan,
19067
+ outputCap: "switch",
19068
+ outputField: "on",
19069
+ member: {
19070
+ cap: "switch",
19071
+ fieldPath: "on"
19072
+ },
19073
+ commandCaps: ["switch", "fan-control"]
19074
+ }),
19075
+ actuator({
19076
+ id: "cover",
19077
+ summary: "Open when at least one cover is open or part-open, or only when all of them are. Position and tilt are offered only when every cover has them. A cover that reports nothing is left out, never read as closed.",
19078
+ deviceType: DeviceType.Cover,
19079
+ outputCap: "group-active",
19080
+ outputField: "active",
19081
+ member: {
19082
+ cap: "cover",
19083
+ fieldPath: "state"
19084
+ },
19085
+ activeWhen: [
19086
+ "open",
19087
+ "opening",
19088
+ "stopped"
19089
+ ],
19090
+ commandCaps: ["cover"]
19091
+ }),
19092
+ actuator({
19093
+ id: "valve",
19094
+ summary: "Open when at least one valve is open or part-open, or only when all of them are. Position is offered only when every valve has it. A valve that reports nothing is left out, never read as closed.",
19095
+ deviceType: DeviceType.Valve,
19096
+ outputCap: "group-active",
19097
+ outputField: "active",
19098
+ member: {
19099
+ cap: "valve",
19100
+ fieldPath: "state"
19101
+ },
19102
+ activeWhen: [
19103
+ "open",
19104
+ "opening",
19105
+ "stopped"
19106
+ ],
19107
+ commandCaps: ["valve"]
19108
+ }),
19109
+ actuator({
19110
+ id: "lock",
19111
+ summary: "Locked when at least one lock is locked, or only when all of them are. A jammed or moving lock is not locked. Locking is one tap; unlocking the group needs a confirmation every time, and nothing is sent without it.",
19112
+ deviceType: DeviceType.Lock,
19113
+ outputCap: "group-active",
19114
+ outputField: "active",
19115
+ member: {
19116
+ cap: "lock-control",
19117
+ fieldPath: "state"
19118
+ },
19119
+ activeWhen: ["locked"],
19120
+ commandCaps: ["lock-control"]
19121
+ }),
19122
+ actuator({
19123
+ id: "media-player",
19124
+ summary: "Playing when at least one player is playing, or only when all of them are. Volume is offered only when every player has it. A player that reports nothing is left out, never read as stopped.",
19125
+ deviceType: DeviceType.MediaPlayer,
19126
+ outputCap: "group-active",
19127
+ outputField: "active",
19128
+ member: {
19129
+ cap: "media-player",
19130
+ fieldPath: "state"
19131
+ },
19132
+ activeWhen: ["playing", "buffering"],
19133
+ commandCaps: ["media-player"]
19134
+ }),
19135
+ actuator({
19136
+ id: "climate",
19137
+ summary: "Running when at least one thermostat or air conditioner is not off, or only when all of them are. Target temperature and fan are offered only when every device has them. A device that reports nothing is left out, never read as off.",
19138
+ deviceType: DeviceType.Thermostat,
19139
+ memberDeviceTypes: [DeviceType.Thermostat, DeviceType.Climate],
19140
+ outputCap: "group-active",
19141
+ outputField: "active",
19142
+ member: {
19143
+ cap: "climate-control",
19144
+ fieldPath: "mode"
19145
+ },
19146
+ activeWhen: [
19147
+ "heat",
19148
+ "cool",
19149
+ "auto",
19150
+ "heat_cool",
19151
+ "fan_only",
19152
+ "dry"
19153
+ ],
19154
+ commandCaps: ["climate-control"]
19155
+ })
19156
+ ];
19157
+ function actuator(input) {
19158
+ return {
19159
+ id: input.id,
19160
+ summary: input.summary,
19161
+ deviceType: input.deviceType,
19162
+ outputCap: input.outputCap,
19163
+ outputField: input.outputField,
19164
+ commandCaps: input.commandCaps,
19165
+ family: "actuator",
19166
+ role: void 0,
19167
+ memberDeviceType: input.deviceType,
19168
+ memberDeviceTypes: input.memberDeviceTypes ?? [input.deviceType],
19169
+ activeWhen: input.activeWhen,
19170
+ quantity: "none",
19171
+ baseUnit: void 0,
19172
+ aggregates: BINARY_AGGREGATES,
19173
+ defaultAggregate: "any",
19174
+ empty: "offline",
19175
+ accept: [input.member],
19176
+ companions: [CHANGED]
19177
+ };
19178
+ }
19179
+ new Map(GROUP_TEMPLATES.map((template) => [template.id, template]));
19180
+ DeviceFeature.LightColorRgb, DeviceFeature.LightColorHsv, DeviceFeature.LightColorMired;
19181
+ DeviceType.Camera;
18456
19182
  `${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
18457
19183
  /**
18458
19184
  * What a composition may BUILD on a device type (G2, D676): the caps a new
@@ -20279,12 +21005,12 @@ function buildDeviceAdminUrl(parts) {
20279
21005
  * providers detect renames by matching `uniqueId` and patch `id`
20280
21006
  * in-place so dispatch keeps working.
20281
21007
  *
20282
- * **Rendering metadata is NOT stored here.** Display fields (`unit`,
20283
- * `precision`) live in the cap STATUS SLICE so they flow live with every
20284
- * state push and are the single source of truth. The `device_class` tag is
20285
- * an HA-specific input that is consumed at the discovery boundary
20286
- * (`ha-domain-mapping`) to derive the CamStack `DeviceRole`; it is never
20287
- * stored after that point.
21008
+ * **Display unit and precision are NOT stored here.** They are a read-time
21009
+ * preference (D944). A polymorphic reading stores its `quantity` here once,
21010
+ * at adopt, and a date/time value stores `dateTimeShape` the same way —
21011
+ * neither is repeated on each sample. The `device_class` tag is an
21012
+ * HA-specific input consumed at the discovery boundary (`ha-domain-mapping`)
21013
+ * to derive the CamStack `DeviceRole`; it is never stored after that point.
20288
21014
  *
20289
21015
  * The `raw` escape hatch carries provider-specific attributes that don't
20290
21016
  * fit the structured slots (HA `attributes` whitelist, Reolink `deviceCache`
@@ -20298,6 +21024,14 @@ var SourceInfoSchema = object({
20298
21024
  /** Immutable upstream identifier when available (HA `unique_id`, … ).
20299
21025
  * Used to detect rename when `id` changes. */
20300
21026
  uniqueId: string().optional(),
21027
+ /** Quantity of a polymorphic reading, written once at adopt (D944). */
21028
+ quantity: ReadingQuantitySchema.optional(),
21029
+ /** Date / time / datetime shape of a string reading, written once at adopt. */
21030
+ dateTimeShape: _enum([
21031
+ "date",
21032
+ "time",
21033
+ "datetime"
21034
+ ]).optional(),
20301
21035
  /** Provider-specific extras that don't fit the structured slots.
20302
21036
  * Whitelist what goes here per provider — do NOT dump entire HA
20303
21037
  * attribute blobs (would explode the meta JSON column). */
@@ -41402,7 +42136,8 @@ method(object({
41402
42136
  "enum"
41403
42137
  ]),
41404
42138
  enumValues: array(string()).optional(),
41405
- item: boolean().optional()
42139
+ item: boolean().optional(),
42140
+ quantity: ReadingQuantitySchema.optional()
41406
42141
  })).readonly(),
41407
42142
  itemArray: object({
41408
42143
  path: string(),
@@ -43782,7 +44517,7 @@ var NetworkAccessStatusSchema = object({
43782
44517
  });
43783
44518
  /**
43784
44519
  * Optional, richer endpoint shape returned by providers that expose
43785
- * MORE than one ingress concurrently (Tailscale Ingress with mixed
44520
+ * MORE than one ingress concurrently (Tailscale Funnel with mixed
43786
44521
  * serve+funnel rules, future ngrok multi-tunnel, …). Each entry carries
43787
44522
  * the originating provider config (mode + sourcePort) so the
43788
44523
  * orchestrator UI can label rows distinctly. Providers that expose only
@@ -45265,8 +46000,8 @@ var MaskPolygonShapeSchema = object({
45265
46000
  /** Boolean cell grid — row-major, length === gridWidth*gridHeight. */
45266
46001
  var MaskGridShapeSchema = object({
45267
46002
  kind: literal("grid"),
45268
- gridWidth: number(),
45269
- gridHeight: number(),
46003
+ gridWidth: number().meta(readingMeta("none")),
46004
+ gridHeight: number().meta(readingMeta("none")),
45270
46005
  cells: array(boolean())
45271
46006
  });
45272
46007
  discriminatedUnion("kind", [
@@ -45378,6 +46113,8 @@ var NcSystemEventKindSchema = _enum([
45378
46113
  "detection-blind",
45379
46114
  "motion-noisy",
45380
46115
  "motion-calm",
46116
+ "package-llm-silent",
46117
+ "package-llm-answered",
45381
46118
  "recording-stalled",
45382
46119
  "recording-healthy",
45383
46120
  "recording-degraded",
@@ -46467,7 +47204,20 @@ var NcRuleInputSchema = object({
46467
47204
  * save by the hub's grouping guard). `.optional()`, never `.default()`: the addon cap
46468
47205
  * path does not run Zod defaults.
46469
47206
  */
46470
- groupingSec: number().int().min(5).max(60).optional()
47207
+ groupingSec: number().int().min(5).max(60).optional(),
47208
+ /**
47209
+ * ASK ME TO CONFIRM DETECTIONS (#243): a DETECTION notification of this rule
47210
+ * carries "Correct" / "Wrong" buttons (and, where the channel has room, a
47211
+ * "Wrong, it is a <class>" choice). A tap marks the track for retraining, the
47212
+ * same mark the Library writes, and records whose notification it was and
47213
+ * when. A channel with no buttons gets the same two choices as links.
47214
+ *
47215
+ * `.optional()`, never `.default()` (a Zod default does not run on the addon
47216
+ * cap path): absent and `false` both mean off, which is what every rule
47217
+ * authored before this field meant. An editor turns it off by writing
47218
+ * `false`, so it needs no `clear` key.
47219
+ */
47220
+ askVerdict: boolean().optional()
46471
47221
  });
46472
47222
  /**
46473
47223
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -56991,6 +57741,28 @@ var PackageVersionInfoSchema = object({
56991
57741
  deprecated: string().optional(),
56992
57742
  distTags: array(string()).readonly()
56993
57743
  });
57744
+ /**
57745
+ * One published document. `ok` is markdown from the registry. `missing` means
57746
+ * the registry answered and the file was not there. `error` is a registry or
57747
+ * tarball failure — never an empty string standing in for either.
57748
+ */
57749
+ var PackageDocBodySchema = discriminatedUnion("status", [
57750
+ object({
57751
+ status: literal("ok"),
57752
+ markdown: string()
57753
+ }),
57754
+ object({ status: literal("missing") }),
57755
+ object({
57756
+ status: literal("error"),
57757
+ message: string()
57758
+ })
57759
+ ]);
57760
+ var PackageDocsSchema = object({
57761
+ name: string(),
57762
+ version: string(),
57763
+ readme: PackageDocBodySchema,
57764
+ changelog: PackageDocBodySchema
57765
+ });
56994
57766
  var SearchResultSchema = object({
56995
57767
  name: string(),
56996
57768
  version: string(),
@@ -57209,7 +57981,10 @@ method(object({ nodeId: string().optional() }).optional(), array(AddonListItemSc
57209
57981
  }), object({ success: literal(true) }), {
57210
57982
  kind: "mutation",
57211
57983
  auth: "admin"
57212
- }), method(object({ name: string() }), array(PackageVersionInfoSchema).readonly()), method(object({ addonId: string() }), RestartAddonResultSchema, {
57984
+ }), method(object({ name: string() }), array(PackageVersionInfoSchema).readonly()), method(object({
57985
+ name: string().min(1),
57986
+ version: string().min(1).optional()
57987
+ }), PackageDocsSchema, { auth: "admin" }), method(object({ addonId: string() }), RestartAddonResultSchema, {
57213
57988
  kind: "mutation",
57214
57989
  auth: "admin"
57215
57990
  }), method(object({ packageName: string() }), object({ success: literal(true) }), {
@@ -57268,27 +58043,17 @@ method(object({ nodeId: string().optional() }).optional(), array(AddonListItemSc
57268
58043
  */
57269
58044
  var AirQualitySensorStatusSchema = object({
57270
58045
  /** Carbon dioxide concentration in ppm. */
57271
- co2Ppm: number().min(0).optional(),
58046
+ co2Ppm: number().min(0).optional().meta(readingMeta("concentration-volume")),
57272
58047
  /** Total volatile organic compounds in ppb. */
57273
- vocPpb: number().min(0).optional(),
58048
+ vocPpb: number().min(0).optional().meta(readingMeta("concentration-ppb")),
57274
58049
  /** Particulate matter ≤ 2.5 μm in µg/m³. */
57275
- pm25: number().min(0).optional(),
58050
+ pm25: number().min(0).optional().meta(readingMeta("concentration-mass")),
57276
58051
  /** Particulate matter ≤ 10 μm in µg/m³. */
57277
- pm10: number().min(0).optional(),
58052
+ pm10: number().min(0).optional().meta(readingMeta("concentration-mass")),
57278
58053
  /** Composite AQI value (typically 0..500). */
57279
- aqi: number().optional(),
58054
+ aqi: number().optional().meta(readingMeta("index")),
57280
58055
  /** Ms epoch when the slice was last updated. */
57281
- lastFetchedAt: number(),
57282
- /** Live display unit of the single metric this slice carries (e.g. HA
57283
- * `attributes.unit_of_measurement` → 'ppm' / 'ppb' / 'µg/m³'). Each
57284
- * upstream `sensor.*` entity surfaces ONE device_class, so one unit
57285
- * per slice is unambiguous. */
57286
- unit: string().optional(),
57287
- /** Suggested decimal places for numeric display.
57288
- * Populated live from the upstream source when provided (e.g. HA
57289
- * `attributes.suggested_display_precision`). Falls back to
57290
- * auto-formatting when absent. */
57291
- precision: number().int().min(0).max(10).optional()
58056
+ lastFetchedAt: number()
57292
58057
  });
57293
58058
  var airQualitySensorCapability = {
57294
58059
  name: "air-quality-sensor",
@@ -57325,12 +58090,12 @@ var airQualitySensorCapability = {
57325
58090
  },
57326
58091
  pm25: {
57327
58092
  kind: "gauge",
57328
- unit: "ug/m3",
58093
+ unit: "µg/m³",
57329
58094
  deadband: 1
57330
58095
  },
57331
58096
  pm10: {
57332
58097
  kind: "gauge",
57333
- unit: "ug/m3",
58098
+ unit: "µg/m³",
57334
58099
  deadband: 1
57335
58100
  },
57336
58101
  aqi: {
@@ -57348,22 +58113,13 @@ var airQualitySensorCapability = {
57348
58113
  * entries with `device_class: illuminance`.
57349
58114
  */
57350
58115
  var AmbientLightSensorStatusSchema = object({
57351
- /** Current illuminance in lux (lx). */
57352
- lux: number().min(0).meta({
57353
- unit: "lx",
58116
+ /** Current illuminance in lux (lx). `null` when the sample was refused (D393). */
58117
+ lux: number().min(0).nullable().meta(readingMeta("illuminance", {
58118
+ precision: 0,
57354
58119
  label: "Illuminance"
57355
- }),
58120
+ })),
57356
58121
  /** Ms epoch when the slice was last updated. */
57357
- lastFetchedAt: number(),
57358
- /** Live display unit from the upstream source (e.g. HA
57359
- * `attributes.unit_of_measurement`). The UI prefers this over the
57360
- * role's canonical unit. Absent → fall back to the canonical unit. */
57361
- unit: string().optional(),
57362
- /** Suggested decimal places for numeric display.
57363
- * Populated live from the upstream source when provided (e.g. HA
57364
- * `attributes.suggested_display_precision`). Falls back to
57365
- * auto-formatting when absent. */
57366
- precision: number().int().min(0).max(10).optional()
58122
+ lastFetchedAt: number()
57367
58123
  });
57368
58124
  var ambientLightSensorCapability = {
57369
58125
  name: "ambient-light-sensor",
@@ -57395,12 +58151,7 @@ var ambientLightSensorCapability = {
57395
58151
  } } },
57396
58152
  /** Clock fields: written, but excluded from the compare that decides
57397
58153
  * whether persisting is worth a SQLite commit. */
57398
- volatileStateFields: ["lastFetchedAt"],
57399
- customize: {
57400
- version: 1,
57401
- advanced: "derive",
57402
- targets: []
57403
- }
58154
+ volatileStateFields: ["lastFetchedAt"]
57404
58155
  };
57405
58156
  /**
57406
58157
  * Per-class audio metrics aggregated over a sliding window.
@@ -57627,10 +58378,7 @@ var BatteryStatusSchema = object({
57627
58378
  * Consumers must SKIP a null rather than coerce it — `battery-band` already
57628
58379
  * declines to band a non-finite reading, which is the correct shape.
57629
58380
  */
57630
- percentage: number().min(0).max(100).nullable().meta({
57631
- unit: "%",
57632
- label: "Charge"
57633
- }),
58381
+ percentage: number().min(0).max(100).nullable().meta(readingMeta("percentage", { label: "Charge" })),
57634
58382
  /**
57635
58383
  * Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
57636
58384
  * Reolink-specific for the Solar Panel 2 accessory (will become
@@ -57657,7 +58405,14 @@ var BatteryStatusSchema = object({
57657
58405
  */
57658
58406
  sleeping: boolean().meta({ label: "Sleeping" }),
57659
58407
  /** Ms epoch of the last observation. Lets consumers reason about freshness. */
57660
- lastUpdated: number(),
58408
+ lastUpdated: number().meta(readingMeta("none")),
58409
+ /**
58410
+ * Battery voltage in volts, for a cell the firmware reports as voltage
58411
+ * rather than a percentage (Ecowitt capacitor packs). Absent on cameras
58412
+ * that only report charge. A second reading on this cap, not a second
58413
+ * `numeric-sensor` on the same device.
58414
+ */
58415
+ volts: number().nullable().optional().meta(readingMeta("voltage", { label: "Voltage" })),
57661
58416
  /**
57662
58417
  * Ms epoch of the last time the device PROVED it was reachable — a
57663
58418
  * completed firmware round-trip, an observed wake, or an inbound push
@@ -57704,12 +58459,12 @@ var BATTERY_DEVICE_TYPES = [
57704
58459
  DeviceType.Switch,
57705
58460
  DeviceType.PetFeeder,
57706
58461
  DeviceType.Container,
57707
- DeviceType.Thermostat
58462
+ DeviceType.Thermostat,
58463
+ DeviceType.EventEmitter
57708
58464
  ];
57709
58465
  /** Generic Customize target for the percentage reading (D936). */
57710
58466
  var batteryCustomize = {
57711
58467
  version: 1,
57712
- advanced: "derive",
57713
58468
  targets: [{
57714
58469
  id: "percentage",
57715
58470
  cardinality: "scalar",
@@ -57718,7 +58473,7 @@ var batteryCustomize = {
57718
58473
  stateField: "percentage"
57719
58474
  },
57720
58475
  deviceTypes: BATTERY_DEVICE_TYPES,
57721
- apply: "add-or-replace",
58476
+ apply: "add",
57722
58477
  path: "percentage",
57723
58478
  sources: [{
57724
58479
  kind: "field",
@@ -57839,10 +58594,16 @@ onStatusChanged: { data: object({
57839
58594
  /**
57840
58595
  * History (D850): recorded series. The generic capture replaces the `battery` series of `pipeline-analytics:stats-5m`.
57841
58596
  */
57842
- history: { fields: { percentage: {
57843
- kind: "gauge",
57844
- unit: "%"
57845
- } } },
58597
+ history: { fields: {
58598
+ percentage: {
58599
+ kind: "gauge",
58600
+ unit: "%"
58601
+ },
58602
+ volts: {
58603
+ kind: "gauge",
58604
+ unit: "V"
58605
+ }
58606
+ } },
57846
58607
  customize: batteryCustomize,
57847
58608
  /** Clock fields: written, but excluded from the compare that decides
57848
58609
  * whether persisting is worth a SQLite commit. */
@@ -57889,12 +58650,7 @@ var binaryCapability = {
57889
58650
  history: { fields: { on: { kind: "boolean" } } },
57890
58651
  /** Clock fields: written, but excluded from the compare that decides
57891
58652
  * whether persisting is worth a SQLite commit. */
57892
- volatileStateFields: ["lastChangedAt"],
57893
- customize: {
57894
- version: 1,
57895
- advanced: "derive",
57896
- targets: []
57897
- }
58653
+ volatileStateFields: ["lastChangedAt"]
57898
58654
  };
57899
58655
  /**
57900
58656
  * Dimmable-light brightness control. Co-exists with `switch` on the
@@ -57910,7 +58666,7 @@ var binaryCapability = {
57910
58666
  */
57911
58667
  var BrightnessStatusSchema = object({
57912
58668
  /** Current level as 0..100 inclusive. Firmware-reported. */
57913
- percentage: number().min(0).max(100),
58669
+ percentage: number().min(0).max(100).meta(readingMeta("percentage")),
57914
58670
  /** Ms epoch of the last operator-driven change. Useful for UI freshness. */
57915
58671
  lastChangedAt: number()
57916
58672
  });
@@ -58364,21 +59120,21 @@ var ClimateControlStatusSchema = object({
58364
59120
  /** Single setpoint in Celsius. Used by single-target modes
58365
59121
  * (heat / cool / dry). Null when the device is in a range mode
58366
59122
  * (`heat_cool`) or has no setpoint at all (`fan_only`/`off`). */
58367
- target: number().nullable(),
59123
+ target: number().nullable().meta(readingMeta("temperature")),
58368
59124
  /** Upper bound of the dual setpoint in Celsius. Populated only
58369
59125
  * in `heat_cool` mode. */
58370
- targetHigh: number().nullable(),
59126
+ targetHigh: number().nullable().meta(readingMeta("temperature")),
58371
59127
  /** Lower bound of the dual setpoint in Celsius. Populated only
58372
59128
  * in `heat_cool` mode. */
58373
- targetLow: number().nullable(),
59129
+ targetLow: number().nullable().meta(readingMeta("temperature")),
58374
59130
  /** Target relative humidity (0..100). Null when the device has no
58375
59131
  * humidity control. */
58376
- targetHumidity: number().min(0).max(100).nullable(),
59132
+ targetHumidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
58377
59133
  /** Current measured temperature in Celsius. Read-only — pushed by
58378
59134
  * the device's internal sensor. */
58379
- currentTemp: number().nullable(),
59135
+ currentTemp: number().nullable().meta(readingMeta("temperature")),
58380
59136
  /** Current measured relative humidity (0..100). Read-only. */
58381
- currentHumidity: number().min(0).max(100).nullable(),
59137
+ currentHumidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
58382
59138
  /** Vertical louver swing on/off. Null when the device has no vertical
58383
59139
  * swing surface (gate with `DeviceFeature.ClimateSwingVertical`). */
58384
59140
  swingVertical: boolean().nullable(),
@@ -58386,11 +59142,11 @@ var ClimateControlStatusSchema = object({
58386
59142
  * horizontal swing surface (gate with `DeviceFeature.ClimateSwingHorizontal`). */
58387
59143
  swingHorizontal: boolean().nullable(),
58388
59144
  /** Lowest setpoint the device accepts, Celsius. Absent / null = not reported. */
58389
- minTemp: number().nullable().optional(),
59145
+ minTemp: number().nullable().optional().meta(readingMeta("temperature")),
58390
59146
  /** Highest setpoint the device accepts, Celsius. Absent / null = not reported. */
58391
- maxTemp: number().nullable().optional(),
59147
+ maxTemp: number().nullable().optional().meta(readingMeta("temperature")),
58392
59148
  /** Setpoint granularity, Celsius (0.5, 1). Absent / null = not reported. */
58393
- tempStep: number().positive().nullable().optional(),
59149
+ tempStep: number().positive().nullable().optional().meta(readingMeta("temperature")),
58394
59150
  /** Ms epoch when the slice was last updated (push or command). */
58395
59151
  lastFetchedAt: number()
58396
59152
  });
@@ -58532,17 +59288,17 @@ var climateControlCapability = {
58532
59288
  * modes to expose in the picker without a slice fetch.
58533
59289
  */
58534
59290
  var RgbTripletSchema = object({
58535
- r: number().int().min(0).max(255),
58536
- g: number().int().min(0).max(255),
58537
- b: number().int().min(0).max(255)
59291
+ r: number().int().min(0).max(255).meta(readingMeta("none")),
59292
+ g: number().int().min(0).max(255).meta(readingMeta("none")),
59293
+ b: number().int().min(0).max(255).meta(readingMeta("none"))
58538
59294
  });
58539
59295
  var HsvTripletSchema = object({
58540
59296
  /** Hue in degrees, 0..360. */
58541
- h: number().min(0).max(360),
59297
+ h: number().min(0).max(360).meta(readingMeta("none")),
58542
59298
  /** Saturation as 0..100 inclusive. */
58543
- s: number().min(0).max(100),
59299
+ s: number().min(0).max(100).meta(readingMeta("none")),
58544
59300
  /** Value/brightness as 0..100 inclusive. */
58545
- v: number().min(0).max(100)
59301
+ v: number().min(0).max(100).meta(readingMeta("none"))
58546
59302
  });
58547
59303
  var ColorInputSchema = discriminatedUnion("mode", [
58548
59304
  object({
@@ -58571,7 +59327,7 @@ var ColorStatusSchema = object({
58571
59327
  /** Populated when `mode === 'hsv'`. */
58572
59328
  hsv: HsvTripletSchema.optional(),
58573
59329
  /** Populated when `mode === 'mired'`. */
58574
- mireds: number().int().optional(),
59330
+ mireds: number().int().optional().meta(readingMeta("colour-temperature")),
58575
59331
  /** Ms epoch of the last operator-driven change. */
58576
59332
  lastChangedAt: number()
58577
59333
  });
@@ -58766,18 +59522,12 @@ _enum([
58766
59522
  "empty",
58767
59523
  "full"
58768
59524
  ]);
58769
- /** Units a remaining-life counter is reported in. Closed: the panel renders
58770
- * each. */
58771
- var ConsumableRemainingUnitSchema = _enum([
58772
- "days",
58773
- "hours",
58774
- "cycles"
58775
- ]);
58776
- /** Remaining life as a COUNT, not a percentage (the PetKit desiccant reports
58777
- * days). `value` null = unknown (D393). */
59525
+ /** Whether `remaining.value` is a duration in seconds or a dimensionless count. */
59526
+ var ConsumableRemainingKindSchema = _enum(["duration", "count"]);
59527
+ /** Remaining life. `value` null = unknown (D393). Duration is seconds. */
58778
59528
  var ConsumableRemainingSchema = object({
58779
- value: number().min(0).nullable(),
58780
- unit: ConsumableRemainingUnitSchema
59529
+ value: number().min(0).nullable().meta(readingMeta("device")),
59530
+ kind: ConsumableRemainingKindSchema
58781
59531
  });
58782
59532
  /** A single consumable item. Either a continuous `level` (remaining
58783
59533
  * life %, or fill % for a `supply` / `waste` item) or a discrete `status`
@@ -58790,7 +59540,7 @@ var ConsumableItemSchema = object({
58790
59540
  /** Display name. */
58791
59541
  label: string().min(1),
58792
59542
  /** Remaining life % (`wear`) or fill % (`supply`, `waste`) when known (0..100). */
58793
- level: number().min(0).max(100).nullable(),
59543
+ level: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
58794
59544
  /** The provider's discrete verdict when known (binary mode). */
58795
59545
  status: ConsumableStatusSchema.nullable(),
58796
59546
  /** What the item is — decides whether low or full is bad. Absent = `wear`. */
@@ -58872,8 +59622,8 @@ var consumablesCustomize = {
58872
59622
  transforms: [{ kind: "identity" }]
58873
59623
  }],
58874
59624
  literals: [{
58875
- path: "remaining.unit",
58876
- values: [...ConsumableRemainingUnitSchema.options]
59625
+ path: "remaining.kind",
59626
+ values: [...ConsumableRemainingKindSchema.options]
58877
59627
  }]
58878
59628
  },
58879
59629
  {
@@ -59002,7 +59752,6 @@ reset: method(object({
59002
59752
  },
59003
59753
  "remaining.value": {
59004
59754
  kind: "gauge",
59005
- unitFrom: "remaining.unit",
59006
59755
  deadband: 1,
59007
59756
  displayName: "Remaining"
59008
59757
  }
@@ -59072,10 +59821,9 @@ var contactCapability = {
59072
59821
  * (empty array for the other kinds). It lives in the slice because
59073
59822
  * HA `select.*` entities may update their options at runtime.
59074
59823
  *
59075
- * The `unit`/`min`/`max`/`step` fields are meaningful for
59076
- * `kind === 'numeric'` and are absent (undefined) for all other
59077
- * kinds. They are populated live from HA attributes on each state
59078
- * push — consistent with `options` and the sensor-unit approach.
59824
+ * Numeric `min` / `max` / `step` live in the slice and share the device
59825
+ * quantity (`SourceInfo.quantity`, D944). Display precision is a read-time
59826
+ * preference. A datetime control's shape is `SourceInfo.dateTimeShape`.
59079
59827
  */
59080
59828
  var ControlStatusSchema = object({
59081
59829
  kind: _enum([
@@ -59087,39 +59835,17 @@ var ControlStatusSchema = object({
59087
59835
  /** Current value. Numeric kind → number; select/text/datetime → string.
59088
59836
  * Datetime values are ISO 8601 strings (full timestamp, date-only,
59089
59837
  * or time-only — HA accepts all three forms). */
59090
- value: union([number(), string()]),
59838
+ value: union([number().meta(readingMeta("device")), string()]),
59091
59839
  /** Acceptable values when `kind === 'select'`. Empty for other kinds. */
59092
59840
  options: array(string()),
59093
59841
  /** Ms epoch when the slice was last updated. */
59094
59842
  lastChangedAt: number(),
59095
- /** Display unit-of-measurement (e.g. '°C', '%', 'lx').
59096
- * Populated live from HA `attributes.unit_of_measurement` on each push.
59097
- * Meaningful for `kind === 'numeric'`; absent for other kinds. */
59098
- unit: string().optional(),
59099
- /** Minimum allowed value. Populated live from HA `attributes.min`.
59100
- * Meaningful for `kind === 'numeric'`; absent for other kinds. */
59101
- min: number().optional(),
59102
- /** Maximum allowed value. Populated live from HA `attributes.max`.
59103
- * Meaningful for `kind === 'numeric'`; absent for other kinds. */
59104
- max: number().optional(),
59105
- /** Step increment. Populated live from HA `attributes.step`.
59106
- * Meaningful for `kind === 'numeric'`; absent for other kinds. */
59107
- step: number().optional(),
59108
- /** Suggested decimal places for numeric display. Populated live from HA
59109
- * `attributes.suggested_display_precision`, or derived from `step` when the
59110
- * HA attribute is absent. Meaningful for `kind === 'numeric'`; absent for
59111
- * other kinds. Falls back to auto-formatting when absent. */
59112
- precision: number().int().min(0).max(10).optional(),
59113
- /** Date-picker granularity for `kind === 'datetime'`. 'date' → date-only,
59114
- * 'time' → time-only, 'datetime' → full timestamp. Absent for other kinds
59115
- * (UI defaults to 'datetime'). Derived live from the device's HA domain
59116
- * (date.* / time.* / datetime.*) or, for input_datetime, from the entity's
59117
- * `has_date`/`has_time` attributes on each push. */
59118
- format: _enum([
59119
- "date",
59120
- "time",
59121
- "datetime"
59122
- ]).optional()
59843
+ /** Minimum allowed value, in the device quantity's base unit. */
59844
+ min: number().optional().meta(readingMeta("device")),
59845
+ /** Maximum allowed value, in the device quantity's base unit. */
59846
+ max: number().optional().meta(readingMeta("device")),
59847
+ /** Step increment, in the device quantity's base unit. */
59848
+ step: number().optional().meta(readingMeta("device"))
59123
59849
  });
59124
59850
  var ControlSetValueInputSchema = discriminatedUnion("kind", [
59125
59851
  object({
@@ -59185,9 +59911,9 @@ var CoverStatusSchema = object({
59185
59911
  ]),
59186
59912
  /** 0 = fully closed, 100 = fully open. Null when the device has
59187
59913
  * no intermediate position surface. */
59188
- position: number().min(0).max(100).nullable(),
59914
+ position: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
59189
59915
  /** 0 = closed slats, 100 = open slats. Null when no tilt support. */
59190
- tiltPosition: number().min(0).max(100).nullable(),
59916
+ tiltPosition: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
59191
59917
  /** Ms epoch when the slice was last updated. */
59192
59918
  lastChangedAt: number()
59193
59919
  });
@@ -59290,9 +60016,9 @@ var NormalizedRangeSchema$1 = object({
59290
60016
  var DayNightStatusSchema = object({
59291
60017
  mode: DayNightModeSchema,
59292
60018
  /** IR-cut trigger sensitivity, NORMALIZED 0–100 (higher = switches to night sooner). */
59293
- sensitivity: number().optional(),
60019
+ sensitivity: number().optional().meta(readingMeta("none")),
59294
60020
  /** Delay before the IR-cut filter flips, in seconds. */
59295
- switchDelaySec: number().optional(),
60021
+ switchDelaySec: number().optional().meta(readingMeta("duration")),
59296
60022
  lastFetchedAt: number()
59297
60023
  });
59298
60024
  /**
@@ -59510,11 +60236,11 @@ var DishwasherStatusSchema = object({
59510
60236
  /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
59511
60237
  availablePrograms: array(string()),
59512
60238
  /** Seconds remaining on the active cycle, or null when not running / not known. */
59513
- remainingSeconds: number().int().nonnegative().nullable(),
60239
+ remainingSeconds: number().int().nonnegative().nullable().meta(readingMeta("duration")),
59514
60240
  /** Seconds the delayed start is set to (time until the cycle starts), or null. */
59515
- delayedStartSeconds: number().int().nonnegative().nullable(),
60241
+ delayedStartSeconds: number().int().nonnegative().nullable().meta(readingMeta("duration")),
59516
60242
  /** Cycle completion 0..100, or null when not applicable. */
59517
- progressPercent: number().min(0).max(100).nullable(),
60243
+ progressPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
59518
60244
  /** True when the door is reported open; null when the door state is not known. */
59519
60245
  doorOpen: boolean().nullable(),
59520
60246
  /** True when the door is latched (locked) during a cycle; null when not reported. */
@@ -59538,7 +60264,7 @@ var DishwasherStatusSchema = object({
59538
60264
  /** True while the machine-care (descaling / cleaning-program) reminder is raised; false when clear; null when not reported. */
59539
60265
  machineCareDue: boolean().nullable(),
59540
60266
  /** Program runs left before the machine-care reminder is due; null when the appliance does not say. */
59541
- machineCareRemainingRuns: number().int().nonnegative().nullable(),
60267
+ machineCareRemainingRuns: number().int().nonnegative().nullable().meta(readingMeta("count")),
59542
60268
  /** Option states: null when the appliance does not expose the option or has not said. */
59543
60269
  halfLoad: boolean().nullable(),
59544
60270
  hygienePlus: boolean().nullable(),
@@ -59553,7 +60279,7 @@ var DishwasherStatusSchema = object({
59553
60279
  /** Feature keys of the events currently raised (salt low, rinse aid low, program finished, …). */
59554
60280
  activeEvents: array(string()),
59555
60281
  /** Numeric error code when the appliance reports one; null otherwise. */
59556
- errorCode: number().nullable(),
60282
+ errorCode: number().nullable().meta(readingMeta("none")),
59557
60283
  /** Name of the raised alert-level event while the appliance is in error; null otherwise. */
59558
60284
  errorLabel: string().nullable(),
59559
60285
  /** Ms epoch of the last value received from the appliance; 0 = never. */
@@ -59784,7 +60510,7 @@ var DoorbellStatusSchema = object({
59784
60510
  /** Ms epoch of the last press. null = never observed since this provider started. */
59785
60511
  lastPressedAt: number().nullable(),
59786
60512
  /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
59787
- pressCountSinceStart: number()
60513
+ pressCountSinceStart: number().meta(readingMeta("count"))
59788
60514
  });
59789
60515
  var DoorbellPressEventSchema = object({
59790
60516
  deviceId: number(),
@@ -59849,17 +60575,7 @@ onPressed: {
59849
60575
  history: "none",
59850
60576
  customize: doorbellCustomize
59851
60577
  };
59852
- /**
59853
- * Enum-state sensor — a string value picked from a finite option set.
59854
- * Drives HA `sensor` entries with `state_class: enum` (HVAC action
59855
- * states, weather conditions, contact-source channels, mode strings).
59856
- * The option set is stable across observations; it is persisted in the
59857
- * device config blob (via the control slice at adoption) and is NOT
59858
- * stored in `sourceInfo`.
59859
- */
59860
- /** Locale-render shape for an ISO `value` carried by a `DateTimeSensor`-role
59861
- * enum sensor: `date` (date-only), `time` (time-only), `datetime` (both). */
59862
- var EnumSensorDateTimeFormatSchema = _enum([
60578
+ _enum([
59863
60579
  "date",
59864
60580
  "time",
59865
60581
  "datetime"
@@ -59867,12 +60583,11 @@ var EnumSensorDateTimeFormatSchema = _enum([
59867
60583
  var EnumSensorStatusSchema = object({
59868
60584
  value: string(),
59869
60585
  /**
59870
- * Set for `DateTimeSensor`-role sensors so the UI renders the ISO `value`
59871
- * as a locale date/time/datetime; absent for plain enum sensors. HA
59872
- * `device_class=timestamp` → `'datetime'`, `device_class=date` → `'date'`,
59873
- * a time-only sensor → `'time'`.
60586
+ * Set when `value` is a timestamp rather than an enum state, so history
60587
+ * does not learn ISO strings as states. The display shape (date / time /
60588
+ * datetime) lives on `SourceInfo.dateTimeShape`, written once at adopt.
59874
60589
  */
59875
- format: EnumSensorDateTimeFormatSchema.optional(),
60590
+ timestamp: boolean().optional(),
59876
60591
  /** Ms epoch when the slice was last updated. */
59877
60592
  lastFetchedAt: number()
59878
60593
  });
@@ -59899,11 +60614,11 @@ var enumSensorCapability = {
59899
60614
  * History (D850): the value as an `enum` series (an appliance's program or
59900
60615
  * operation state, an HVAC action). The option set is per device, so the
59901
60616
  * value list is LEARNED as values are first seen (bounded). A sensor with a
59902
- * `format` carries a timestamp, not a state, and is not recorded.
60617
+ * `timestamp` carries a clock, not a state, and is not recorded.
59903
60618
  */
59904
60619
  history: { fields: { value: {
59905
60620
  kind: "enum",
59906
- skipWhenSet: "format"
60621
+ skipWhenSet: "timestamp"
59907
60622
  } } },
59908
60623
  /** Clock fields: written, but excluded from the compare that decides
59909
60624
  * whether persisting is worth a SQLite commit. */
@@ -59923,13 +60638,13 @@ var EventFireSchema = object({
59923
60638
  deviceId: number(),
59924
60639
  eventType: string(),
59925
60640
  data: record(string(), unknown()).nullable(),
59926
- timestamp: number(),
59927
- seq: number()
60641
+ timestamp: number().meta(readingMeta("none")),
60642
+ seq: number().meta(readingMeta("count"))
59928
60643
  });
59929
60644
  var EventEmitterStatusSchema = object({
59930
60645
  eventTypes: array(string()),
59931
60646
  lastEvent: EventFireSchema.nullable(),
59932
- eventCountSinceStart: number()
60647
+ eventCountSinceStart: number().meta(readingMeta("count"))
59933
60648
  });
59934
60649
  var eventEmitterCapability = {
59935
60650
  name: "event-emitter",
@@ -60342,10 +61057,10 @@ var FanDirectionSchema = _enum(["forward", "reverse"]);
60342
61057
  var FanControlStatusSchema = object({
60343
61058
  /** Active speed as 0..100 inclusive. Null when the device has no
60344
61059
  * speed surface (single-speed fan). */
60345
- percentage: number().min(0).max(100).nullable(),
61060
+ percentage: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
60346
61061
  /** Speed granularity the device accepts (HA `percentage_step`, e.g. 25 for
60347
61062
  * a 4-speed fan). Absent when unknown — the UI then falls back to step 1. */
60348
- percentageStep: number().positive().optional(),
61063
+ percentageStep: number().positive().optional().meta(readingMeta("percentage")),
60349
61064
  /** Active preset mode (`auto` / `quiet` / `turbo` / vendor-specific)
60350
61065
  * — empty string when no preset is active or supported. */
60351
61066
  preset: string(),
@@ -60466,7 +61181,7 @@ var FeatureProbeStatusSchema = object({
60466
61181
  /** Camera/firmware model string. `null` when the firmware doesn't expose it. */
60467
61182
  model: string().nullable(),
60468
61183
  /** Channel count for NVR/Hub devices; `1` for standalone cameras; `null` pre-probe. */
60469
- channelCount: number().nullable(),
61184
+ channelCount: number().nullable().meta(readingMeta("count")),
60470
61185
  /**
60471
61186
  * Ms epoch of the last SUCCESSFUL probe. `0` before the first probe
60472
61187
  * completes — drivers' `getAccessoryChildren()` should treat zero as
@@ -60589,9 +61304,151 @@ var gasCapability = {
60589
61304
  * whether persisting is worth a SQLite commit. */
60590
61305
  volatileStateFields: ["lastChangedAt"]
60591
61306
  };
61307
+ var GroupCommandsSchema = object({
61308
+ /** One row per member that has been commanded. A later command replaces that member's row. */
61309
+ results: array(object({
61310
+ deviceId: number().int().nonnegative(),
61311
+ cap: string().min(1),
61312
+ method: string().min(1),
61313
+ ok: boolean(),
61314
+ error: string().optional(),
61315
+ /** Ms epoch of the attempt. */
61316
+ at: number()
61317
+ })) });
61318
+ var groupCommandsCapability = {
61319
+ name: "group-commands",
61320
+ scope: "device",
61321
+ deviceNative: true,
61322
+ mode: "singleton",
61323
+ deviceTypes: [
61324
+ DeviceType.Switch,
61325
+ DeviceType.Light,
61326
+ DeviceType.Fan,
61327
+ DeviceType.Cover,
61328
+ DeviceType.Valve,
61329
+ DeviceType.Lock,
61330
+ DeviceType.MediaPlayer,
61331
+ DeviceType.Thermostat,
61332
+ DeviceType.Climate
61333
+ ],
61334
+ methods: {},
61335
+ status: {
61336
+ schema: GroupCommandsSchema,
61337
+ kind: "push"
61338
+ },
61339
+ runtimeState: GroupCommandsSchema,
61340
+ /**
61341
+ * Runtime-state durability: **session** — the last attempt. A restored
61342
+ * failure would outlive the command that caused it.
61343
+ *
61344
+ * See `RuntimeStateDurability`. Enforced by
61345
+ * `scripts/check-runtime-state-durability.ts`.
61346
+ */
61347
+ durability: "session",
61348
+ history: "none"
61349
+ };
61350
+ /**
61351
+ * Whether a helper actuator group counts as active (D944): at least one
61352
+ * included member is, or every included member is. What "active" means is the
61353
+ * type's: a cover is open, a lock is locked, a media player is playing, a
61354
+ * climate device is not off. A group of lights, switches and fans reports
61355
+ * `switch.on` instead; this cap is for the types whose own state is not a
61356
+ * yes/no. Unknown members are left out (`group-status` counts them) and an
61357
+ * empty included set takes the device offline, never `active: false`.
61358
+ */
61359
+ var GroupActiveSchema = object({
61360
+ active: boolean().meta({ label: "Active" }),
61361
+ /** Ms epoch when the slice was last updated. */
61362
+ lastChangedAt: number()
61363
+ });
61364
+ var groupActiveCapability = {
61365
+ name: "group-active",
61366
+ scope: "device",
61367
+ deviceNative: true,
61368
+ mode: "singleton",
61369
+ deviceTypes: [
61370
+ DeviceType.Cover,
61371
+ DeviceType.Valve,
61372
+ DeviceType.Lock,
61373
+ DeviceType.MediaPlayer,
61374
+ DeviceType.Climate,
61375
+ DeviceType.Thermostat
61376
+ ],
61377
+ methods: {},
61378
+ status: {
61379
+ schema: GroupActiveSchema,
61380
+ kind: "push"
61381
+ },
61382
+ runtimeState: GroupActiveSchema,
61383
+ /**
61384
+ * Runtime-state durability: **session** — recomputed from the members on the
61385
+ * next source event; a restored value would outlive the members it named.
61386
+ *
61387
+ * See `RuntimeStateDurability`. Enforced by
61388
+ * `scripts/check-runtime-state-durability.ts`.
61389
+ */
61390
+ durability: "session",
61391
+ history: "none"
61392
+ };
61393
+ /**
61394
+ * How many members of a helper group answered (D944). Counts are integers,
61395
+ * not measurements: zero included is a real count, never a stand-in reading.
61396
+ * The reading itself stays on the output capability. History is none — the
61397
+ * series that later statistics read is the output cap's own history block.
61398
+ */
61399
+ var GroupStatusSchema = object({
61400
+ /** Members whose current value entered the aggregate. */
61401
+ included: number().int().nonnegative().meta(readingMeta("count", {
61402
+ precision: 0,
61403
+ label: "Reporting"
61404
+ })),
61405
+ /** Members left out: offline, unknown, or not a finite reading (D393). */
61406
+ excluded: number().int().nonnegative().meta(readingMeta("count", {
61407
+ precision: 0,
61408
+ label: "Excluded"
61409
+ })),
61410
+ /** `included` + `excluded`. */
61411
+ total: number().int().nonnegative().meta(readingMeta("count", {
61412
+ precision: 0,
61413
+ label: "Members"
61414
+ }))
61415
+ });
61416
+ var groupStatusCapability = {
61417
+ name: "group-status",
61418
+ scope: "device",
61419
+ deviceNative: true,
61420
+ mode: "singleton",
61421
+ deviceTypes: [
61422
+ DeviceType.Sensor,
61423
+ DeviceType.Switch,
61424
+ DeviceType.Light,
61425
+ DeviceType.Fan,
61426
+ DeviceType.Cover,
61427
+ DeviceType.Valve,
61428
+ DeviceType.Lock,
61429
+ DeviceType.MediaPlayer,
61430
+ DeviceType.Thermostat,
61431
+ DeviceType.Climate
61432
+ ],
61433
+ methods: {},
61434
+ status: {
61435
+ schema: GroupStatusSchema,
61436
+ kind: "push"
61437
+ },
61438
+ runtimeState: GroupStatusSchema,
61439
+ /**
61440
+ * Runtime-state durability: **session** — recomputed from members on the
61441
+ * next source event; a restored count would outlive the readings it named.
61442
+ *
61443
+ * See `RuntimeStateDurability`. Enforced by
61444
+ * `scripts/check-runtime-state-durability.ts`.
61445
+ */
61446
+ durability: "session",
61447
+ history: "none"
61448
+ };
60592
61449
  var HeatingValveStatusSchema = object({
60593
61450
  /** Radiator valve opening 0 (closed) .. 100 (open). Null = not yet known. */
60594
- position: number().min(0).max(100).nullable(),
61451
+ position: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
60595
61452
  /** Ms epoch when the slice was last updated (push or poll). */
60596
61453
  lastFetchedAt: number()
60597
61454
  });
@@ -60634,9 +61491,9 @@ var HumidifierStatusSchema = object({
60634
61491
  /** Whether the humidifier is currently on. */
60635
61492
  on: boolean(),
60636
61493
  /** Current measured relative humidity (0..100). Null when not reported. */
60637
- currentHumidity: number().min(0).max(100).nullable(),
61494
+ currentHumidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
60638
61495
  /** Target relative humidity (0..100). Null when no setpoint surface. */
60639
- targetHumidity: number().min(0).max(100).nullable(),
61496
+ targetHumidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
60640
61497
  /** Active mode (`auto` / `normal` / `baby` / vendor). Null when the
60641
61498
  * device has no mode surface. */
60642
61499
  mode: string().nullable(),
@@ -60646,9 +61503,9 @@ var HumidifierStatusSchema = object({
60646
61503
  * `idle` / `off`). Null when the device doesn't report it. */
60647
61504
  action: string().nullable(),
60648
61505
  /** HA `min_humidity` attribute. Null → UI uses 0. */
60649
- minHumidity: number().nullable(),
61506
+ minHumidity: number().nullable().meta(readingMeta("humidity")),
60650
61507
  /** HA `max_humidity` attribute. Null → UI uses 100. */
60651
- maxHumidity: number().nullable(),
61508
+ maxHumidity: number().nullable().meta(readingMeta("humidity")),
60652
61509
  /** Ms epoch when the slice was last updated. */
60653
61510
  lastChangedAt: number()
60654
61511
  });
@@ -60718,22 +61575,13 @@ var humidifierCapability = {
60718
61575
  * `sourceInfo`.
60719
61576
  */
60720
61577
  var HumiditySensorStatusSchema = object({
60721
- /** Current relative humidity, 0..100. */
60722
- percent: number().min(0).max(100).meta({
60723
- unit: "%",
61578
+ /** Current relative humidity, 0..100. `null` when the sample was refused (D393). */
61579
+ percent: number().min(0).max(100).nullable().meta(readingMeta("humidity", {
61580
+ precision: 0,
60724
61581
  label: "Humidity"
60725
- }),
61582
+ })),
60726
61583
  /** Ms epoch when the slice was last updated. */
60727
- lastFetchedAt: number(),
60728
- /** Live display unit from the upstream source (e.g. HA
60729
- * `attributes.unit_of_measurement`). The UI prefers this over the
60730
- * role's canonical unit. Absent → fall back to the canonical unit. */
60731
- unit: string().optional(),
60732
- /** Suggested decimal places for numeric display.
60733
- * Populated live from the upstream source when provided (e.g. HA
60734
- * `attributes.suggested_display_precision`). Falls back to
60735
- * auto-formatting when absent. */
60736
- precision: number().int().min(0).max(10).optional()
61584
+ lastFetchedAt: number()
60737
61585
  });
60738
61586
  var humiditySensorCapability = {
60739
61587
  name: "humidity-sensor",
@@ -60764,12 +61612,7 @@ var humiditySensorCapability = {
60764
61612
  } } },
60765
61613
  /** Clock fields: written, but excluded from the compare that decides
60766
61614
  * whether persisting is worth a SQLite commit. */
60767
- volatileStateFields: ["lastFetchedAt"],
60768
- customize: {
60769
- version: 1,
60770
- advanced: "derive",
60771
- targets: []
60772
- }
61615
+ volatileStateFields: ["lastFetchedAt"]
60773
61616
  };
60774
61617
  /**
60775
61618
  * Image display cap. Models a single still image exposed by an integration —
@@ -60790,7 +61633,7 @@ var ImageStatusSchema = object({
60790
61633
  * entity exposes no `entity_picture` (yet). */
60791
61634
  url: string().nullable(),
60792
61635
  /** Ms epoch of the upstream last-updated timestamp. Null at cold-start. */
60793
- lastUpdated: number().nullable()
61636
+ lastUpdated: number().nullable().meta(readingMeta("none"))
60794
61637
  });
60795
61638
  var imageCapability = {
60796
61639
  name: "image",
@@ -60878,19 +61721,19 @@ var NormalizedRangeSchema = object({
60878
61721
  */
60879
61722
  var ImageSettingsStatusSchema = object({
60880
61723
  /** Normalized 0–100. */
60881
- brightness: number().optional(),
61724
+ brightness: number().optional().meta(readingMeta("none")),
60882
61725
  /** Normalized 0–100. */
60883
- contrast: number().optional(),
61726
+ contrast: number().optional().meta(readingMeta("none")),
60884
61727
  /** Normalized 0–100. */
60885
- saturation: number().optional(),
61728
+ saturation: number().optional().meta(readingMeta("none")),
60886
61729
  /** Normalized 0–100. */
60887
- sharpness: number().optional(),
61730
+ sharpness: number().optional().meta(readingMeta("none")),
60888
61731
  mirror: boolean().optional(),
60889
61732
  flip: boolean().optional(),
60890
61733
  rotate: ImageRotateSchema.optional(),
60891
61734
  whiteBalance: WhiteBalanceModeSchema.optional(),
60892
61735
  /** Manual white-balance warmth, NORMALIZED 0–100. Meaningful only when `whiteBalance === 'manual'`. */
60893
- warmth: number().optional(),
61736
+ warmth: number().optional().meta(readingMeta("none")),
60894
61737
  exposureMode: ExposureModeSchema.optional(),
60895
61738
  backlightMode: BacklightModeSchema.optional(),
60896
61739
  lastFetchedAt: number()
@@ -61169,10 +62012,10 @@ var IntercomAbilitySchema = object({
61169
62012
  /** Codecs accepted by firmware, in preference order. Driver-authored strings. */
61170
62013
  codecs: array(string()),
61171
62014
  /** Sample rate (Hz) the firmware expects. Reolink typical: 16000. */
61172
- sampleRate: number(),
62015
+ sampleRate: number().meta(readingMeta("none")),
61173
62016
  duplex: _enum(["half", "full"]),
61174
62017
  /** Max in-flight audio backlog before drop (ms). Server uses this to bound latency. */
61175
- maxBacklogMs: number()
62018
+ maxBacklogMs: number().meta(readingMeta("duration-ms"))
61176
62019
  });
61177
62020
  var IntercomStatusSchema = object({
61178
62021
  /** True while a talk session is open. */
@@ -61399,13 +62242,13 @@ var LawnMowerControlStatusSchema = object({
61399
62242
  activity: LawnMowerActivitySchema,
61400
62243
  /** 0..100 battery percentage. Null when the device has no battery
61401
62244
  * reading. */
61402
- batteryLevel: number().min(0).max(100).nullable(),
62245
+ batteryLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
61403
62246
  /** 0..100 mowing-completion percentage of the current task, or null when no
61404
62247
  * task is active / progress is unavailable. */
61405
- progressPercent: number().min(0).max(100).nullable(),
62248
+ progressPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
61406
62249
  /** Current device/event code (dynamic — mostly status, sometimes an error),
61407
62250
  * or null when unknown. */
61408
- currentCode: number().nullable(),
62251
+ currentCode: number().nullable().meta(readingMeta("none")),
61409
62252
  /** Human label for {@link currentCode}, or null when undecodable. */
61410
62253
  currentCodeLabel: string().nullable(),
61411
62254
  /** Severity of {@link currentCode}. `error` (and often `warning`) warrants UI
@@ -61858,7 +62701,14 @@ var lockControlCapability = {
61858
62701
  }),
61859
62702
  unlock: method(object({
61860
62703
  deviceId: number().int().nonnegative(),
61861
- code: string().min(1).optional()
62704
+ code: string().min(1).optional(),
62705
+ /**
62706
+ * Honoured by a helper lock GROUP only (D944): unlocking several doors
62707
+ * with one call is refused unless the caller says it was confirmed. A
62708
+ * single lock ignores it. The refusal lives in the callee, so no
62709
+ * automation or API caller reaches the doors by skipping a dialog.
62710
+ */
62711
+ confirm: boolean().optional()
61862
62712
  }), _void(), {
61863
62713
  kind: "mutation",
61864
62714
  auth: "protected"
@@ -61895,6 +62745,44 @@ var lockControlCapability = {
61895
62745
  volatileStateFields: ["lastChangedAt"]
61896
62746
  };
61897
62747
  /**
62748
+ * A monotonic total between resets (D944). Energy uses `power-meter.kwhTotal`
62749
+ * so dashboards keep one series; every other instantaneous reading lands here.
62750
+ * `value` is the time integral in the source quantity's accumulated base
62751
+ * (base-unit seconds, or kWh on the power meter). `null` is a gap, never zero.
62752
+ */
62753
+ var MeterStatusSchema = object({
62754
+ value: number().nullable().meta(readingMeta("device", { label: "Total" })),
62755
+ lastFetchedAt: number()
62756
+ });
62757
+ var meterCapability = {
62758
+ name: "meter",
62759
+ scope: "device",
62760
+ deviceNative: true,
62761
+ mode: "singleton",
62762
+ deviceTypes: [DeviceType.Sensor],
62763
+ methods: {},
62764
+ status: {
62765
+ schema: MeterStatusSchema,
62766
+ kind: "push"
62767
+ },
62768
+ runtimeState: MeterStatusSchema,
62769
+ /**
62770
+ * Runtime-state durability: **restored** — the total is a cache of the
62771
+ * history integral. A restart shows it only until the history pass
62772
+ * recomputes the open period; it is not an in-memory buffer.
62773
+ *
62774
+ * See `RuntimeStateDurability`. Enforced by
62775
+ * `scripts/check-runtime-state-durability.ts`.
62776
+ */
62777
+ durability: "restored",
62778
+ history: { fields: { value: {
62779
+ kind: "counter",
62780
+ deadband: .001,
62781
+ minIntervalMs: 6e4
62782
+ } } },
62783
+ volatileStateFields: ["lastFetchedAt"]
62784
+ };
62785
+ /**
61898
62786
  * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
61899
62787
  * Apple TV, Spotify, Roku, generic OTT receivers, …) on
61900
62788
  * `DeviceType.MediaPlayer`. Disjoint from the camera streaming
@@ -61938,7 +62826,7 @@ var MediaPlayerStatusSchema = object({
61938
62826
  state: MediaPlayerStateSchema,
61939
62827
  /** Volume as 0..100 inclusive. Null when the device has no volume
61940
62828
  * surface. Pair with `DeviceFeature.MediaPlayerVolume`. */
61941
- volumeLevel: number().min(0).max(100).nullable(),
62829
+ volumeLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
61942
62830
  /** Mute toggle distinct from volume=0. Null when no mute surface.
61943
62831
  * Pair with `DeviceFeature.MediaPlayerMute`. */
61944
62832
  isMuted: boolean().nullable(),
@@ -61951,10 +62839,10 @@ var MediaPlayerStatusSchema = object({
61951
62839
  currentMedia: MediaInfoSchema.nullable(),
61952
62840
  /** Current playback position in ms. Null when not seekable or
61953
62841
  * nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
61954
- positionMs: number().int().nonnegative().nullable(),
62842
+ positionMs: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
61955
62843
  /** Total duration of the current media in ms. Null when unknown
61956
62844
  * (live stream) or nothing is playing. */
61957
- durationMs: number().int().nonnegative().nullable(),
62845
+ durationMs: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
61958
62846
  /** Shuffle toggle. Null when no shuffle surface.
61959
62847
  * Pair with `DeviceFeature.MediaPlayerShuffle`. */
61960
62848
  shuffle: boolean().nullable(),
@@ -62263,7 +63151,7 @@ var motionCustomize = {
62263
63151
  eventName: "onMotionChanged"
62264
63152
  },
62265
63153
  deviceTypes: [DeviceType.Camera],
62266
- apply: "replace",
63154
+ apply: "add",
62267
63155
  applyAuthority: {
62268
63156
  kind: "camera-sensors",
62269
63157
  timeoutField: "motionCooldownMs"
@@ -62335,7 +63223,7 @@ var MotionStatusSchema = object({
62335
63223
  * it, every provider seeded it at boot, and every session left it
62336
63224
  * `detected: true` after its detach.
62337
63225
  */
62338
- autoClearAfterMs: number().nullable()
63226
+ autoClearAfterMs: number().nullable().meta(readingMeta("duration-ms"))
62339
63227
  });
62340
63228
  /**
62341
63229
  * Payload of `motion.onMotionChanged` event + the corresponding bus
@@ -62372,12 +63260,18 @@ var motionCapability = {
62372
63260
  methods: {
62373
63261
  /**
62374
63262
  * Pull the current motion state synchronously. Convenience shortcut
62375
- * for consumers that don't need the full status object; equivalent
62376
- * to `getStatus()?.detected ?? false`. Will likely be folded into
62377
- * `getStatus` once the auto-injected status surface lands in every
62378
- * consumer.
63263
+ * for consumers that don't need the full status object. A composed
63264
+ * group answers from its slice (D944): unknown throws, it is not off.
62379
63265
  */
62380
63266
  isDetected: method(object({ deviceId: number() }), boolean()) },
63267
+ /**
63268
+ * A composed motion group serves `isDetected` from `detected` (D944).
63269
+ * Without this the cap stays uncomposable (`has-commands`).
63270
+ */
63271
+ composedMethods: { isDetected: {
63272
+ kind: "slice",
63273
+ field: "detected"
63274
+ } },
62381
63275
  events: {
62382
63276
  /**
62383
63277
  * Fires every time the runner transitions a camera between
@@ -62517,7 +63411,7 @@ var MotionZoneRegionSchema = object({
62517
63411
  * the grid region(s). */
62518
63412
  var MotionZoneStatusSchema = object({
62519
63413
  enabled: boolean(),
62520
- sensitivity: number(),
63414
+ sensitivity: number().meta(readingMeta("none")),
62521
63415
  /** Grid region(s). Today exactly one `grid` shape. */
62522
63416
  regions: array(MotionZoneRegionSchema),
62523
63417
  lastFetchedAt: number()
@@ -62887,7 +63781,7 @@ var NavigationStatusSchema = object({
62887
63781
  following: boolean(),
62888
63782
  flash: boolean(),
62889
63783
  lightMode: NavigationLightModeSchema,
62890
- lightLevel: number().min(40).max(100),
63784
+ lightLevel: number().min(40).max(100).meta(readingMeta("none")),
62891
63785
  /** Ms epoch when the slice was last updated. */
62892
63786
  lastChangedAt: number()
62893
63787
  });
@@ -63021,13 +63915,13 @@ var NetworkLinkStatusSchema = object({
63021
63915
  * one whose reading has not landed must not be drawn at 0 %. Consumers
63022
63916
  * SKIP a null rather than coerce it.
63023
63917
  */
63024
- signalPercent: number().min(0).max(100).nullable(),
63918
+ signalPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
63025
63919
  /** Raw received signal strength in dBm, when the firmware reports one. */
63026
- rssiDbm: number().optional(),
63920
+ rssiDbm: number().optional().meta(readingMeta("signal-level")),
63027
63921
  /** Network name of a wireless link, when the firmware reports it. */
63028
63922
  ssid: string().optional(),
63029
63923
  /** Ms epoch of the last observation. Lets consumers reason about freshness. */
63030
- lastUpdated: number()
63924
+ lastUpdated: number().meta(readingMeta("none"))
63031
63925
  });
63032
63926
  var networkLinkCapability = {
63033
63927
  name: "network-link",
@@ -63412,7 +64306,7 @@ var NotifierStatusSchema = object({
63412
64306
  lastError: string().nullable(),
63413
64307
  /** Number of deliveries currently buffered server-side (rate-limited
63414
64308
  * notifiers may queue). 0 when the provider sends synchronously. */
63415
- queueDepth: number().int().nonnegative(),
64309
+ queueDepth: number().int().nonnegative().meta(readingMeta("count")),
63416
64310
  /** Per-feature capability matrix — authoritative source for the
63417
64311
  * compose-form field gating. */
63418
64312
  supports: NotifierSupportsSchema
@@ -63504,11 +64398,9 @@ onSent: { data: object({
63504
64398
  * cap fits (HA `sensor` whose `device_class` we don't have a typed cap
63505
64399
  * for: water flow, distance, weight, frequency, signal strength, …).
63506
64400
  *
63507
- * The `unit` and `precision` fields carry the live display metadata that
63508
- * the upstream source provides with each state push (HA
63509
- * `attributes.unit_of_measurement` / `attributes.suggested_display_precision`).
63510
- * The UI reads them directly from the slice — they are the single source
63511
- * of truth for generic numeric rendering and do NOT live on `sourceInfo`.
64401
+ * The quantity is not on this slice. It is chosen when the device is
64402
+ * adopted and stored once on `SourceInfo.quantity` (D944). `value` is in
64403
+ * that quantity's base unit. `null` is a refused sample (D393).
63512
64404
  *
63513
64405
  * Prefer the typed alternatives (`temperature-sensor`, `humidity-sensor`,
63514
64406
  * `ambient-light-sensor`, `pressure-sensor`, `power-meter`,
@@ -63517,15 +64409,8 @@ onSent: { data: object({
63517
64409
  * numeric values land here.
63518
64410
  */
63519
64411
  var NumericSensorStatusSchema = object({
63520
- value: number(),
63521
- /** Display unit-of-measurement (e.g. 'dBm', 's', 'rpm', 'steps').
63522
- * Populated live from the upstream source on each state push.
63523
- * Absent for unitless sensors. */
63524
- unit: string().optional(),
63525
- /** Suggested decimal places for numeric display.
63526
- * Populated live from the upstream source when provided.
63527
- * Falls back to auto-formatting when absent. */
63528
- precision: number().int().min(0).max(10).optional(),
64412
+ /** Reading in the device quantity's base unit. `null` when refused (D393). */
64413
+ value: number().nullable().meta(readingMeta("device")),
63529
64414
  /** Ms epoch when the slice was last updated. */
63530
64415
  lastFetchedAt: number()
63531
64416
  });
@@ -63549,11 +64434,11 @@ var numericSensorCapability = {
63549
64434
  */
63550
64435
  durability: "restored",
63551
64436
  /**
63552
- * History (D850): recorded series. The unit is per device, read from the sibling `unit` field.
64437
+ * History (D850): recorded series. The unit is the device quantity's base,
64438
+ * resolved when the series is read — the cap has no single unit.
63553
64439
  */
63554
64440
  history: { fields: { value: {
63555
64441
  kind: "gauge",
63556
- unitFrom: "unit",
63557
64442
  minIntervalMs: 3e4
63558
64443
  } } },
63559
64444
  /** Clock fields: written, but excluded from the compare that decides
@@ -63891,23 +64776,26 @@ var PetFeederStatusSchema = object({
63891
64776
  /** Food currently in the bowl (grams). Null when the device has not
63892
64777
  * reported a reading yet. On dual-hopper models this is the combined
63893
64778
  * bowl reading; per-hopper levels live in `food1`/`food2`. */
63894
- foodLevel: number().nullable(),
64779
+ foodLevel: number().nullable().meta(readingMeta("none")),
63895
64780
  /** Hopper-1 food level (grams) on dual-hopper feeders; null on
63896
64781
  * single-hopper models. */
63897
- food1: number().nullable(),
64782
+ food1: number().nullable().meta(readingMeta("none")),
63898
64783
  /** Hopper-2 food level (grams) on dual-hopper feeders; null on
63899
64784
  * single-hopper models. */
63900
- food2: number().nullable(),
64785
+ food2: number().nullable().meta(readingMeta("none")),
63901
64786
  /** Derived low-food flag — mirrors the HA `food_level` binary_sensor
63902
64787
  * (`device_class: problem`, on = low). True when the bowl is empty /
63903
64788
  * below the feeder's low threshold. */
63904
64789
  lowFood: boolean(),
63905
64790
  /** Battery charge 0..100 (%). Null on mains-powered models or when the
63906
64791
  * device has no battery reading. */
63907
- batteryPower: number().min(0).max(100).nullable(),
63908
- /** Days of desiccant life remaining. Null when the model has no
63909
- * desiccant sensor. */
63910
- desiccantLeftDays: number().nullable(),
64792
+ batteryPower: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
64793
+ /**
64794
+ * Desiccant life remaining, stored in seconds (duration base, D944).
64795
+ * Providers convert from the days the feeder reports. Null when the
64796
+ * model has no desiccant sensor.
64797
+ */
64798
+ desiccantLeftDays: number().nullable().meta(readingMeta("duration")),
63911
64799
  /** True while a feed is in progress. */
63912
64800
  feeding: boolean(),
63913
64801
  /** Decoded connectivity / power status (HA petkit device-status enum).
@@ -63918,7 +64806,7 @@ var PetFeederStatusSchema = object({
63918
64806
  * with `errorCode` for consumers that want the raw integer. */
63919
64807
  error: string().nullable(),
63920
64808
  /** Raw device error code (0 / null = no error). */
63921
- errorCode: number().nullable(),
64809
+ errorCode: number().nullable().meta(readingMeta("none")),
63922
64810
  /** True for D4S/D4SH dual-hopper hardware — gates the per-hopper UI. */
63923
64811
  isDualHopper: boolean(),
63924
64812
  /** Child-lock (manual-lock) setting — buttons on the unit are disabled. */
@@ -63928,7 +64816,7 @@ var PetFeederStatusSchema = object({
63928
64816
  /** Play a chime when dispensing. */
63929
64817
  feedSound: boolean(),
63930
64818
  /** Speaker / prompt volume level (device-scaled integer). */
63931
- volume: number(),
64819
+ volume: number().meta(readingMeta("none")),
63932
64820
  /** Ms epoch when the slice was last refreshed from the cloud. */
63933
64821
  lastFetchedAt: number()
63934
64822
  });
@@ -64047,7 +64935,7 @@ var petFeederCapability = {
64047
64935
  },
64048
64936
  desiccantLeftDays: {
64049
64937
  kind: "gauge",
64050
- unit: "days"
64938
+ unit: "s"
64051
64939
  }
64052
64940
  } }
64053
64941
  };
@@ -64448,43 +65336,88 @@ method(_void(), PlatformCapabilitiesSchema), method(_void(), HardwareInfoSchema)
64448
65336
  */
64449
65337
  var PowerMeterStatusSchema = object({
64450
65338
  /** Instantaneous power draw in watts. */
64451
- watts: number().optional().meta({
64452
- unit: "W",
64453
- label: "Power"
64454
- }),
65339
+ watts: number().optional().meta(readingMeta("power", { label: "Power" })),
64455
65340
  /** Cumulative energy in kilowatt-hours since the meter was reset. */
64456
- kwhTotal: number().optional().meta({
64457
- unit: "kWh",
64458
- label: "Energy"
64459
- }),
65341
+ kwhTotal: number().optional().meta(readingMeta("energy", { label: "Energy" })),
64460
65342
  /** Voltage in volts. */
64461
- volts: number().optional(),
65343
+ volts: number().optional().meta(readingMeta("voltage", { label: "Voltage" })),
64462
65344
  /** Current in amperes. */
64463
- amps: number().optional(),
64464
- /** Apparent power in volt-amperes (W × power-factor reciprocal). */
64465
- va: number().optional(),
65345
+ amps: number().optional().meta(readingMeta("current", { label: "Current" })),
65346
+ /** Apparent power in volt-amperes. */
65347
+ va: number().optional().meta(readingMeta("apparent-power")),
64466
65348
  /** Power factor (0..1) if reported. */
64467
- powerFactor: number().min(0).max(1).optional(),
65349
+ powerFactor: number().min(0).max(1).optional().meta(readingMeta("ratio")),
64468
65350
  /** Ms epoch when the slice was last updated. */
64469
- lastFetchedAt: number(),
64470
- /** Live display unit of the single metric this slice carries (e.g. HA
64471
- * `attributes.unit_of_measurement` → 'V' / 'A' / 'W' / 'kW' / 'kWh').
64472
- * Each upstream `sensor.*` entity surfaces ONE device_class, so one
64473
- * unit per slice is unambiguous. The UI prefers this over the role's
64474
- * canonical unit so a 'kW' / 'Wh' feed renders verbatim. */
64475
- unit: string().optional(),
64476
- /** Suggested decimal places for numeric display.
64477
- * Populated live from the upstream source when provided (e.g. HA
64478
- * `attributes.suggested_display_precision`). Falls back to
64479
- * auto-formatting when absent. */
64480
- precision: number().int().min(0).max(10).optional()
65351
+ lastFetchedAt: number()
64481
65352
  });
65353
+ /**
65354
+ * Loads that draw metered mains power (D951). The reading is a feature of the
65355
+ * device itself — a plug, a lamp, a fan, an air conditioner, a boiler, a
65356
+ * vacuum dock — not a separate sensor beside it. A `Sensor` stays: a clamp
65357
+ * meter or a standalone energy monitor IS the device. Cover, lock, valve,
65358
+ * camera and the like are left out: their draw is not what anyone meters.
65359
+ */
65360
+ var POWER_METER_DEVICE_TYPES = [
65361
+ DeviceType.Sensor,
65362
+ DeviceType.Switch,
65363
+ DeviceType.Light,
65364
+ DeviceType.Fan,
65365
+ DeviceType.Climate,
65366
+ DeviceType.Thermostat,
65367
+ DeviceType.Humidifier,
65368
+ DeviceType.WaterHeater,
65369
+ DeviceType.MediaPlayer,
65370
+ DeviceType.Washer,
65371
+ DeviceType.Dryer,
65372
+ DeviceType.Dishwasher,
65373
+ DeviceType.Vacuum,
65374
+ DeviceType.LawnMower,
65375
+ DeviceType.PetFeeder
65376
+ ];
65377
+ /** Everything but a bare `Sensor`: a sensor that takes its reading from another sensor adds nothing. */
65378
+ var POWER_METER_CUSTOMIZE_DEVICE_TYPES = POWER_METER_DEVICE_TYPES.filter((type) => type !== DeviceType.Sensor);
65379
+ /** One scalar target per reading; each is sourced from a device of its own (D951). */
65380
+ function powerTarget(id, unit) {
65381
+ return {
65382
+ id,
65383
+ cardinality: "scalar",
65384
+ vocabulary: {
65385
+ cap: "power-meter",
65386
+ stateField: id
65387
+ },
65388
+ deviceTypes: POWER_METER_CUSTOMIZE_DEVICE_TYPES,
65389
+ apply: "add",
65390
+ path: id,
65391
+ sources: [{
65392
+ kind: "numeric",
65393
+ requiredUnit: unit,
65394
+ transforms: [{ kind: "identity" }]
65395
+ }],
65396
+ companions: [{
65397
+ kind: "clock",
65398
+ path: "lastFetchedAt",
65399
+ when: "always"
65400
+ }],
65401
+ sourceReport: { status: "assignment-status" },
65402
+ advancedExpression: true
65403
+ };
65404
+ }
65405
+ /** "Power and energy" extension: watts, energy, voltage and current from other devices (D951). */
65406
+ var powerMeterCustomize = {
65407
+ version: 1,
65408
+ targets: [
65409
+ powerTarget("watts", "W"),
65410
+ powerTarget("kwhTotal", "kWh"),
65411
+ powerTarget("volts", "V"),
65412
+ powerTarget("amps", "A")
65413
+ ]
65414
+ };
64482
65415
  var powerMeterCapability = {
64483
65416
  name: "power-meter",
64484
65417
  scope: "device",
64485
65418
  deviceNative: true,
64486
65419
  mode: "singleton",
64487
- deviceTypes: [DeviceType.Sensor],
65420
+ deviceTypes: POWER_METER_DEVICE_TYPES,
64488
65421
  methods: {},
64489
65422
  status: {
64490
65423
  schema: PowerMeterStatusSchema,
@@ -64542,11 +65475,7 @@ var powerMeterCapability = {
64542
65475
  /** Clock fields: written, but excluded from the compare that decides
64543
65476
  * whether persisting is worth a SQLite commit. */
64544
65477
  volatileStateFields: ["lastFetchedAt"],
64545
- customize: {
64546
- version: 1,
64547
- advanced: "derive",
64548
- targets: []
64549
- }
65478
+ customize: powerMeterCustomize
64550
65479
  };
64551
65480
  /**
64552
65481
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
@@ -64566,11 +65495,11 @@ var powerMeterCapability = {
64566
65495
  */
64567
65496
  var GpsLocationSchema = object({
64568
65497
  /** Latitude in decimal degrees, -90..90. */
64569
- latitude: number().min(-90).max(90),
65498
+ latitude: number().min(-90).max(90).meta(readingMeta("angle")),
64570
65499
  /** Longitude in decimal degrees, -180..180. */
64571
- longitude: number().min(-180).max(180),
65500
+ longitude: number().min(-180).max(180).meta(readingMeta("angle")),
64572
65501
  /** Reported accuracy in meters (lower = better). */
64573
- accuracyMeters: number().nonnegative()
65502
+ accuracyMeters: number().nonnegative().meta(readingMeta("length"))
64574
65503
  });
64575
65504
  var PresenceStatusSchema = object({
64576
65505
  /** `home` / `not_home` / any user-defined zone name. */
@@ -64582,7 +65511,7 @@ var PresenceStatusSchema = object({
64582
65511
  gps: GpsLocationSchema.nullable(),
64583
65512
  /** Optional battery level of the tracking device (0..100). Null
64584
65513
  * when not reported. */
64585
- batteryPercent: number().min(0).max(100).nullable(),
65514
+ batteryPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
64586
65515
  /** Ms epoch when the slice was last updated. */
64587
65516
  lastChangedAt: number()
64588
65517
  });
@@ -64632,19 +65561,10 @@ var presenceCapability = {
64632
65561
  * `sourceInfo`.
64633
65562
  */
64634
65563
  var PressureSensorStatusSchema = object({
64635
- /** Current pressure in hPa. */
64636
- hpa: number(),
65564
+ /** Current pressure in hPa. `null` when the sample was refused (D393). */
65565
+ hpa: number().nullable().meta(readingMeta("pressure", { precision: 0 })),
64637
65566
  /** Ms epoch when the slice was last updated. */
64638
- lastFetchedAt: number(),
64639
- /** Live display unit from the upstream source (e.g. HA
64640
- * `attributes.unit_of_measurement`). The UI prefers this over the
64641
- * role's canonical unit. Absent → fall back to the canonical unit. */
64642
- unit: string().optional(),
64643
- /** Suggested decimal places for numeric display.
64644
- * Populated live from the upstream source when provided (e.g. HA
64645
- * `attributes.suggested_display_precision`). Falls back to
64646
- * auto-formatting when absent. */
64647
- precision: number().int().min(0).max(10).optional()
65567
+ lastFetchedAt: number()
64648
65568
  });
64649
65569
  var pressureSensorCapability = {
64650
65570
  name: "pressure-sensor",
@@ -65170,8 +66090,8 @@ var ptzCapability = {
65170
66090
  };
65171
66091
  var PtzAutotrackSettingsSchema = object({
65172
66092
  targetType: string().describe("Vendor target string (people/vehicle/pet); empty = camera default"),
65173
- stopDelaySeconds: number().int().min(0).max(300),
65174
- disappearDelaySeconds: number().int().min(0).max(300)
66093
+ stopDelaySeconds: number().int().min(0).max(300).meta(readingMeta("duration")),
66094
+ disappearDelaySeconds: number().int().min(0).max(300).meta(readingMeta("duration"))
65175
66095
  });
65176
66096
  /**
65177
66097
  * One option the camera advertises as a valid `targetType`. Drivers
@@ -65325,7 +66245,7 @@ var RunningStateStatusSchema = object({
65325
66245
  /** null = unknown — never coerced to false (D393). */
65326
66246
  running: boolean().nullable(),
65327
66247
  /** Epoch ms the current boolean began; null while `running` is null. */
65328
- since: number().nullable(),
66248
+ since: number().nullable().meta(readingMeta("none")),
65329
66249
  source: RunningStateSourceSchema.meta({ label: "Source" }),
65330
66250
  phase: string().nullable(),
65331
66251
  /** null until a reading has been published (D393). */
@@ -65340,7 +66260,6 @@ var RUNNING_DEVICE_TYPES = Object.values(DeviceType);
65340
66260
  /** Generic Customize target for the running boolean (D936). */
65341
66261
  var runningCustomize = {
65342
66262
  version: 1,
65343
- advanced: "derive",
65344
66263
  targets: [{
65345
66264
  id: "running",
65346
66265
  cardinality: "scalar",
@@ -65349,6 +66268,8 @@ var runningCustomize = {
65349
66268
  stateField: "running"
65350
66269
  },
65351
66270
  deviceTypes: [
66271
+ DeviceType.Washer,
66272
+ DeviceType.Dryer,
65352
66273
  DeviceType.Dishwasher,
65353
66274
  DeviceType.Vacuum,
65354
66275
  DeviceType.LawnMower,
@@ -65360,7 +66281,7 @@ var runningCustomize = {
65360
66281
  DeviceType.Thermostat,
65361
66282
  DeviceType.PetFeeder
65362
66283
  ],
65363
- apply: "add-or-replace",
66284
+ apply: "add",
65364
66285
  path: "running",
65365
66286
  sources: [
65366
66287
  {
@@ -66653,9 +67574,9 @@ var RecordTriggerSchema = _enum([
66653
67574
  */
66654
67575
  var RecordWindowSchema = object({
66655
67576
  trigger: RecordTriggerSchema,
66656
- day: number().int().min(0).max(6),
66657
- startMinute: number().int().min(0).max(1439),
66658
- endMinute: number().int().min(1).max(1440)
67577
+ day: number().int().min(0).max(6).meta(readingMeta("none")),
67578
+ startMinute: number().int().min(0).max(1439).meta(readingMeta("none")),
67579
+ endMinute: number().int().min(1).max(1440).meta(readingMeta("none"))
66659
67580
  });
66660
67581
  /** Status of one physical volume, as the camera itself describes it. */
66661
67582
  var OnboardStorageVolumeSchema = object({
@@ -66731,10 +67652,10 @@ var RecordingOnboardStatusSchema = object({
66731
67652
  /** Master "record to the card at all" switch. */
66732
67653
  enabled: boolean().nullable(),
66733
67654
  overwriteWhenFull: boolean().nullable(),
66734
- preRecordSec: number().nullable(),
66735
- postRecordSec: number().nullable(),
67655
+ preRecordSec: number().nullable().meta(readingMeta("duration")),
67656
+ postRecordSec: number().nullable().meta(readingMeta("duration")),
66736
67657
  /** Length of one recorded file, in minutes. */
66737
- segmentMinutes: number().nullable(),
67658
+ segmentMinutes: number().nullable().meta(readingMeta("none")),
66738
67659
  /** The primary track's weekly windows, flattened. */
66739
67660
  windows: array(RecordWindowSchema),
66740
67661
  /**
@@ -66750,7 +67671,7 @@ var RecordingOnboardStatusSchema = object({
66750
67671
  * provider reporting a non-zero count also reports the schedule as not
66751
67672
  * writable.
66752
67673
  */
66753
- unreadableWindows: number(),
67674
+ unreadableWindows: number().meta(readingMeta("count")),
66754
67675
  /**
66755
67676
  * The camera is scheduled to record and has NO usable storage.
66756
67677
  *
@@ -67771,7 +68692,7 @@ var CamStreamDescriptorSchema = object({
67771
68692
  url: string().optional(),
67772
68693
  codec: string().optional(),
67773
68694
  resolution: CamStreamResolutionSchema.optional(),
67774
- fps: number().positive().optional(),
68695
+ fps: number().positive().optional().meta(readingMeta("rate")),
67775
68696
  label: string().optional(),
67776
68697
  /** Device-level features (e.g. `battery-operated`) — drives broker policy. */
67777
68698
  deviceFeatures: array(string()).optional(),
@@ -67858,18 +68779,18 @@ var StreamProfileSchema = _enum([
67858
68779
  ]);
67859
68780
  /** The current encoding config of one stream profile. */
67860
68781
  var StreamProfileConfigSchema = object({
67861
- width: number(),
67862
- height: number(),
68782
+ width: number().meta(readingMeta("none")),
68783
+ height: number().meta(readingMeta("none")),
67863
68784
  codec: _enum(["h264", "h265"]),
67864
- framerate: number(),
67865
- bitrate: number(),
68785
+ framerate: number().meta(readingMeta("rate")),
68786
+ bitrate: number().meta(readingMeta("bitrate")),
67866
68787
  bitrateMode: _enum(["vbr", "cbr"]).optional(),
67867
68788
  encoderProfile: _enum([
67868
68789
  "high",
67869
68790
  "main",
67870
68791
  "baseline"
67871
68792
  ]).optional(),
67872
- gop: number().optional(),
68793
+ gop: number().optional().meta(readingMeta("none")),
67873
68794
  /**
67874
68795
  * Whether THIS profile currently carries an audio track. READ-ONLY here.
67875
68796
  *
@@ -68241,7 +69162,8 @@ var switchCapability = {
68241
69162
  deviceTypes: [
68242
69163
  DeviceType.Switch,
68243
69164
  DeviceType.Siren,
68244
- DeviceType.Light
69165
+ DeviceType.Light,
69166
+ DeviceType.Fan
68245
69167
  ],
68246
69168
  methods: { setState: method(object({
68247
69169
  deviceId: number(),
@@ -68288,12 +69210,7 @@ var switchCapability = {
68288
69210
  label: "On",
68289
69211
  kind: "boolean"
68290
69212
  }
68291
- }] },
68292
- customize: {
68293
- version: 1,
68294
- advanced: "derive",
68295
- targets: []
68296
- }
69213
+ }] }
68297
69214
  };
68298
69215
  /** C0 controls, DEL and the C1 range: none of them belongs in a name. */
68299
69216
  function hasControlCharacter(value) {
@@ -68876,35 +69793,21 @@ var tamperCapability = {
68876
69793
  * entries with `device_class: temperature` and any future native
68877
69794
  * thermometer.
68878
69795
  *
68879
- * Unit normalisation: providers convert to Celsius before storing.
68880
- * The slice value is always Celsius so cross-cap aggregators
68881
- * (climate-control's `currentTemp`, energy analytics) can compose
68882
- * without per-source unit fixups. The canonical display unit (`°C`) is
68883
- * a descriptor constant in the UI (ROLE_DESCRIPTOR), not stored in
68884
- * `sourceInfo`.
69796
+ * The number is Celsius (D944). Providers convert on ingest. A failed
69797
+ * conversion is `null`, never a guess. Display unit is a read-time preference.
68885
69798
  *
68886
69799
  * Status `lastFetchedAt` lets staleness-aware consumers detect a
68887
69800
  * frozen feed (provider hung) distinct from a "temperature hasn't
68888
69801
  * changed" steady state.
68889
69802
  */
68890
69803
  var TemperatureSensorStatusSchema = object({
68891
- /** Current temperature in Celsius. */
68892
- celsius: number().meta({
68893
- unit: "°C",
69804
+ /** Current temperature in Celsius. `null` when the sample was refused (D393). */
69805
+ celsius: number().nullable().meta(readingMeta("temperature", {
69806
+ precision: 1,
68894
69807
  label: "Temperature"
68895
- }),
69808
+ })),
68896
69809
  /** Ms epoch when the slice was last updated (push or poll). */
68897
- lastFetchedAt: number(),
68898
- /** Live display unit from the upstream source (e.g. HA
68899
- * `attributes.unit_of_measurement`). The UI prefers this over the
68900
- * role's canonical unit, so a Fahrenheit feed renders '°F' not '°C'.
68901
- * Absent → the UI falls back to the role's canonical unit. */
68902
- unit: string().optional(),
68903
- /** Suggested decimal places for numeric display.
68904
- * Populated live from the upstream source when provided (e.g. HA
68905
- * `attributes.suggested_display_precision`). Falls back to
68906
- * auto-formatting when absent. */
68907
- precision: number().int().min(0).max(10).optional()
69810
+ lastFetchedAt: number()
68908
69811
  });
68909
69812
  var temperatureSensorCapability = {
68910
69813
  name: "temperature-sensor",
@@ -68935,12 +69838,7 @@ var temperatureSensorCapability = {
68935
69838
  } } },
68936
69839
  /** Clock fields: written, but excluded from the compare that decides
68937
69840
  * whether persisting is worth a SQLite commit. */
68938
- volatileStateFields: ["lastFetchedAt"],
68939
- customize: {
68940
- version: 1,
68941
- advanced: "derive",
68942
- targets: []
68943
- }
69841
+ volatileStateFields: ["lastFetchedAt"]
68944
69842
  };
68945
69843
  /**
68946
69844
  * toast — system-scoped singleton capability that streams toast
@@ -69223,16 +70121,16 @@ var VacuumControlStatusSchema = object({
69223
70121
  ]),
69224
70122
  /** 0..100 battery percentage. Null when the device has no battery
69225
70123
  * reading. */
69226
- batteryLevel: number().min(0).max(100).nullable(),
70124
+ batteryLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
69227
70125
  /** Current fan-speed token (provider-verbatim). Null when unknown or
69228
70126
  * the vacuum has no speed control. */
69229
70127
  fanSpeed: string().nullable(),
69230
70128
  /** Speed tokens the hardware accepts — drives the UI selector. */
69231
70129
  availableFanSpeeds: array(string()),
69232
70130
  /** 0..100 cleaning-completion percentage of the current task, or null. */
69233
- progressPercent: number().min(0).max(100).nullable(),
70131
+ progressPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
69234
70132
  /** Current error code (0 / null = no error). */
69235
- errorCode: number().nullable(),
70133
+ errorCode: number().nullable().meta(readingMeta("none")),
69236
70134
  /** Human label for {@link errorCode}, or null when none / undecodable. */
69237
70135
  errorLabel: string().nullable(),
69238
70136
  /** Ms epoch when the slice was last updated. */
@@ -69310,7 +70208,7 @@ var ValveStatusSchema = object({
69310
70208
  ]),
69311
70209
  /** 0 = fully closed, 100 = fully open. Null when the device has no
69312
70210
  * intermediate position surface. */
69313
- position: number().min(0).max(100).nullable(),
70211
+ position: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
69314
70212
  /** Ms epoch when the slice was last updated. */
69315
70213
  lastChangedAt: number()
69316
70214
  });
@@ -69418,9 +70316,9 @@ var vibrationCapability = {
69418
70316
  */
69419
70317
  var WaterHeaterStatusSchema = object({
69420
70318
  /** Current measured temperature. Null when not reported. */
69421
- currentTemp: number().nullable(),
70319
+ currentTemp: number().nullable().meta(readingMeta("temperature")),
69422
70320
  /** Target temperature setpoint. Null when no setpoint surface. */
69423
- targetTemp: number().nullable(),
70321
+ targetTemp: number().nullable().meta(readingMeta("temperature")),
69424
70322
  /** Active operation mode = HA `state` (`eco` / `electric` / `gas` /
69425
70323
  * `heat_pump` / `high_demand` / `performance` / `off`). Null when the
69426
70324
  * device reports an unknown state. */
@@ -69431,9 +70329,9 @@ var WaterHeaterStatusSchema = object({
69431
70329
  * has no away surface. */
69432
70330
  away: boolean().nullable(),
69433
70331
  /** HA `min_temp` attribute. Null when not reported. */
69434
- minTemp: number().nullable(),
70332
+ minTemp: number().nullable().meta(readingMeta("temperature")),
69435
70333
  /** HA `max_temp` attribute. Null when not reported. */
69436
- maxTemp: number().nullable(),
70334
+ maxTemp: number().nullable().meta(readingMeta("temperature")),
69437
70335
  /** Ms epoch when the slice was last updated. */
69438
70336
  lastChangedAt: number()
69439
70337
  });
@@ -69518,25 +70416,18 @@ var waterHeaterCapability = {
69518
70416
  * Forecast deferred — current conditions only for v1.
69519
70417
  */
69520
70418
  var WeatherStatusSchema = object({
69521
- /** Verbatim HA condition state (`sunny`, `cloudy`, `rainy`, …). Null
69522
- * when no condition has been reported yet. */
70419
+ /** Verbatim condition state (`sunny`, `cloudy`, `rainy`, …). Null when none yet. */
69523
70420
  condition: string().nullable(),
69524
- /** Current temperature in the reported unit. Null when not provided. */
69525
- temperature: number().nullable(),
69526
- /** Temperature unit string (e.g. `°C` / `°F`). Null when not provided. */
69527
- temperatureUnit: string().nullable(),
70421
+ /** Current temperature in Celsius. Null when not provided or refused. */
70422
+ temperature: number().nullable().meta(readingMeta("temperature", { precision: 1 })),
69528
70423
  /** Relative humidity (0..100). Null when not provided. */
69529
- humidity: number().min(0).max(100).nullable(),
69530
- /** Barometric pressure in the reported unit. Null when not provided. */
69531
- pressure: number().nullable(),
69532
- /** Pressure unit string (e.g. `hPa` / `inHg`). Null when not provided. */
69533
- pressureUnit: string().nullable(),
69534
- /** Wind speed in the reported unit. Null when not provided. */
69535
- windSpeed: number().nullable(),
69536
- /** Wind-speed unit string (e.g. `km/h` / `mph`). Null when not provided. */
69537
- windSpeedUnit: string().nullable(),
70424
+ humidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
70425
+ /** Barometric pressure in hPa. Null when not provided or refused. */
70426
+ pressure: number().nullable().meta(readingMeta("pressure")),
70427
+ /** Wind speed in metres per second. Null when not provided or refused. */
70428
+ windSpeed: number().nullable().meta(readingMeta("speed")),
69538
70429
  /** Wind bearing in degrees (0..360, meteorological). Null when not provided. */
69539
- windBearing: number().nullable(),
70430
+ windBearing: number().nullable().meta(readingMeta("angle")),
69540
70431
  /** Ms epoch when the slice was last updated. */
69541
70432
  lastFetchedAt: number()
69542
70433
  });
@@ -69564,12 +70455,12 @@ var weatherCapability = {
69564
70455
  */
69565
70456
  durability: "session",
69566
70457
  /**
69567
- * History (D850): recorded series. Units follow the sibling `*Unit` fields.
70458
+ * History (D850): recorded series. Numbers are the quantity base (D944).
69568
70459
  */
69569
70460
  history: { fields: {
69570
70461
  temperature: {
69571
70462
  kind: "gauge",
69572
- unitFrom: "temperatureUnit",
70463
+ unit: "°C",
69573
70464
  deadband: .2
69574
70465
  },
69575
70466
  humidity: {
@@ -69579,12 +70470,12 @@ var weatherCapability = {
69579
70470
  },
69580
70471
  pressure: {
69581
70472
  kind: "gauge",
69582
- unitFrom: "pressureUnit",
70473
+ unit: "hPa",
69583
70474
  deadband: .5
69584
70475
  },
69585
70476
  windSpeed: {
69586
70477
  kind: "gauge",
69587
- unitFrom: "windSpeedUnit",
70478
+ unit: "m/s",
69588
70479
  deadband: .5
69589
70480
  }
69590
70481
  } }
@@ -70618,8 +71509,9 @@ function withClipEventLabels(provider, deps) {
70618
71509
  listClips
70619
71510
  };
70620
71511
  }
71512
+ DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.ValvePositionable, DeviceFeature.MediaPlayerVolume, DeviceFeature.ClimateFanMode;
70621
71513
  SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
70622
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher, DeviceType.Camera, DeviceType.Camera, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
71514
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Camera, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
70623
71515
  String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
70624
71516
  DeviceRole.BinarySensor, DeviceRole.MotionSensor;
70625
71517
  new Set(CAP_NAMES);
@@ -70963,6 +71855,9 @@ var DEVICE_LOCAL_STATE_CAPS = {
70963
71855
  featureProbe: featureProbeCapability,
70964
71856
  flood: floodCapability,
70965
71857
  gas: gasCapability,
71858
+ groupActive: groupActiveCapability,
71859
+ groupCommands: groupCommandsCapability,
71860
+ groupStatus: groupStatusCapability,
70966
71861
  heatingValve: heatingValveCapability,
70967
71862
  humidifier: humidifierCapability,
70968
71863
  humiditySensor: humiditySensorCapability,
@@ -70972,6 +71867,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
70972
71867
  lawnMowerControl: lawnMowerControlCapability,
70973
71868
  lockControl: lockControlCapability,
70974
71869
  mediaPlayer: mediaPlayerCapability,
71870
+ meter: meterCapability,
70975
71871
  motion: motionCapability,
70976
71872
  motionTrigger: motionTriggerCapability,
70977
71873
  motionZones: motionZonesCapability,
@@ -72235,7 +73131,7 @@ var BaseDeviceProvider = class extends BaseAddon {
72235
73131
  function widenDeviceConstructor(ctor) {
72236
73132
  return ctor;
72237
73133
  }
72238
- DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher;
73134
+ DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer;
72239
73135
  new Set(Object.values(DeviceType));
72240
73136
  Object.freeze({
72241
73137
  "accessories.getStatus": {
@@ -72343,6 +73239,13 @@ Object.freeze({
72343
73239
  access: "view",
72344
73240
  role: "admin"
72345
73241
  },
73242
+ "addons.getPackageDocs": {
73243
+ capName: "addons",
73244
+ capScope: "system",
73245
+ addonId: null,
73246
+ access: "view",
73247
+ role: "admin"
73248
+ },
72346
73249
  "addons.getVersions": {
72347
73250
  capName: "addons",
72348
73251
  capScope: "system",
@@ -75451,6 +76354,27 @@ Object.freeze({
75451
76354
  access: "view",
75452
76355
  role: "viewer"
75453
76356
  },
76357
+ "groupActive.getStatus": {
76358
+ capName: "group-active",
76359
+ capScope: "device",
76360
+ addonId: null,
76361
+ access: "view",
76362
+ role: "viewer"
76363
+ },
76364
+ "groupCommands.getStatus": {
76365
+ capName: "group-commands",
76366
+ capScope: "device",
76367
+ addonId: null,
76368
+ access: "view",
76369
+ role: "viewer"
76370
+ },
76371
+ "groupStatus.getStatus": {
76372
+ capName: "group-status",
76373
+ capScope: "device",
76374
+ addonId: null,
76375
+ access: "view",
76376
+ role: "viewer"
76377
+ },
75454
76378
  "heatingValve.getStatus": {
75455
76379
  capName: "heating-valve",
75456
76380
  capScope: "device",
@@ -76403,6 +77327,13 @@ Object.freeze({
76403
77327
  access: "create",
76404
77328
  role: "admin"
76405
77329
  },
77330
+ "meter.getStatus": {
77331
+ capName: "meter",
77332
+ capScope: "device",
77333
+ addonId: null,
77334
+ access: "view",
77335
+ role: "viewer"
77336
+ },
76406
77337
  "metricsProvider.collectSnapshot": {
76407
77338
  capName: "metrics-provider",
76408
77339
  capScope: "system",
@@ -84501,7 +85432,39 @@ var APPLIANCE_CAP_VOCABULARY = {
84501
85432
  phrase: t("When {device} finishes", "Quando {device} finisce"),
84502
85433
  icon: "square"
84503
85434
  }
84504
- }
85435
+ },
85436
+ overrides: { byType: {
85437
+ [DeviceType.Washer]: {
85438
+ state: { running: {
85439
+ whenTrue: t("When the washing machine starts", "Quando la lavatrice inizia"),
85440
+ whenFalse: t("When the washing machine has finished", "Quando la lavatrice ha finito")
85441
+ } },
85442
+ events: {
85443
+ onStarted: { phrase: t("When the washing machine starts", "Quando la lavatrice inizia") },
85444
+ onFinished: { phrase: t("When the washing machine has finished", "Quando la lavatrice ha finito") }
85445
+ }
85446
+ },
85447
+ [DeviceType.Dryer]: {
85448
+ state: { running: {
85449
+ whenTrue: t("When the dryer starts", "Quando l'asciugatrice inizia"),
85450
+ whenFalse: t("When the dryer has finished", "Quando l'asciugatrice ha finito")
85451
+ } },
85452
+ events: {
85453
+ onStarted: { phrase: t("When the dryer starts", "Quando l'asciugatrice inizia") },
85454
+ onFinished: { phrase: t("When the dryer has finished", "Quando l'asciugatrice ha finito") }
85455
+ }
85456
+ },
85457
+ [DeviceType.Dishwasher]: {
85458
+ state: { running: {
85459
+ whenTrue: t("When the dishwasher starts", "Quando la lavastoviglie inizia"),
85460
+ whenFalse: t("When the dishwasher has finished", "Quando la lavastoviglie ha finito")
85461
+ } },
85462
+ events: {
85463
+ onStarted: { phrase: t("When the dishwasher starts", "Quando la lavastoviglie inizia") },
85464
+ onFinished: { phrase: t("When the dishwasher has finished", "Quando la lavastoviglie ha finito") }
85465
+ }
85466
+ }
85467
+ } }
84505
85468
  },
84506
85469
  update: {
84507
85470
  scope: "device",
@@ -85273,6 +86236,41 @@ var SENSOR_CAP_VOCABULARY = {
85273
86236
  icon: "flame"
85274
86237
  }]
85275
86238
  },
86239
+ "group-active": {
86240
+ scope: "device",
86241
+ noun: t("Group state", "Stato del gruppo")
86242
+ },
86243
+ "group-commands": {
86244
+ scope: "device",
86245
+ noun: t("Group command", "Comando di gruppo")
86246
+ },
86247
+ "group-status": {
86248
+ scope: "device",
86249
+ noun: t("Group", "Gruppo"),
86250
+ state: [
86251
+ {
86252
+ kind: "numeric",
86253
+ field: "included",
86254
+ quantity: t("the members reporting", "i membri che rispondono"),
86255
+ label: t("Reporting", "Rispondono"),
86256
+ icon: "users"
86257
+ },
86258
+ {
86259
+ kind: "numeric",
86260
+ field: "excluded",
86261
+ quantity: t("the members left out", "i membri esclusi"),
86262
+ label: t("Excluded", "Esclusi"),
86263
+ icon: "users"
86264
+ },
86265
+ {
86266
+ kind: "numeric",
86267
+ field: "total",
86268
+ quantity: t("the member count", "il numero di membri"),
86269
+ label: t("Members", "Membri"),
86270
+ icon: "sigma"
86271
+ }
86272
+ ]
86273
+ },
85276
86274
  "humidity-sensor": {
85277
86275
  scope: "device",
85278
86276
  noun: t("Humidity", "Umidità"),
@@ -85298,6 +86296,17 @@ var SENSOR_CAP_VOCABULARY = {
85298
86296
  }],
85299
86297
  events: { onMotionChanged: { notOperatorFacing: "the `detected` state trigger phrases both edges, from the mirror that survives a dropped event (D49)" } }
85300
86298
  },
86299
+ meter: {
86300
+ scope: "device",
86301
+ noun: t("Meter", "Contatore"),
86302
+ state: [{
86303
+ kind: "numeric",
86304
+ field: "value",
86305
+ quantity: t("the total", "il totale"),
86306
+ label: t("Total", "Totale"),
86307
+ icon: "gauge"
86308
+ }]
86309
+ },
85301
86310
  "numeric-sensor": {
85302
86311
  scope: "device",
85303
86312
  noun: t("Sensor", "Sensore"),
@@ -85306,7 +86315,6 @@ var SENSOR_CAP_VOCABULARY = {
85306
86315
  field: "value",
85307
86316
  quantity: t("the reading", "il valore"),
85308
86317
  label: t("Reading", "Valore"),
85309
- unitField: "unit",
85310
86318
  icon: "gauge"
85311
86319
  }]
85312
86320
  },
@@ -85442,7 +86450,7 @@ var SENSOR_CAP_VOCABULARY = {
85442
86450
  field: "temperature",
85443
86451
  quantity: t("the outdoor temperature", "la temperatura esterna"),
85444
86452
  label: t("Temperature", "Temperatura"),
85445
- unitField: "temperatureUnit",
86453
+ unit: "°C",
85446
86454
  icon: "thermometer"
85447
86455
  },
85448
86456
  {
@@ -85458,7 +86466,7 @@ var SENSOR_CAP_VOCABULARY = {
85458
86466
  field: "windSpeed",
85459
86467
  quantity: t("the wind speed", "la velocità del vento"),
85460
86468
  label: t("Wind", "Vento"),
85461
- unitField: "windSpeedUnit",
86469
+ unit: "m/s",
85462
86470
  icon: "wind"
85463
86471
  },
85464
86472
  {
@@ -85466,7 +86474,7 @@ var SENSOR_CAP_VOCABULARY = {
85466
86474
  field: "pressure",
85467
86475
  quantity: t("the air pressure", "la pressione atmosferica"),
85468
86476
  label: t("Pressure", "Pressione"),
85469
- unitField: "pressureUnit",
86477
+ unit: "hPa",
85470
86478
  icon: "gauge"
85471
86479
  }
85472
86480
  ]
@@ -85771,8 +86779,47 @@ function projectAction(cap, action) {
85771
86779
  };
85772
86780
  }
85773
86781
  Object.entries(CAP_VOCABULARY_BY_NAME).flatMap(([cap, entry]) => entry.scope === "device" ? (entry.actions ?? []).map((a) => projectAction(cap, a)) : []);
85774
- DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher;
86782
+ DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer;
85775
86783
  DeviceFeature.BatteryOperated;
86784
+ DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
86785
+ var HA_AS = "a power sensor (device_class power). Home Assistant has no laundry domain. running-state stays unexported until a null reading can be published as unavailable.";
86786
+ var HOMEKIT_REASON = "HomeKit has no laundry-appliance service. The export tab would pair an accessory with nothing on it: running-state is withheld until a null reading can be unavailable, and power is not a HomeKit service this export honours.";
86787
+ var ALEXA_REASON = "Alexa has no laundry category in this export, and neither power nor running has an Alexa interface.";
86788
+ var GOOGLE_REASON = "Google WASHER, DRYER and DISHWASHER require RunCycle. A power threshold is not that trait, and this export does not publish RunCycle.";
86789
+ var MATTER_REASON = "No Matter export is built. The closest device types are Laundry Washer (0x0073) and Laundry Dryer (0x0074); a power threshold is not the Laundry Washer Mode cluster.";
86790
+ function withheld(reason) {
86791
+ return {
86792
+ [DeviceType.Washer]: {
86793
+ exported: false,
86794
+ reason
86795
+ },
86796
+ [DeviceType.Dryer]: {
86797
+ exported: false,
86798
+ reason
86799
+ },
86800
+ [DeviceType.Dishwasher]: {
86801
+ exported: false,
86802
+ reason
86803
+ }
86804
+ };
86805
+ }
86806
+ function offered(received) {
86807
+ return {
86808
+ [DeviceType.Washer]: {
86809
+ exported: true,
86810
+ as: received
86811
+ },
86812
+ [DeviceType.Dryer]: {
86813
+ exported: true,
86814
+ as: received
86815
+ },
86816
+ [DeviceType.Dishwasher]: {
86817
+ exported: true,
86818
+ as: received
86819
+ }
86820
+ };
86821
+ }
86822
+ offered(HA_AS), withheld(HOMEKIT_REASON), withheld(ALEXA_REASON), withheld(GOOGLE_REASON), withheld(MATTER_REASON);
85776
86823
  /** Reject after `ms`; always clears its own timer. */
85777
86824
  async function withTimeout$1(promise, ms, label) {
85778
86825
  let timer;
@@ -86957,6 +88004,21 @@ Object.freeze({
86957
88004
  form: "single",
86958
88005
  optional: false
86959
88006
  }],
88007
+ "groupActive.getStatus": [{
88008
+ name: "deviceId",
88009
+ form: "single",
88010
+ optional: false
88011
+ }],
88012
+ "groupCommands.getStatus": [{
88013
+ name: "deviceId",
88014
+ form: "single",
88015
+ optional: false
88016
+ }],
88017
+ "groupStatus.getStatus": [{
88018
+ name: "deviceId",
88019
+ form: "single",
88020
+ optional: false
88021
+ }],
86960
88022
  "heatingValve.getStatus": [{
86961
88023
  name: "deviceId",
86962
88024
  form: "single",
@@ -87157,6 +88219,11 @@ Object.freeze({
87157
88219
  form: "single",
87158
88220
  optional: false
87159
88221
  }],
88222
+ "meter.getStatus": [{
88223
+ name: "deviceId",
88224
+ form: "single",
88225
+ optional: false
88226
+ }],
87160
88227
  "motion.getStatus": [{
87161
88228
  name: "deviceId",
87162
88229
  form: "single",
@@ -88764,7 +89831,6 @@ Object.freeze({
88764
89831
  "network-access": "ingress",
88765
89832
  "smtp-provider": "email"
88766
89833
  });
88767
- DeviceType.Camera;
88768
89834
  /**
88769
89835
  * A saved Customize assignment (D936). The schema is the type: callers use
88770
89836
  * `z.infer`, they do not restate the shape.
@@ -88941,6 +90007,8 @@ new Map(Object.entries({
88941
90007
  "detection-blind": "device-events",
88942
90008
  "motion-noisy": "device-events",
88943
90009
  "motion-calm": "device-events",
90010
+ "package-llm-silent": "device-events",
90011
+ "package-llm-answered": "device-events",
88944
90012
  "recording-stalled": "device-events",
88945
90013
  "recording-healthy": "device-events",
88946
90014
  "recording-degraded": "device-events",
@@ -89024,6 +90092,12 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
89024
90092
  label: "Motion without a subject",
89025
90093
  kinds: ["motion-noisy", "motion-calm"]
89026
90094
  },
90095
+ {
90096
+ id: "package-llm",
90097
+ family: "device-events",
90098
+ label: "Package confirm",
90099
+ kinds: ["package-llm-silent", "package-llm-answered"]
90100
+ },
89027
90101
  {
89028
90102
  id: "recording",
89029
90103
  family: "device-events",
@@ -89205,6 +90279,8 @@ var DEVICE_EVENTS = [
89205
90279
  "detection-blind",
89206
90280
  "motion-noisy",
89207
90281
  "motion-calm",
90282
+ "package-llm-silent",
90283
+ "package-llm-answered",
89208
90284
  "recording-stalled",
89209
90285
  "recording-healthy",
89210
90286
  "recording-degraded",
@@ -89473,6 +90549,15 @@ new Map([
89473
90549
  snapshotLabel: "Cameras with constant motion now",
89474
90550
  snapshotSection: null
89475
90551
  },
90552
+ {
90553
+ id: "package-llm-confirm",
90554
+ family: "device-events",
90555
+ label: "Package confirm (not answering / answering again)",
90556
+ bad: ["package-llm-silent"],
90557
+ recovery: ["package-llm-answered"],
90558
+ snapshotLabel: "Cameras whose package confirm is not answering",
90559
+ snapshotSection: null
90560
+ },
89476
90561
  {
89477
90562
  id: "recording-health",
89478
90563
  family: "device-events",