@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.mjs CHANGED
@@ -13,7 +13,7 @@ import { Agent as Agent$1, request as request$1 } from "node:https";
13
13
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
14
14
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
15
15
  //#endregion
16
- //#region ../types/dist/event-category-DHXxB8t9.mjs
16
+ //#region ../types/dist/event-category-CT-hz5Rb.mjs
17
17
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
18
18
  EventCategory["SystemBoot"] = "system.boot";
19
19
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -339,6 +339,14 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
339
339
  /** The recovery edge of {@link PipelineMotionNoisy}: the motion fell back, or a detection arrived. */
340
340
  EventCategory["PipelineMotionCalm"] = "pipeline.motion-calm";
341
341
  /**
342
+ * A camera's package LLM confirm has failed closed three times in a row
343
+ * (D931, 2026-10-26). One edge per camera until
344
+ * {@link PipelinePackageLlmAnswered}.
345
+ */
346
+ EventCategory["PipelinePackageLlmSilent"] = "pipeline.package-llm-silent";
347
+ /** The recovery edge of {@link PipelinePackageLlmSilent}: a confirm returned yes or no. */
348
+ EventCategory["PipelinePackageLlmAnswered"] = "pipeline.package-llm-answered";
349
+ /**
342
350
  * Per-camera pipeline config was mutated by the orchestrator
343
351
  * (a settings change via `setAgentInferenceDevices` /
344
352
  * `setCameraStepToggle` / `setCameraStepSettings`). Orchestrator
@@ -5448,7 +5456,7 @@ var ZodIssueCode = {
5448
5456
  var ZodFirstPartyTypeKind;
5449
5457
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5450
5458
  //#endregion
5451
- //#region ../types/dist/sleep-BErAxhul.mjs
5459
+ //#region ../types/dist/sleep--jXS9hWo.mjs
5452
5460
  /**
5453
5461
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5454
5462
  * window to float samples (D455).
@@ -8002,6 +8010,99 @@ var RecordKindDeclarationSchema = object({
8002
8010
  }).strict();
8003
8011
  /** The kind names: lower-case, dash separated, short enough for an index name. */
8004
8012
  var RecordKindNameSchema = string().regex(/^[a-z][a-z0-9-]{0,47}$/);
8013
+ var READING_QUANTITIES = [
8014
+ "temperature",
8015
+ "pressure",
8016
+ "speed",
8017
+ "precipitation",
8018
+ "precipitation-rate",
8019
+ "length",
8020
+ "area",
8021
+ "illuminance",
8022
+ "irradiance",
8023
+ "power",
8024
+ "energy",
8025
+ "voltage",
8026
+ "current",
8027
+ "apparent-power",
8028
+ "humidity",
8029
+ "percentage",
8030
+ "concentration-volume",
8031
+ "concentration-mass",
8032
+ "concentration-ppb",
8033
+ "volume",
8034
+ "duration",
8035
+ "duration-ms",
8036
+ "information",
8037
+ "sound-level",
8038
+ "signal-level",
8039
+ "colour-temperature",
8040
+ "angle",
8041
+ "bitrate",
8042
+ "rate",
8043
+ "mass",
8044
+ "index",
8045
+ "ratio",
8046
+ "count",
8047
+ "none",
8048
+ "device"
8049
+ ];
8050
+ var ReadingQuantitySchema = _enum(READING_QUANTITIES);
8051
+ new Set(READING_QUANTITIES);
8052
+ /**
8053
+ * Stored unit symbol for a quantity. `none` means the number is dimensionless
8054
+ * (or an index / ratio / count). `device` means the cap has no single unit.
8055
+ */
8056
+ var QUANTITY_BASE = {
8057
+ temperature: "°C",
8058
+ pressure: "hPa",
8059
+ speed: "m/s",
8060
+ precipitation: "mm",
8061
+ "precipitation-rate": "mm/h",
8062
+ length: "m",
8063
+ area: "m²",
8064
+ illuminance: "lx",
8065
+ irradiance: "W/m²",
8066
+ power: "W",
8067
+ energy: "kWh",
8068
+ voltage: "V",
8069
+ current: "A",
8070
+ "apparent-power": "VA",
8071
+ humidity: "%",
8072
+ percentage: "%",
8073
+ "concentration-volume": "ppm",
8074
+ "concentration-mass": "µg/m³",
8075
+ "concentration-ppb": "ppb",
8076
+ volume: "L",
8077
+ duration: "s",
8078
+ "duration-ms": "ms",
8079
+ information: "B",
8080
+ "sound-level": "dBFS",
8081
+ "signal-level": "dBm",
8082
+ "colour-temperature": "mired",
8083
+ angle: "°",
8084
+ bitrate: "kbps",
8085
+ rate: "fps",
8086
+ mass: "kg",
8087
+ index: "none",
8088
+ ratio: "none",
8089
+ count: "none",
8090
+ none: "none",
8091
+ device: "device"
8092
+ };
8093
+ /** The stored unit, or `undefined` when the quantity has no unit symbol. */
8094
+ function baseUnitOf(quantity) {
8095
+ const symbol = QUANTITY_BASE[quantity];
8096
+ if (symbol === "none" || symbol === "device") return void 0;
8097
+ return symbol;
8098
+ }
8099
+ function readingMeta(quantity, extras) {
8100
+ return {
8101
+ quantity,
8102
+ ...extras?.precision !== void 0 ? { precision: extras.precision } : {},
8103
+ ...extras?.label !== void 0 ? { label: extras.label } : {}
8104
+ };
8105
+ }
8005
8106
  /** Shared Zod schemas used across streaming capabilities. */
8006
8107
  var CamProfileSchema = _enum([
8007
8108
  "high",
@@ -8029,8 +8130,8 @@ var CamStreamKindSchema = _enum([
8029
8130
  "derived"
8030
8131
  ]);
8031
8132
  var CamStreamResolutionSchema = object({
8032
- width: number().int().positive(),
8033
- height: number().int().positive()
8133
+ width: number().int().positive().meta(readingMeta("none")),
8134
+ height: number().int().positive().meta(readingMeta("none"))
8034
8135
  });
8035
8136
  var CameraStreamSchema = object({
8036
8137
  /** Stable, provider-assigned id unique within the (deviceId) scope. */
@@ -8560,6 +8661,9 @@ var CAP_NAMES = Object.freeze([
8560
8661
  "filesystem-browse",
8561
8662
  "flood",
8562
8663
  "gas",
8664
+ "group-active",
8665
+ "group-commands",
8666
+ "group-status",
8563
8667
  "heating-valve",
8564
8668
  "humidifier",
8565
8669
  "humidity-sensor",
@@ -8580,6 +8684,7 @@ var CAP_NAMES = Object.freeze([
8580
8684
  "login-method",
8581
8685
  "media-player",
8582
8686
  "mesh-network",
8687
+ "meter",
8583
8688
  "metrics-provider",
8584
8689
  "model-convert",
8585
8690
  "model-distributor",
@@ -8689,14 +8794,6 @@ Object.freeze({
8689
8794
  {
8690
8795
  "path": "aqi",
8691
8796
  "valueType": "number"
8692
- },
8693
- {
8694
- "path": "unit",
8695
- "valueType": "string"
8696
- },
8697
- {
8698
- "path": "precision",
8699
- "valueType": "number"
8700
8797
  }
8701
8798
  ],
8702
8799
  "alarm-panel": [
@@ -8732,20 +8829,10 @@ Object.freeze({
8732
8829
  "valueType": "boolean"
8733
8830
  }
8734
8831
  ],
8735
- "ambient-light-sensor": [
8736
- {
8737
- "path": "lux",
8738
- "valueType": "number"
8739
- },
8740
- {
8741
- "path": "unit",
8742
- "valueType": "string"
8743
- },
8744
- {
8745
- "path": "precision",
8746
- "valueType": "number"
8747
- }
8748
- ],
8832
+ "ambient-light-sensor": [{
8833
+ "path": "lux",
8834
+ "valueType": "number"
8835
+ }],
8749
8836
  "audio-metrics": [
8750
8837
  {
8751
8838
  "path": "ts",
@@ -8825,6 +8912,10 @@ Object.freeze({
8825
8912
  "path": "lastUpdated",
8826
8913
  "valueType": "number"
8827
8914
  },
8915
+ {
8916
+ "path": "volts",
8917
+ "valueType": "number"
8918
+ },
8828
8919
  {
8829
8920
  "path": "lastContactAt",
8830
8921
  "valueType": "number"
@@ -9067,10 +9158,6 @@ Object.freeze({
9067
9158
  "datetime"
9068
9159
  ]
9069
9160
  },
9070
- {
9071
- "path": "unit",
9072
- "valueType": "string"
9073
- },
9074
9161
  {
9075
9162
  "path": "min",
9076
9163
  "valueType": "number"
@@ -9082,19 +9169,6 @@ Object.freeze({
9082
9169
  {
9083
9170
  "path": "step",
9084
9171
  "valueType": "number"
9085
- },
9086
- {
9087
- "path": "precision",
9088
- "valueType": "number"
9089
- },
9090
- {
9091
- "path": "format",
9092
- "valueType": "enum",
9093
- "enumValues": [
9094
- "date",
9095
- "time",
9096
- "datetime"
9097
- ]
9098
9172
  }
9099
9173
  ],
9100
9174
  "cover": [
@@ -9335,13 +9409,8 @@ Object.freeze({
9335
9409
  "path": "value",
9336
9410
  "valueType": "string"
9337
9411
  }, {
9338
- "path": "format",
9339
- "valueType": "enum",
9340
- "enumValues": [
9341
- "date",
9342
- "time",
9343
- "datetime"
9344
- ]
9412
+ "path": "timestamp",
9413
+ "valueType": "boolean"
9345
9414
  }],
9346
9415
  "event-emitter": [
9347
9416
  {
@@ -9414,6 +9483,24 @@ Object.freeze({
9414
9483
  "path": "detected",
9415
9484
  "valueType": "boolean"
9416
9485
  }],
9486
+ "group-active": [{
9487
+ "path": "active",
9488
+ "valueType": "boolean"
9489
+ }],
9490
+ "group-status": [
9491
+ {
9492
+ "path": "included",
9493
+ "valueType": "number"
9494
+ },
9495
+ {
9496
+ "path": "excluded",
9497
+ "valueType": "number"
9498
+ },
9499
+ {
9500
+ "path": "total",
9501
+ "valueType": "number"
9502
+ }
9503
+ ],
9417
9504
  "heating-valve": [{
9418
9505
  "path": "position",
9419
9506
  "valueType": "number"
@@ -9448,20 +9535,10 @@ Object.freeze({
9448
9535
  "valueType": "number"
9449
9536
  }
9450
9537
  ],
9451
- "humidity-sensor": [
9452
- {
9453
- "path": "percent",
9454
- "valueType": "number"
9455
- },
9456
- {
9457
- "path": "unit",
9458
- "valueType": "string"
9459
- },
9460
- {
9461
- "path": "precision",
9462
- "valueType": "number"
9463
- }
9464
- ],
9538
+ "humidity-sensor": [{
9539
+ "path": "percent",
9540
+ "valueType": "number"
9541
+ }],
9465
9542
  "image": [{
9466
9543
  "path": "url",
9467
9544
  "valueType": "string"
@@ -9669,6 +9746,10 @@ Object.freeze({
9669
9746
  ]
9670
9747
  }
9671
9748
  ],
9749
+ "meter": [{
9750
+ "path": "value",
9751
+ "valueType": "number"
9752
+ }],
9672
9753
  "motion": [
9673
9754
  {
9674
9755
  "path": "detected",
@@ -9800,20 +9881,10 @@ Object.freeze({
9800
9881
  "valueType": "boolean"
9801
9882
  }
9802
9883
  ],
9803
- "numeric-sensor": [
9804
- {
9805
- "path": "value",
9806
- "valueType": "number"
9807
- },
9808
- {
9809
- "path": "unit",
9810
- "valueType": "string"
9811
- },
9812
- {
9813
- "path": "precision",
9814
- "valueType": "number"
9815
- }
9816
- ],
9884
+ "numeric-sensor": [{
9885
+ "path": "value",
9886
+ "valueType": "number"
9887
+ }],
9817
9888
  "pet-feeder": [
9818
9889
  {
9819
9890
  "path": "foodLevel",
@@ -9905,14 +9976,6 @@ Object.freeze({
9905
9976
  {
9906
9977
  "path": "powerFactor",
9907
9978
  "valueType": "number"
9908
- },
9909
- {
9910
- "path": "unit",
9911
- "valueType": "string"
9912
- },
9913
- {
9914
- "path": "precision",
9915
- "valueType": "number"
9916
9979
  }
9917
9980
  ],
9918
9981
  "presence": [
@@ -9941,20 +10004,10 @@ Object.freeze({
9941
10004
  "valueType": "number"
9942
10005
  }
9943
10006
  ],
9944
- "pressure-sensor": [
9945
- {
9946
- "path": "hpa",
9947
- "valueType": "number"
9948
- },
9949
- {
9950
- "path": "unit",
9951
- "valueType": "string"
9952
- },
9953
- {
9954
- "path": "precision",
9955
- "valueType": "number"
9956
- }
9957
- ],
10007
+ "pressure-sensor": [{
10008
+ "path": "hpa",
10009
+ "valueType": "number"
10010
+ }],
9958
10011
  "privacy-mask": [{
9959
10012
  "path": "enabled",
9960
10013
  "valueType": "boolean"
@@ -10265,20 +10318,10 @@ Object.freeze({
10265
10318
  "path": "tampered",
10266
10319
  "valueType": "boolean"
10267
10320
  }],
10268
- "temperature-sensor": [
10269
- {
10270
- "path": "celsius",
10271
- "valueType": "number"
10272
- },
10273
- {
10274
- "path": "unit",
10275
- "valueType": "string"
10276
- },
10277
- {
10278
- "path": "precision",
10279
- "valueType": "number"
10280
- }
10281
- ],
10321
+ "temperature-sensor": [{
10322
+ "path": "celsius",
10323
+ "valueType": "number"
10324
+ }],
10282
10325
  "update": [
10283
10326
  {
10284
10327
  "path": "currentVersion",
@@ -10389,10 +10432,6 @@ Object.freeze({
10389
10432
  "path": "temperature",
10390
10433
  "valueType": "number"
10391
10434
  },
10392
- {
10393
- "path": "temperatureUnit",
10394
- "valueType": "string"
10395
- },
10396
10435
  {
10397
10436
  "path": "humidity",
10398
10437
  "valueType": "number"
@@ -10401,18 +10440,10 @@ Object.freeze({
10401
10440
  "path": "pressure",
10402
10441
  "valueType": "number"
10403
10442
  },
10404
- {
10405
- "path": "pressureUnit",
10406
- "valueType": "string"
10407
- },
10408
10443
  {
10409
10444
  "path": "windSpeed",
10410
10445
  "valueType": "number"
10411
10446
  },
10412
- {
10413
- "path": "windSpeedUnit",
10414
- "valueType": "string"
10415
- },
10416
10447
  {
10417
10448
  "path": "windBearing",
10418
10449
  "valueType": "number"
@@ -10476,7 +10507,7 @@ function userError(code, params, englishFallback) {
10476
10507
  return new CamstackError(code, params, englishFallback);
10477
10508
  }
10478
10509
  //#endregion
10479
- //#region ../types/dist/err-msg-BXKzRBwg.mjs
10510
+ //#region ../types/dist/err-msg-DIorGYeC.mjs
10480
10511
  var DeviceType = /* @__PURE__ */ function(DeviceType) {
10481
10512
  DeviceType["Camera"] = "camera";
10482
10513
  DeviceType["Hub"] = "hub";
@@ -10570,8 +10601,14 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
10570
10601
  DeviceType["PetFeeder"] = "pet-feeder";
10571
10602
  /** Built-in dishwasher — program lifecycle, door / remote-start gates,
10572
10603
  * salt and rinse-aid levels. Installed with the `dishwasher` cap.
10573
- * Sources: native Bosch Home Connect, reusable by similar integrations. */
10604
+ * Sources: native Bosch Home Connect, reusable by similar integrations.
10605
+ * A plug-built dishwasher carries running-state and power instead. */
10574
10606
  DeviceType["Dishwasher"] = "dishwasher";
10607
+ /** Washing machine. A plug-built one is running while its power stays
10608
+ * above a threshold. No program cap — that surface is the dishwasher's. */
10609
+ DeviceType["Washer"] = "washer";
10610
+ /** Tumble dryer. Same plug-built running surface as {@link Washer}. */
10611
+ DeviceType["Dryer"] = "dryer";
10575
10612
  return DeviceType;
10576
10613
  }({});
10577
10614
  var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
@@ -10819,7 +10856,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
10819
10856
  return DeviceRole;
10820
10857
  }({});
10821
10858
  //#endregion
10822
- //#region ../types/dist/composition-kEl9mevu.mjs
10859
+ //#region ../types/dist/composition-Bb8iwHEJ.mjs
10823
10860
  /**
10824
10861
  * The ffmpeg build every CamStack node downloads, per platform and arch.
10825
10862
  *
@@ -11134,6 +11171,13 @@ var table = {
11134
11171
  apply: () => {
11135
11172
  throw new ExpressionEvalError("latchedAt: stateful evaluation context is required");
11136
11173
  }
11174
+ },
11175
+ schmitt: {
11176
+ minArgs: 3,
11177
+ maxArgs: 5,
11178
+ apply: () => {
11179
+ throw new ExpressionEvalError("schmitt: stateful evaluation context is required");
11180
+ }
11137
11181
  }
11138
11182
  };
11139
11183
  Object.freeze(Object.assign(Object.create(null), table));
@@ -11574,15 +11618,232 @@ function validateExpressionSource(src) {
11574
11618
  }
11575
11619
  return null;
11576
11620
  }
11577
- /** A composed device's stableId is this prefix plus the block id. */
11578
- var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
11579
- /** Longest snippet a `code` source may carry (slice 4). */
11580
- var MAX_COMPOSITION_CODE_LENGTH = 2e4;
11621
+ /**
11622
+ * One power reading becomes a washer, dryer or dishwasher (D944 helper).
11623
+ *
11624
+ * Standby of the control board is under 5 W; a motor or a heater is far
11625
+ * above that, so 5 W is the line. A door lock or a short pump spike is not
11626
+ * a cycle, so running starts only after 30 s above the line.
11627
+ *
11628
+ * A wash, dry or dishwasher pause (soak, heat-wait, heater off between
11629
+ * bursts) lasts several minutes. Ending the cycle on the first dip would
11630
+ * report "finished" in the middle of the program, so the stop dwell is
11631
+ * 10 minutes on every type. The number is stored per type so one machine
11632
+ * can move later without moving the others.
11633
+ */
11634
+ var APPLIANCE_TEMPLATE_ID = "appliance";
11635
+ var APPLIANCE_KINDS = [
11636
+ "washer",
11637
+ "dryer",
11638
+ "dishwasher"
11639
+ ];
11640
+ DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
11641
+ /**
11642
+ * Statistics and integrals over a history read (D944).
11643
+ *
11644
+ * Pure: the same points always give the same answer, so a restart recomputes
11645
+ * rather than trusting a buffer. A gauge mean is time-weighted (value × ms),
11646
+ * never the mean of the samples. A hole with no held value is not integrated
11647
+ * as zero. A truncated read is not published.
11648
+ */
11649
+ var STATISTIC_STATS = [
11650
+ "min",
11651
+ "max",
11652
+ "mean",
11653
+ "sum",
11654
+ "count",
11655
+ "change"
11656
+ ];
11657
+ /**
11658
+ * The range a statistics or integral helper asks history for (D944).
11659
+ *
11660
+ * Calendar edges are the hub's timezone, never UTC midnight: a day is 23, 24
11661
+ * or 25 hours across a DST change. A tier is eligible only when its retention
11662
+ * is strictly longer than the longest that range can be. Forever qualifies.
11663
+ * Equal to a tier's retention is a refusal, not a short answer.
11664
+ */
11665
+ var MINUTE_MS = 6e4;
11666
+ var HOUR_MS = 60 * MINUTE_MS;
11667
+ var DAY_MS = 24 * HOUR_MS;
11668
+ var ROLLING_SPANS = [
11669
+ "1h",
11670
+ "24h",
11671
+ "2d",
11672
+ "7d",
11673
+ "30d",
11674
+ "custom"
11675
+ ];
11676
+ var CALENDAR_PERIODS = [
11677
+ "today",
11678
+ "yesterday",
11679
+ "this-week",
11680
+ "this-month"
11681
+ ];
11682
+ var RESET_PERIODS = [
11683
+ "never",
11684
+ "daily",
11685
+ "weekly",
11686
+ "monthly"
11687
+ ];
11688
+ 5 * MINUTE_MS;
11689
+ 24 * HOUR_MS, 2 * DAY_MS, 7 * DAY_MS, 30 * DAY_MS;
11690
+ 7 * DAY_MS, 30 * DAY_MS, 365 * DAY_MS;
11691
+ var rollingWindowObject = object({
11692
+ kind: literal("rolling"),
11693
+ span: _enum(ROLLING_SPANS),
11694
+ customMinutes: number().int().min(5).optional()
11695
+ }).check((payload) => {
11696
+ if (payload.value.span === "custom" && payload.value.customMinutes === void 0) payload.issues.push({
11697
+ code: "custom",
11698
+ message: "a custom range needs a duration in minutes",
11699
+ path: ["customMinutes"],
11700
+ input: payload.value
11701
+ });
11702
+ if (payload.value.span !== "custom" && payload.value.customMinutes !== void 0) payload.issues.push({
11703
+ code: "custom",
11704
+ message: "only a custom range carries a duration",
11705
+ path: ["customMinutes"],
11706
+ input: payload.value
11707
+ });
11708
+ });
11709
+ var RollingWindowSchema = rollingWindowObject;
11710
+ var StatisticWindowSchema = discriminatedUnion("kind", [rollingWindowObject, object({
11711
+ kind: literal("calendar"),
11712
+ period: _enum(CALENDAR_PERIODS)
11713
+ })]);
11714
+ /**
11715
+ * A composition source identity: `(addonId, stableId)`, never a numeric device
11716
+ * id. Split out so helper schemas can name it without a cycle through
11717
+ * `composition.ts` (D659).
11718
+ */
11581
11719
  var CompositionSourceRefSchema = object({
11582
11720
  /** The owning addon; `stableId` is unique only within it. */
11583
11721
  addonId: string().min(1),
11584
11722
  stableId: string().min(1)
11585
11723
  });
11724
+ var GROUP_TEMPLATE_IDS = [
11725
+ "temperature",
11726
+ "humidity",
11727
+ "pressure",
11728
+ "illuminance",
11729
+ "power",
11730
+ "energy",
11731
+ "battery",
11732
+ "numeric",
11733
+ "motion",
11734
+ "contact",
11735
+ "leak",
11736
+ "smoke",
11737
+ "occupancy",
11738
+ "binary",
11739
+ "switch",
11740
+ "light",
11741
+ "fan",
11742
+ "cover",
11743
+ "valve",
11744
+ "lock",
11745
+ "media-player",
11746
+ "climate"
11747
+ ];
11748
+ var NUMERIC_AGGREGATES = [
11749
+ "mean",
11750
+ "median",
11751
+ "min",
11752
+ "max",
11753
+ "sum"
11754
+ ];
11755
+ var BINARY_AGGREGATES = ["any", "all"];
11756
+ /** How an actuator group decides it is on. Unknown members never count as off. */
11757
+ var ACTIVE_CRITERIA = ["at-least-one", "all"];
11758
+ var AGGREGATE_REDUCERS = [
11759
+ "mean",
11760
+ "median",
11761
+ "min",
11762
+ "max",
11763
+ "sum",
11764
+ "any",
11765
+ "all"
11766
+ ];
11767
+ var GroupTemplateIdSchema = _enum(GROUP_TEMPLATE_IDS);
11768
+ var AggregateReducerSchema = _enum(AGGREGATE_REDUCERS);
11769
+ var ActiveCriterionSchema = _enum(ACTIVE_CRITERIA);
11770
+ /** One member. The field is stored so occupancy can name motion or binary. */
11771
+ var HelperMemberSchema = object({
11772
+ source: CompositionSourceRefSchema,
11773
+ cap: string().min(1),
11774
+ fieldPath: string().min(1)
11775
+ });
11776
+ var HelperSpecSchema = discriminatedUnion("kind", [
11777
+ object({
11778
+ kind: literal("group"),
11779
+ templateId: GroupTemplateIdSchema,
11780
+ aggregate: AggregateReducerSchema,
11781
+ members: array(HelperMemberSchema).min(1).max(64),
11782
+ /** Actuator groups only. Readings leave this unset. */
11783
+ active: ActiveCriterionSchema.optional()
11784
+ }),
11785
+ object({
11786
+ kind: literal("appliance"),
11787
+ templateId: literal(APPLIANCE_TEMPLATE_ID),
11788
+ appliance: _enum(APPLIANCE_KINDS),
11789
+ thresholdWatts: number().positive(),
11790
+ startDwellMs: number().int().nonnegative(),
11791
+ stopDwellMs: number().int().nonnegative(),
11792
+ member: HelperMemberSchema
11793
+ }),
11794
+ object({
11795
+ kind: literal("statistic"),
11796
+ stat: _enum(STATISTIC_STATS),
11797
+ window: StatisticWindowSchema,
11798
+ source: HelperMemberSchema
11799
+ }),
11800
+ object({
11801
+ kind: literal("integral"),
11802
+ reset: _enum(RESET_PERIODS),
11803
+ output: _enum(["energy", "meter"]),
11804
+ source: HelperMemberSchema
11805
+ }),
11806
+ object({
11807
+ kind: literal("threshold"),
11808
+ source: HelperMemberSchema,
11809
+ high: number(),
11810
+ low: number(),
11811
+ onForMs: number().int().nonnegative(),
11812
+ offForMs: number().int().nonnegative()
11813
+ }),
11814
+ object({
11815
+ kind: literal("arithmetic"),
11816
+ op: _enum([
11817
+ "sum",
11818
+ "difference",
11819
+ "ratio"
11820
+ ]),
11821
+ inputs: array(HelperMemberSchema).min(2).max(64)
11822
+ }),
11823
+ object({
11824
+ kind: literal("expression"),
11825
+ expr: string().min(1),
11826
+ inputs: array(object({
11827
+ name: string().min(1),
11828
+ member: HelperMemberSchema
11829
+ })).min(1).max(64),
11830
+ output: _enum(["number", "boolean"])
11831
+ }),
11832
+ object({
11833
+ kind: literal("derivative"),
11834
+ window: RollingWindowSchema,
11835
+ per: _enum([
11836
+ "second",
11837
+ "minute",
11838
+ "hour"
11839
+ ]),
11840
+ source: HelperMemberSchema
11841
+ })
11842
+ ]);
11843
+ /** A composed device's stableId is this prefix plus the block id. */
11844
+ var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
11845
+ /** Longest snippet a `code` source may carry (slice 4). */
11846
+ var MAX_COMPOSITION_CODE_LENGTH = 2e4;
11586
11847
  /** One field of one capability of one source device. */
11587
11848
  var CompositionFieldReadSchema = object({
11588
11849
  source: CompositionSourceRefSchema,
@@ -11626,7 +11887,59 @@ var CompositionCodeSourceSchema = object({
11626
11887
  var CompositionFieldSourceSchema = discriminatedUnion("kind", [
11627
11888
  CompositionFromSourceSchema,
11628
11889
  CompositionExpressionSourceSchema,
11629
- CompositionCodeSourceSchema
11890
+ CompositionCodeSourceSchema,
11891
+ object({
11892
+ kind: literal("aggregate"),
11893
+ reducer: _enum([
11894
+ "mean",
11895
+ "median",
11896
+ "min",
11897
+ "max",
11898
+ "sum",
11899
+ "any",
11900
+ "all"
11901
+ ]),
11902
+ reads: array(CompositionFieldReadSchema).min(1).max(64),
11903
+ /**
11904
+ * Set when the reads are an enum state, not a yes/no: the listed states
11905
+ * count as active (a cover is `open`). A state outside the list is inactive;
11906
+ * a read that is not a state at all is left out. Only `any` / `all` use it.
11907
+ */
11908
+ activeWhen: array(string().min(1)).min(1).optional(),
11909
+ /** `value` is the reading; the others are the member counts. */
11910
+ publish: _enum([
11911
+ "value",
11912
+ "included",
11913
+ "excluded",
11914
+ "total"
11915
+ ]),
11916
+ /** What a `value` publish does when nobody is included. Counts ignore this. */
11917
+ empty: _enum([
11918
+ "null",
11919
+ "omit",
11920
+ "offline"
11921
+ ])
11922
+ }),
11923
+ object({
11924
+ kind: literal("series"),
11925
+ read: CompositionFieldReadSchema,
11926
+ /** `value` is the statistic or the integral. The others are the gap counts. */
11927
+ publish: _enum([
11928
+ "value",
11929
+ "included",
11930
+ "excluded",
11931
+ "total"
11932
+ ]),
11933
+ /**
11934
+ * What an unanswered `value` does. Counts ignore this. `offline` leaves the
11935
+ * device unseeded until history answers, so a restart cannot publish 0.
11936
+ */
11937
+ empty: _enum([
11938
+ "null",
11939
+ "omit",
11940
+ "offline"
11941
+ ])
11942
+ })
11630
11943
  ]);
11631
11944
  var CompositionCommandTargetSchema = discriminatedUnion("kind", [object({
11632
11945
  kind: literal("forward"),
@@ -11672,7 +11985,13 @@ var CompositionSchema = object({
11672
11985
  kind: literal("existing"),
11673
11986
  device: CompositionSourceRefSchema
11674
11987
  })]),
11675
- features: array(CompositionFeatureSchema).min(1).max(16)
11988
+ features: array(CompositionFeatureSchema).min(1).max(16),
11989
+ /**
11990
+ * Present when the block is a helper template. Absent on a free
11991
+ * composition (the room example, device 4603). The editor reads this,
11992
+ * never the compiled features.
11993
+ */
11994
+ helper: HelperSpecSchema.optional()
11676
11995
  }).superRefine((composition, ctx) => {
11677
11996
  const seen = /* @__PURE__ */ new Set();
11678
11997
  composition.features.forEach((feature, index) => {
@@ -17098,7 +17417,22 @@ var BrokerProviderInfoSchema = object({
17098
17417
  */
17099
17418
  interactiveConnectPath: string().min(1).optional(),
17100
17419
  /** Relative hub path to disconnect the linked account (same popup pattern). */
17101
- interactiveDisconnectPath: string().min(1).optional()
17420
+ interactiveDisconnectPath: string().min(1).optional(),
17421
+ /**
17422
+ * The kind signs in through a server-held interactive session instead of
17423
+ * (or before) typed credentials. `basePath` is a hub-relative route set
17424
+ * served by the owning addon (`/addon/<id>/...`) speaking the sign-in
17425
+ * contract: `POST {basePath}/start` (body: the form's settings) answers
17426
+ * `{ sessionId, loginUrl }`; `GET {basePath}/status?sessionId=` answers
17427
+ * `{ phase: 'starting' | 'awaiting-login' | 'captured' | 'error' |
17428
+ * 'cancelled', loginUrl, error }`; `POST {basePath}/commit`
17429
+ * (`{ sessionId, name, brokerId? }`) stores the credentials on a new or
17430
+ * existing broker and answers `{ brokerId }`; `POST {basePath}/cancel`
17431
+ * (`{ sessionId }`) drops the session. The dialog that edits a broker
17432
+ * offers it as the default path; the fields the session fills are
17433
+ * marked `filledBySignIn` in the kind's settings schema.
17434
+ */
17435
+ signIn: object({ basePath: string().min(1) }).optional()
17102
17436
  }))
17103
17437
  });
17104
17438
  var ListInputSchema = object({
@@ -18199,7 +18533,12 @@ var CompositionProblemSchema = object({
18199
18533
  "item-field-reserved",
18200
18534
  "target-missing",
18201
18535
  "target-unreadable",
18202
- "not-replaceable"
18536
+ "not-replaceable",
18537
+ "native-capability-replace",
18538
+ "mixed-quantity",
18539
+ "helper-mismatch",
18540
+ "member-constraint",
18541
+ "retention"
18203
18542
  ]),
18204
18543
  path: string(),
18205
18544
  message: string()
@@ -18220,7 +18559,8 @@ var CompositionUnavailableModeSchema = _enum([
18220
18559
  "null",
18221
18560
  "offline",
18222
18561
  "unknown",
18223
- "release"
18562
+ "release",
18563
+ "omit"
18224
18564
  ]);
18225
18565
  /**
18226
18566
  * `derived` reads a source · `clock` reads only `now`, recomputed when a sibling
@@ -18257,9 +18597,11 @@ var CompositionFieldPlanSchema = object({
18257
18597
  reads: array(CompositionFieldReadSchema)
18258
18598
  });
18259
18599
  /**
18260
- * What a feature does to its target (D663): `new` builds a capability on a new
18261
- * device; on an existing device it `add`s a capability the device lacks, or
18262
- * `replace`s named fields of one it has natively.
18600
+ * What a feature does to its target (D663, D944): `new` builds a capability on a
18601
+ * new device; on an existing device it `add`s a capability the device lacks.
18602
+ * Replacing a capability the device already serves is refused
18603
+ * (`native-capability-replace`), not planned. `replace` remains on the claim
18604
+ * wire for a claim the hub already holds.
18263
18605
  */
18264
18606
  var CompositionFeatureModeSchema = _enum([
18265
18607
  "new",
@@ -18430,8 +18772,392 @@ Object.freeze({
18430
18772
  latchedAt: {
18431
18773
  kind: "fixed",
18432
18774
  result: ["number", "null"]
18775
+ },
18776
+ schmitt: {
18777
+ kind: "fixed",
18778
+ result: ["boolean", "null"]
18433
18779
  }
18434
18780
  });
18781
+ /**
18782
+ * One catalog row per base reading a group helper can build (D944 §3).
18783
+ * Data, not a form default written into the block.
18784
+ */
18785
+ var NOW$2 = {
18786
+ fieldPath: "lastFetchedAt",
18787
+ expr: "now"
18788
+ };
18789
+ var CHANGED = {
18790
+ fieldPath: "lastChangedAt",
18791
+ expr: "now"
18792
+ };
18793
+ function numeric(input) {
18794
+ return {
18795
+ ...input,
18796
+ family: "numeric",
18797
+ deviceType: DeviceType.Sensor,
18798
+ memberDeviceType: DeviceType.Sensor,
18799
+ memberDeviceTypes: [DeviceType.Sensor],
18800
+ activeWhen: void 0,
18801
+ commandCaps: [],
18802
+ baseUnit: baseUnitOf(input.quantity),
18803
+ aggregates: NUMERIC_AGGREGATES,
18804
+ accept: [{
18805
+ cap: input.outputCap,
18806
+ fieldPath: input.outputField
18807
+ }]
18808
+ };
18809
+ }
18810
+ function binary(input) {
18811
+ return {
18812
+ ...input,
18813
+ family: "binary",
18814
+ deviceType: DeviceType.Sensor,
18815
+ memberDeviceType: DeviceType.Sensor,
18816
+ memberDeviceTypes: [DeviceType.Sensor],
18817
+ activeWhen: void 0,
18818
+ commandCaps: [],
18819
+ quantity: "none",
18820
+ baseUnit: void 0,
18821
+ aggregates: BINARY_AGGREGATES,
18822
+ empty: "offline"
18823
+ };
18824
+ }
18825
+ var GROUP_TEMPLATES = [
18826
+ numeric({
18827
+ id: "temperature",
18828
+ summary: "Mean, median, min, max or sum of temperatures. Offline and unknown members are left out, never read as 0 °C.",
18829
+ role: DeviceRole.TemperatureSensor,
18830
+ outputCap: "temperature-sensor",
18831
+ outputField: "celsius",
18832
+ quantity: "temperature",
18833
+ defaultAggregate: "mean",
18834
+ empty: "null",
18835
+ companions: [NOW$2]
18836
+ }),
18837
+ numeric({
18838
+ id: "humidity",
18839
+ summary: "Humidity in percent. Offline and unknown members are left out, never read as 0 %.",
18840
+ role: DeviceRole.HumiditySensor,
18841
+ outputCap: "humidity-sensor",
18842
+ outputField: "percent",
18843
+ quantity: "humidity",
18844
+ defaultAggregate: "mean",
18845
+ empty: "null",
18846
+ companions: [NOW$2]
18847
+ }),
18848
+ numeric({
18849
+ id: "pressure",
18850
+ summary: "Pressure in hectopascals. Offline and unknown members are left out, never read as 0 hPa.",
18851
+ role: DeviceRole.PressureSensor,
18852
+ outputCap: "pressure-sensor",
18853
+ outputField: "hpa",
18854
+ quantity: "pressure",
18855
+ defaultAggregate: "mean",
18856
+ empty: "null",
18857
+ companions: [NOW$2]
18858
+ }),
18859
+ numeric({
18860
+ id: "illuminance",
18861
+ summary: "Illuminance in lux. Offline and unknown members are left out, never read as 0 lx.",
18862
+ role: DeviceRole.AmbientLightSensor,
18863
+ outputCap: "ambient-light-sensor",
18864
+ outputField: "lux",
18865
+ quantity: "illuminance",
18866
+ defaultAggregate: "mean",
18867
+ empty: "null",
18868
+ companions: [NOW$2]
18869
+ }),
18870
+ numeric({
18871
+ id: "power",
18872
+ summary: "Power in watts, summed by default. Nobody reporting omits the key rather than writing 0 W.",
18873
+ role: DeviceRole.PowerSensor,
18874
+ outputCap: "power-meter",
18875
+ outputField: "watts",
18876
+ quantity: "power",
18877
+ defaultAggregate: "sum",
18878
+ empty: "omit",
18879
+ companions: [NOW$2]
18880
+ }),
18881
+ numeric({
18882
+ id: "energy",
18883
+ summary: "Energy in kilowatt-hours, summed by default. Nobody reporting omits the key rather than writing 0 kWh.",
18884
+ role: DeviceRole.EnergySensor,
18885
+ outputCap: "power-meter",
18886
+ outputField: "kwhTotal",
18887
+ quantity: "energy",
18888
+ defaultAggregate: "sum",
18889
+ empty: "omit",
18890
+ companions: [NOW$2]
18891
+ }),
18892
+ numeric({
18893
+ id: "battery",
18894
+ summary: "Battery charge in percent. Offline and unknown members are left out, never read as 0 %.",
18895
+ role: DeviceRole.BatterySensor,
18896
+ outputCap: "battery",
18897
+ outputField: "percentage",
18898
+ quantity: "percentage",
18899
+ defaultAggregate: "mean",
18900
+ empty: "null",
18901
+ companions: [
18902
+ {
18903
+ fieldPath: "charging",
18904
+ expr: "\"unknown\""
18905
+ },
18906
+ {
18907
+ fieldPath: "sleeping",
18908
+ expr: "false"
18909
+ },
18910
+ {
18911
+ fieldPath: "lastUpdated",
18912
+ expr: "now"
18913
+ }
18914
+ ]
18915
+ }),
18916
+ numeric({
18917
+ id: "numeric",
18918
+ summary: "A numeric reading in the members’ shared quantity. Mixed quantities are refused. Nobody reporting publishes null, not 0.",
18919
+ role: DeviceRole.NumericSensor,
18920
+ outputCap: "numeric-sensor",
18921
+ outputField: "value",
18922
+ quantity: "device",
18923
+ defaultAggregate: "mean",
18924
+ empty: "null",
18925
+ companions: [NOW$2]
18926
+ }),
18927
+ binary({
18928
+ id: "motion",
18929
+ summary: "Any or all motion. Offline and unknown members are left out, never read as off. Nobody reporting takes the device offline.",
18930
+ role: DeviceRole.MotionSensor,
18931
+ outputCap: "motion",
18932
+ outputField: "detected",
18933
+ defaultAggregate: "any",
18934
+ accept: [{
18935
+ cap: "motion",
18936
+ fieldPath: "detected"
18937
+ }],
18938
+ companions: [{
18939
+ fieldPath: "lastDetectedAt",
18940
+ expr: "null"
18941
+ }, {
18942
+ fieldPath: "autoClearAfterMs",
18943
+ expr: "null"
18944
+ }]
18945
+ }),
18946
+ binary({
18947
+ id: "contact",
18948
+ summary: "Any or all open contacts. Offline and unknown members are left out, never read as closed.",
18949
+ role: DeviceRole.ContactSensor,
18950
+ outputCap: "contact",
18951
+ outputField: "entryOpen",
18952
+ defaultAggregate: "any",
18953
+ accept: [{
18954
+ cap: "contact",
18955
+ fieldPath: "entryOpen"
18956
+ }],
18957
+ companions: [CHANGED]
18958
+ }),
18959
+ binary({
18960
+ id: "leak",
18961
+ summary: "Any or all leak detections. Offline and unknown members are left out, never read as dry.",
18962
+ role: DeviceRole.LeakSensor,
18963
+ outputCap: "flood",
18964
+ outputField: "flooded",
18965
+ defaultAggregate: "any",
18966
+ accept: [{
18967
+ cap: "flood",
18968
+ fieldPath: "flooded"
18969
+ }],
18970
+ companions: [CHANGED]
18971
+ }),
18972
+ binary({
18973
+ id: "smoke",
18974
+ summary: "Any or all smoke detections. Offline and unknown members are left out, never read as clear.",
18975
+ role: DeviceRole.SmokeSensor,
18976
+ outputCap: "smoke",
18977
+ outputField: "detected",
18978
+ defaultAggregate: "any",
18979
+ accept: [{
18980
+ cap: "smoke",
18981
+ fieldPath: "detected"
18982
+ }],
18983
+ companions: [CHANGED]
18984
+ }),
18985
+ binary({
18986
+ id: "occupancy",
18987
+ summary: "Any or all of motion or binary sensors, published as a binary. Presence zones are not aggregated. Nobody reporting is offline, not off.",
18988
+ role: DeviceRole.BinarySensor,
18989
+ outputCap: "binary",
18990
+ outputField: "on",
18991
+ defaultAggregate: "any",
18992
+ accept: [{
18993
+ cap: "motion",
18994
+ fieldPath: "detected"
18995
+ }, {
18996
+ cap: "binary",
18997
+ fieldPath: "on"
18998
+ }],
18999
+ companions: [CHANGED]
19000
+ }),
19001
+ binary({
19002
+ id: "binary",
19003
+ summary: "Any or all generic binary sensors. Offline and unknown members are left out, never read as off.",
19004
+ role: DeviceRole.BinarySensor,
19005
+ outputCap: "binary",
19006
+ outputField: "on",
19007
+ defaultAggregate: "any",
19008
+ accept: [{
19009
+ cap: "binary",
19010
+ fieldPath: "on"
19011
+ }],
19012
+ companions: [CHANGED]
19013
+ }),
19014
+ actuator({
19015
+ id: "switch",
19016
+ 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.",
19017
+ deviceType: DeviceType.Switch,
19018
+ outputCap: "switch",
19019
+ outputField: "on",
19020
+ member: {
19021
+ cap: "switch",
19022
+ fieldPath: "on"
19023
+ },
19024
+ commandCaps: ["switch"]
19025
+ }),
19026
+ actuator({
19027
+ id: "light",
19028
+ 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.",
19029
+ deviceType: DeviceType.Light,
19030
+ outputCap: "switch",
19031
+ outputField: "on",
19032
+ member: {
19033
+ cap: "switch",
19034
+ fieldPath: "on"
19035
+ },
19036
+ commandCaps: [
19037
+ "switch",
19038
+ "brightness",
19039
+ "color"
19040
+ ]
19041
+ }),
19042
+ actuator({
19043
+ id: "fan",
19044
+ 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.",
19045
+ deviceType: DeviceType.Fan,
19046
+ outputCap: "switch",
19047
+ outputField: "on",
19048
+ member: {
19049
+ cap: "switch",
19050
+ fieldPath: "on"
19051
+ },
19052
+ commandCaps: ["switch", "fan-control"]
19053
+ }),
19054
+ actuator({
19055
+ id: "cover",
19056
+ 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.",
19057
+ deviceType: DeviceType.Cover,
19058
+ outputCap: "group-active",
19059
+ outputField: "active",
19060
+ member: {
19061
+ cap: "cover",
19062
+ fieldPath: "state"
19063
+ },
19064
+ activeWhen: [
19065
+ "open",
19066
+ "opening",
19067
+ "stopped"
19068
+ ],
19069
+ commandCaps: ["cover"]
19070
+ }),
19071
+ actuator({
19072
+ id: "valve",
19073
+ 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.",
19074
+ deviceType: DeviceType.Valve,
19075
+ outputCap: "group-active",
19076
+ outputField: "active",
19077
+ member: {
19078
+ cap: "valve",
19079
+ fieldPath: "state"
19080
+ },
19081
+ activeWhen: [
19082
+ "open",
19083
+ "opening",
19084
+ "stopped"
19085
+ ],
19086
+ commandCaps: ["valve"]
19087
+ }),
19088
+ actuator({
19089
+ id: "lock",
19090
+ 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.",
19091
+ deviceType: DeviceType.Lock,
19092
+ outputCap: "group-active",
19093
+ outputField: "active",
19094
+ member: {
19095
+ cap: "lock-control",
19096
+ fieldPath: "state"
19097
+ },
19098
+ activeWhen: ["locked"],
19099
+ commandCaps: ["lock-control"]
19100
+ }),
19101
+ actuator({
19102
+ id: "media-player",
19103
+ 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.",
19104
+ deviceType: DeviceType.MediaPlayer,
19105
+ outputCap: "group-active",
19106
+ outputField: "active",
19107
+ member: {
19108
+ cap: "media-player",
19109
+ fieldPath: "state"
19110
+ },
19111
+ activeWhen: ["playing", "buffering"],
19112
+ commandCaps: ["media-player"]
19113
+ }),
19114
+ actuator({
19115
+ id: "climate",
19116
+ 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.",
19117
+ deviceType: DeviceType.Thermostat,
19118
+ memberDeviceTypes: [DeviceType.Thermostat, DeviceType.Climate],
19119
+ outputCap: "group-active",
19120
+ outputField: "active",
19121
+ member: {
19122
+ cap: "climate-control",
19123
+ fieldPath: "mode"
19124
+ },
19125
+ activeWhen: [
19126
+ "heat",
19127
+ "cool",
19128
+ "auto",
19129
+ "heat_cool",
19130
+ "fan_only",
19131
+ "dry"
19132
+ ],
19133
+ commandCaps: ["climate-control"]
19134
+ })
19135
+ ];
19136
+ function actuator(input) {
19137
+ return {
19138
+ id: input.id,
19139
+ summary: input.summary,
19140
+ deviceType: input.deviceType,
19141
+ outputCap: input.outputCap,
19142
+ outputField: input.outputField,
19143
+ commandCaps: input.commandCaps,
19144
+ family: "actuator",
19145
+ role: void 0,
19146
+ memberDeviceType: input.deviceType,
19147
+ memberDeviceTypes: input.memberDeviceTypes ?? [input.deviceType],
19148
+ activeWhen: input.activeWhen,
19149
+ quantity: "none",
19150
+ baseUnit: void 0,
19151
+ aggregates: BINARY_AGGREGATES,
19152
+ defaultAggregate: "any",
19153
+ empty: "offline",
19154
+ accept: [input.member],
19155
+ companions: [CHANGED]
19156
+ };
19157
+ }
19158
+ new Map(GROUP_TEMPLATES.map((template) => [template.id, template]));
19159
+ DeviceFeature.LightColorRgb, DeviceFeature.LightColorHsv, DeviceFeature.LightColorMired;
19160
+ DeviceType.Camera;
18435
19161
  `${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
18436
19162
  /**
18437
19163
  * What a composition may BUILD on a device type (G2, D676): the caps a new
@@ -20258,12 +20984,12 @@ function buildDeviceAdminUrl(parts) {
20258
20984
  * providers detect renames by matching `uniqueId` and patch `id`
20259
20985
  * in-place so dispatch keeps working.
20260
20986
  *
20261
- * **Rendering metadata is NOT stored here.** Display fields (`unit`,
20262
- * `precision`) live in the cap STATUS SLICE so they flow live with every
20263
- * state push and are the single source of truth. The `device_class` tag is
20264
- * an HA-specific input that is consumed at the discovery boundary
20265
- * (`ha-domain-mapping`) to derive the CamStack `DeviceRole`; it is never
20266
- * stored after that point.
20987
+ * **Display unit and precision are NOT stored here.** They are a read-time
20988
+ * preference (D944). A polymorphic reading stores its `quantity` here once,
20989
+ * at adopt, and a date/time value stores `dateTimeShape` the same way —
20990
+ * neither is repeated on each sample. The `device_class` tag is an
20991
+ * HA-specific input consumed at the discovery boundary (`ha-domain-mapping`)
20992
+ * to derive the CamStack `DeviceRole`; it is never stored after that point.
20267
20993
  *
20268
20994
  * The `raw` escape hatch carries provider-specific attributes that don't
20269
20995
  * fit the structured slots (HA `attributes` whitelist, Reolink `deviceCache`
@@ -20277,6 +21003,14 @@ var SourceInfoSchema = object({
20277
21003
  /** Immutable upstream identifier when available (HA `unique_id`, … ).
20278
21004
  * Used to detect rename when `id` changes. */
20279
21005
  uniqueId: string().optional(),
21006
+ /** Quantity of a polymorphic reading, written once at adopt (D944). */
21007
+ quantity: ReadingQuantitySchema.optional(),
21008
+ /** Date / time / datetime shape of a string reading, written once at adopt. */
21009
+ dateTimeShape: _enum([
21010
+ "date",
21011
+ "time",
21012
+ "datetime"
21013
+ ]).optional(),
20280
21014
  /** Provider-specific extras that don't fit the structured slots.
20281
21015
  * Whitelist what goes here per provider — do NOT dump entire HA
20282
21016
  * attribute blobs (would explode the meta JSON column). */
@@ -41381,7 +42115,8 @@ method(object({
41381
42115
  "enum"
41382
42116
  ]),
41383
42117
  enumValues: array(string()).optional(),
41384
- item: boolean().optional()
42118
+ item: boolean().optional(),
42119
+ quantity: ReadingQuantitySchema.optional()
41385
42120
  })).readonly(),
41386
42121
  itemArray: object({
41387
42122
  path: string(),
@@ -43761,7 +44496,7 @@ var NetworkAccessStatusSchema = object({
43761
44496
  });
43762
44497
  /**
43763
44498
  * Optional, richer endpoint shape returned by providers that expose
43764
- * MORE than one ingress concurrently (Tailscale Ingress with mixed
44499
+ * MORE than one ingress concurrently (Tailscale Funnel with mixed
43765
44500
  * serve+funnel rules, future ngrok multi-tunnel, …). Each entry carries
43766
44501
  * the originating provider config (mode + sourcePort) so the
43767
44502
  * orchestrator UI can label rows distinctly. Providers that expose only
@@ -45244,8 +45979,8 @@ var MaskPolygonShapeSchema = object({
45244
45979
  /** Boolean cell grid — row-major, length === gridWidth*gridHeight. */
45245
45980
  var MaskGridShapeSchema = object({
45246
45981
  kind: literal("grid"),
45247
- gridWidth: number(),
45248
- gridHeight: number(),
45982
+ gridWidth: number().meta(readingMeta("none")),
45983
+ gridHeight: number().meta(readingMeta("none")),
45249
45984
  cells: array(boolean())
45250
45985
  });
45251
45986
  discriminatedUnion("kind", [
@@ -45357,6 +46092,8 @@ var NcSystemEventKindSchema = _enum([
45357
46092
  "detection-blind",
45358
46093
  "motion-noisy",
45359
46094
  "motion-calm",
46095
+ "package-llm-silent",
46096
+ "package-llm-answered",
45360
46097
  "recording-stalled",
45361
46098
  "recording-healthy",
45362
46099
  "recording-degraded",
@@ -46446,7 +47183,20 @@ var NcRuleInputSchema = object({
46446
47183
  * save by the hub's grouping guard). `.optional()`, never `.default()`: the addon cap
46447
47184
  * path does not run Zod defaults.
46448
47185
  */
46449
- groupingSec: number().int().min(5).max(60).optional()
47186
+ groupingSec: number().int().min(5).max(60).optional(),
47187
+ /**
47188
+ * ASK ME TO CONFIRM DETECTIONS (#243): a DETECTION notification of this rule
47189
+ * carries "Correct" / "Wrong" buttons (and, where the channel has room, a
47190
+ * "Wrong, it is a <class>" choice). A tap marks the track for retraining, the
47191
+ * same mark the Library writes, and records whose notification it was and
47192
+ * when. A channel with no buttons gets the same two choices as links.
47193
+ *
47194
+ * `.optional()`, never `.default()` (a Zod default does not run on the addon
47195
+ * cap path): absent and `false` both mean off, which is what every rule
47196
+ * authored before this field meant. An editor turns it off by writing
47197
+ * `false`, so it needs no `clear` key.
47198
+ */
47199
+ askVerdict: boolean().optional()
46450
47200
  });
46451
47201
  /**
46452
47202
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -56970,6 +57720,28 @@ var PackageVersionInfoSchema = object({
56970
57720
  deprecated: string().optional(),
56971
57721
  distTags: array(string()).readonly()
56972
57722
  });
57723
+ /**
57724
+ * One published document. `ok` is markdown from the registry. `missing` means
57725
+ * the registry answered and the file was not there. `error` is a registry or
57726
+ * tarball failure — never an empty string standing in for either.
57727
+ */
57728
+ var PackageDocBodySchema = discriminatedUnion("status", [
57729
+ object({
57730
+ status: literal("ok"),
57731
+ markdown: string()
57732
+ }),
57733
+ object({ status: literal("missing") }),
57734
+ object({
57735
+ status: literal("error"),
57736
+ message: string()
57737
+ })
57738
+ ]);
57739
+ var PackageDocsSchema = object({
57740
+ name: string(),
57741
+ version: string(),
57742
+ readme: PackageDocBodySchema,
57743
+ changelog: PackageDocBodySchema
57744
+ });
56973
57745
  var SearchResultSchema = object({
56974
57746
  name: string(),
56975
57747
  version: string(),
@@ -57188,7 +57960,10 @@ method(object({ nodeId: string().optional() }).optional(), array(AddonListItemSc
57188
57960
  }), object({ success: literal(true) }), {
57189
57961
  kind: "mutation",
57190
57962
  auth: "admin"
57191
- }), method(object({ name: string() }), array(PackageVersionInfoSchema).readonly()), method(object({ addonId: string() }), RestartAddonResultSchema, {
57963
+ }), method(object({ name: string() }), array(PackageVersionInfoSchema).readonly()), method(object({
57964
+ name: string().min(1),
57965
+ version: string().min(1).optional()
57966
+ }), PackageDocsSchema, { auth: "admin" }), method(object({ addonId: string() }), RestartAddonResultSchema, {
57192
57967
  kind: "mutation",
57193
57968
  auth: "admin"
57194
57969
  }), method(object({ packageName: string() }), object({ success: literal(true) }), {
@@ -57247,27 +58022,17 @@ method(object({ nodeId: string().optional() }).optional(), array(AddonListItemSc
57247
58022
  */
57248
58023
  var AirQualitySensorStatusSchema = object({
57249
58024
  /** Carbon dioxide concentration in ppm. */
57250
- co2Ppm: number().min(0).optional(),
58025
+ co2Ppm: number().min(0).optional().meta(readingMeta("concentration-volume")),
57251
58026
  /** Total volatile organic compounds in ppb. */
57252
- vocPpb: number().min(0).optional(),
58027
+ vocPpb: number().min(0).optional().meta(readingMeta("concentration-ppb")),
57253
58028
  /** Particulate matter ≤ 2.5 μm in µg/m³. */
57254
- pm25: number().min(0).optional(),
58029
+ pm25: number().min(0).optional().meta(readingMeta("concentration-mass")),
57255
58030
  /** Particulate matter ≤ 10 μm in µg/m³. */
57256
- pm10: number().min(0).optional(),
58031
+ pm10: number().min(0).optional().meta(readingMeta("concentration-mass")),
57257
58032
  /** Composite AQI value (typically 0..500). */
57258
- aqi: number().optional(),
58033
+ aqi: number().optional().meta(readingMeta("index")),
57259
58034
  /** Ms epoch when the slice was last updated. */
57260
- lastFetchedAt: number(),
57261
- /** Live display unit of the single metric this slice carries (e.g. HA
57262
- * `attributes.unit_of_measurement` → 'ppm' / 'ppb' / 'µg/m³'). Each
57263
- * upstream `sensor.*` entity surfaces ONE device_class, so one unit
57264
- * per slice is unambiguous. */
57265
- unit: string().optional(),
57266
- /** Suggested decimal places for numeric display.
57267
- * Populated live from the upstream source when provided (e.g. HA
57268
- * `attributes.suggested_display_precision`). Falls back to
57269
- * auto-formatting when absent. */
57270
- precision: number().int().min(0).max(10).optional()
58035
+ lastFetchedAt: number()
57271
58036
  });
57272
58037
  var airQualitySensorCapability = {
57273
58038
  name: "air-quality-sensor",
@@ -57304,12 +58069,12 @@ var airQualitySensorCapability = {
57304
58069
  },
57305
58070
  pm25: {
57306
58071
  kind: "gauge",
57307
- unit: "ug/m3",
58072
+ unit: "µg/m³",
57308
58073
  deadband: 1
57309
58074
  },
57310
58075
  pm10: {
57311
58076
  kind: "gauge",
57312
- unit: "ug/m3",
58077
+ unit: "µg/m³",
57313
58078
  deadband: 1
57314
58079
  },
57315
58080
  aqi: {
@@ -57327,22 +58092,13 @@ var airQualitySensorCapability = {
57327
58092
  * entries with `device_class: illuminance`.
57328
58093
  */
57329
58094
  var AmbientLightSensorStatusSchema = object({
57330
- /** Current illuminance in lux (lx). */
57331
- lux: number().min(0).meta({
57332
- unit: "lx",
58095
+ /** Current illuminance in lux (lx). `null` when the sample was refused (D393). */
58096
+ lux: number().min(0).nullable().meta(readingMeta("illuminance", {
58097
+ precision: 0,
57333
58098
  label: "Illuminance"
57334
- }),
58099
+ })),
57335
58100
  /** Ms epoch when the slice was last updated. */
57336
- lastFetchedAt: number(),
57337
- /** Live display unit from the upstream source (e.g. HA
57338
- * `attributes.unit_of_measurement`). The UI prefers this over the
57339
- * role's canonical unit. Absent → fall back to the canonical unit. */
57340
- unit: string().optional(),
57341
- /** Suggested decimal places for numeric display.
57342
- * Populated live from the upstream source when provided (e.g. HA
57343
- * `attributes.suggested_display_precision`). Falls back to
57344
- * auto-formatting when absent. */
57345
- precision: number().int().min(0).max(10).optional()
58101
+ lastFetchedAt: number()
57346
58102
  });
57347
58103
  var ambientLightSensorCapability = {
57348
58104
  name: "ambient-light-sensor",
@@ -57374,12 +58130,7 @@ var ambientLightSensorCapability = {
57374
58130
  } } },
57375
58131
  /** Clock fields: written, but excluded from the compare that decides
57376
58132
  * whether persisting is worth a SQLite commit. */
57377
- volatileStateFields: ["lastFetchedAt"],
57378
- customize: {
57379
- version: 1,
57380
- advanced: "derive",
57381
- targets: []
57382
- }
58133
+ volatileStateFields: ["lastFetchedAt"]
57383
58134
  };
57384
58135
  /**
57385
58136
  * Per-class audio metrics aggregated over a sliding window.
@@ -57606,10 +58357,7 @@ var BatteryStatusSchema = object({
57606
58357
  * Consumers must SKIP a null rather than coerce it — `battery-band` already
57607
58358
  * declines to band a non-finite reading, which is the correct shape.
57608
58359
  */
57609
- percentage: number().min(0).max(100).nullable().meta({
57610
- unit: "%",
57611
- label: "Charge"
57612
- }),
58360
+ percentage: number().min(0).max(100).nullable().meta(readingMeta("percentage", { label: "Charge" })),
57613
58361
  /**
57614
58362
  * Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
57615
58363
  * Reolink-specific for the Solar Panel 2 accessory (will become
@@ -57636,7 +58384,14 @@ var BatteryStatusSchema = object({
57636
58384
  */
57637
58385
  sleeping: boolean().meta({ label: "Sleeping" }),
57638
58386
  /** Ms epoch of the last observation. Lets consumers reason about freshness. */
57639
- lastUpdated: number(),
58387
+ lastUpdated: number().meta(readingMeta("none")),
58388
+ /**
58389
+ * Battery voltage in volts, for a cell the firmware reports as voltage
58390
+ * rather than a percentage (Ecowitt capacitor packs). Absent on cameras
58391
+ * that only report charge. A second reading on this cap, not a second
58392
+ * `numeric-sensor` on the same device.
58393
+ */
58394
+ volts: number().nullable().optional().meta(readingMeta("voltage", { label: "Voltage" })),
57640
58395
  /**
57641
58396
  * Ms epoch of the last time the device PROVED it was reachable — a
57642
58397
  * completed firmware round-trip, an observed wake, or an inbound push
@@ -57683,12 +58438,12 @@ var BATTERY_DEVICE_TYPES = [
57683
58438
  DeviceType.Switch,
57684
58439
  DeviceType.PetFeeder,
57685
58440
  DeviceType.Container,
57686
- DeviceType.Thermostat
58441
+ DeviceType.Thermostat,
58442
+ DeviceType.EventEmitter
57687
58443
  ];
57688
58444
  /** Generic Customize target for the percentage reading (D936). */
57689
58445
  var batteryCustomize = {
57690
58446
  version: 1,
57691
- advanced: "derive",
57692
58447
  targets: [{
57693
58448
  id: "percentage",
57694
58449
  cardinality: "scalar",
@@ -57697,7 +58452,7 @@ var batteryCustomize = {
57697
58452
  stateField: "percentage"
57698
58453
  },
57699
58454
  deviceTypes: BATTERY_DEVICE_TYPES,
57700
- apply: "add-or-replace",
58455
+ apply: "add",
57701
58456
  path: "percentage",
57702
58457
  sources: [{
57703
58458
  kind: "field",
@@ -57818,10 +58573,16 @@ onStatusChanged: { data: object({
57818
58573
  /**
57819
58574
  * History (D850): recorded series. The generic capture replaces the `battery` series of `pipeline-analytics:stats-5m`.
57820
58575
  */
57821
- history: { fields: { percentage: {
57822
- kind: "gauge",
57823
- unit: "%"
57824
- } } },
58576
+ history: { fields: {
58577
+ percentage: {
58578
+ kind: "gauge",
58579
+ unit: "%"
58580
+ },
58581
+ volts: {
58582
+ kind: "gauge",
58583
+ unit: "V"
58584
+ }
58585
+ } },
57825
58586
  customize: batteryCustomize,
57826
58587
  /** Clock fields: written, but excluded from the compare that decides
57827
58588
  * whether persisting is worth a SQLite commit. */
@@ -57868,12 +58629,7 @@ var binaryCapability = {
57868
58629
  history: { fields: { on: { kind: "boolean" } } },
57869
58630
  /** Clock fields: written, but excluded from the compare that decides
57870
58631
  * whether persisting is worth a SQLite commit. */
57871
- volatileStateFields: ["lastChangedAt"],
57872
- customize: {
57873
- version: 1,
57874
- advanced: "derive",
57875
- targets: []
57876
- }
58632
+ volatileStateFields: ["lastChangedAt"]
57877
58633
  };
57878
58634
  /**
57879
58635
  * Dimmable-light brightness control. Co-exists with `switch` on the
@@ -57889,7 +58645,7 @@ var binaryCapability = {
57889
58645
  */
57890
58646
  var BrightnessStatusSchema = object({
57891
58647
  /** Current level as 0..100 inclusive. Firmware-reported. */
57892
- percentage: number().min(0).max(100),
58648
+ percentage: number().min(0).max(100).meta(readingMeta("percentage")),
57893
58649
  /** Ms epoch of the last operator-driven change. Useful for UI freshness. */
57894
58650
  lastChangedAt: number()
57895
58651
  });
@@ -58343,21 +59099,21 @@ var ClimateControlStatusSchema = object({
58343
59099
  /** Single setpoint in Celsius. Used by single-target modes
58344
59100
  * (heat / cool / dry). Null when the device is in a range mode
58345
59101
  * (`heat_cool`) or has no setpoint at all (`fan_only`/`off`). */
58346
- target: number().nullable(),
59102
+ target: number().nullable().meta(readingMeta("temperature")),
58347
59103
  /** Upper bound of the dual setpoint in Celsius. Populated only
58348
59104
  * in `heat_cool` mode. */
58349
- targetHigh: number().nullable(),
59105
+ targetHigh: number().nullable().meta(readingMeta("temperature")),
58350
59106
  /** Lower bound of the dual setpoint in Celsius. Populated only
58351
59107
  * in `heat_cool` mode. */
58352
- targetLow: number().nullable(),
59108
+ targetLow: number().nullable().meta(readingMeta("temperature")),
58353
59109
  /** Target relative humidity (0..100). Null when the device has no
58354
59110
  * humidity control. */
58355
- targetHumidity: number().min(0).max(100).nullable(),
59111
+ targetHumidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
58356
59112
  /** Current measured temperature in Celsius. Read-only — pushed by
58357
59113
  * the device's internal sensor. */
58358
- currentTemp: number().nullable(),
59114
+ currentTemp: number().nullable().meta(readingMeta("temperature")),
58359
59115
  /** Current measured relative humidity (0..100). Read-only. */
58360
- currentHumidity: number().min(0).max(100).nullable(),
59116
+ currentHumidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
58361
59117
  /** Vertical louver swing on/off. Null when the device has no vertical
58362
59118
  * swing surface (gate with `DeviceFeature.ClimateSwingVertical`). */
58363
59119
  swingVertical: boolean().nullable(),
@@ -58365,11 +59121,11 @@ var ClimateControlStatusSchema = object({
58365
59121
  * horizontal swing surface (gate with `DeviceFeature.ClimateSwingHorizontal`). */
58366
59122
  swingHorizontal: boolean().nullable(),
58367
59123
  /** Lowest setpoint the device accepts, Celsius. Absent / null = not reported. */
58368
- minTemp: number().nullable().optional(),
59124
+ minTemp: number().nullable().optional().meta(readingMeta("temperature")),
58369
59125
  /** Highest setpoint the device accepts, Celsius. Absent / null = not reported. */
58370
- maxTemp: number().nullable().optional(),
59126
+ maxTemp: number().nullable().optional().meta(readingMeta("temperature")),
58371
59127
  /** Setpoint granularity, Celsius (0.5, 1). Absent / null = not reported. */
58372
- tempStep: number().positive().nullable().optional(),
59128
+ tempStep: number().positive().nullable().optional().meta(readingMeta("temperature")),
58373
59129
  /** Ms epoch when the slice was last updated (push or command). */
58374
59130
  lastFetchedAt: number()
58375
59131
  });
@@ -58511,17 +59267,17 @@ var climateControlCapability = {
58511
59267
  * modes to expose in the picker without a slice fetch.
58512
59268
  */
58513
59269
  var RgbTripletSchema = object({
58514
- r: number().int().min(0).max(255),
58515
- g: number().int().min(0).max(255),
58516
- b: number().int().min(0).max(255)
59270
+ r: number().int().min(0).max(255).meta(readingMeta("none")),
59271
+ g: number().int().min(0).max(255).meta(readingMeta("none")),
59272
+ b: number().int().min(0).max(255).meta(readingMeta("none"))
58517
59273
  });
58518
59274
  var HsvTripletSchema = object({
58519
59275
  /** Hue in degrees, 0..360. */
58520
- h: number().min(0).max(360),
59276
+ h: number().min(0).max(360).meta(readingMeta("none")),
58521
59277
  /** Saturation as 0..100 inclusive. */
58522
- s: number().min(0).max(100),
59278
+ s: number().min(0).max(100).meta(readingMeta("none")),
58523
59279
  /** Value/brightness as 0..100 inclusive. */
58524
- v: number().min(0).max(100)
59280
+ v: number().min(0).max(100).meta(readingMeta("none"))
58525
59281
  });
58526
59282
  var ColorInputSchema = discriminatedUnion("mode", [
58527
59283
  object({
@@ -58550,7 +59306,7 @@ var ColorStatusSchema = object({
58550
59306
  /** Populated when `mode === 'hsv'`. */
58551
59307
  hsv: HsvTripletSchema.optional(),
58552
59308
  /** Populated when `mode === 'mired'`. */
58553
- mireds: number().int().optional(),
59309
+ mireds: number().int().optional().meta(readingMeta("colour-temperature")),
58554
59310
  /** Ms epoch of the last operator-driven change. */
58555
59311
  lastChangedAt: number()
58556
59312
  });
@@ -58745,18 +59501,12 @@ _enum([
58745
59501
  "empty",
58746
59502
  "full"
58747
59503
  ]);
58748
- /** Units a remaining-life counter is reported in. Closed: the panel renders
58749
- * each. */
58750
- var ConsumableRemainingUnitSchema = _enum([
58751
- "days",
58752
- "hours",
58753
- "cycles"
58754
- ]);
58755
- /** Remaining life as a COUNT, not a percentage (the PetKit desiccant reports
58756
- * days). `value` null = unknown (D393). */
59504
+ /** Whether `remaining.value` is a duration in seconds or a dimensionless count. */
59505
+ var ConsumableRemainingKindSchema = _enum(["duration", "count"]);
59506
+ /** Remaining life. `value` null = unknown (D393). Duration is seconds. */
58757
59507
  var ConsumableRemainingSchema = object({
58758
- value: number().min(0).nullable(),
58759
- unit: ConsumableRemainingUnitSchema
59508
+ value: number().min(0).nullable().meta(readingMeta("device")),
59509
+ kind: ConsumableRemainingKindSchema
58760
59510
  });
58761
59511
  /** A single consumable item. Either a continuous `level` (remaining
58762
59512
  * life %, or fill % for a `supply` / `waste` item) or a discrete `status`
@@ -58769,7 +59519,7 @@ var ConsumableItemSchema = object({
58769
59519
  /** Display name. */
58770
59520
  label: string().min(1),
58771
59521
  /** Remaining life % (`wear`) or fill % (`supply`, `waste`) when known (0..100). */
58772
- level: number().min(0).max(100).nullable(),
59522
+ level: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
58773
59523
  /** The provider's discrete verdict when known (binary mode). */
58774
59524
  status: ConsumableStatusSchema.nullable(),
58775
59525
  /** What the item is — decides whether low or full is bad. Absent = `wear`. */
@@ -58851,8 +59601,8 @@ var consumablesCustomize = {
58851
59601
  transforms: [{ kind: "identity" }]
58852
59602
  }],
58853
59603
  literals: [{
58854
- path: "remaining.unit",
58855
- values: [...ConsumableRemainingUnitSchema.options]
59604
+ path: "remaining.kind",
59605
+ values: [...ConsumableRemainingKindSchema.options]
58856
59606
  }]
58857
59607
  },
58858
59608
  {
@@ -58981,7 +59731,6 @@ reset: method(object({
58981
59731
  },
58982
59732
  "remaining.value": {
58983
59733
  kind: "gauge",
58984
- unitFrom: "remaining.unit",
58985
59734
  deadband: 1,
58986
59735
  displayName: "Remaining"
58987
59736
  }
@@ -59051,10 +59800,9 @@ var contactCapability = {
59051
59800
  * (empty array for the other kinds). It lives in the slice because
59052
59801
  * HA `select.*` entities may update their options at runtime.
59053
59802
  *
59054
- * The `unit`/`min`/`max`/`step` fields are meaningful for
59055
- * `kind === 'numeric'` and are absent (undefined) for all other
59056
- * kinds. They are populated live from HA attributes on each state
59057
- * push — consistent with `options` and the sensor-unit approach.
59803
+ * Numeric `min` / `max` / `step` live in the slice and share the device
59804
+ * quantity (`SourceInfo.quantity`, D944). Display precision is a read-time
59805
+ * preference. A datetime control's shape is `SourceInfo.dateTimeShape`.
59058
59806
  */
59059
59807
  var ControlStatusSchema = object({
59060
59808
  kind: _enum([
@@ -59066,39 +59814,17 @@ var ControlStatusSchema = object({
59066
59814
  /** Current value. Numeric kind → number; select/text/datetime → string.
59067
59815
  * Datetime values are ISO 8601 strings (full timestamp, date-only,
59068
59816
  * or time-only — HA accepts all three forms). */
59069
- value: union([number(), string()]),
59817
+ value: union([number().meta(readingMeta("device")), string()]),
59070
59818
  /** Acceptable values when `kind === 'select'`. Empty for other kinds. */
59071
59819
  options: array(string()),
59072
59820
  /** Ms epoch when the slice was last updated. */
59073
59821
  lastChangedAt: number(),
59074
- /** Display unit-of-measurement (e.g. '°C', '%', 'lx').
59075
- * Populated live from HA `attributes.unit_of_measurement` on each push.
59076
- * Meaningful for `kind === 'numeric'`; absent for other kinds. */
59077
- unit: string().optional(),
59078
- /** Minimum allowed value. Populated live from HA `attributes.min`.
59079
- * Meaningful for `kind === 'numeric'`; absent for other kinds. */
59080
- min: number().optional(),
59081
- /** Maximum allowed value. Populated live from HA `attributes.max`.
59082
- * Meaningful for `kind === 'numeric'`; absent for other kinds. */
59083
- max: number().optional(),
59084
- /** Step increment. Populated live from HA `attributes.step`.
59085
- * Meaningful for `kind === 'numeric'`; absent for other kinds. */
59086
- step: number().optional(),
59087
- /** Suggested decimal places for numeric display. Populated live from HA
59088
- * `attributes.suggested_display_precision`, or derived from `step` when the
59089
- * HA attribute is absent. Meaningful for `kind === 'numeric'`; absent for
59090
- * other kinds. Falls back to auto-formatting when absent. */
59091
- precision: number().int().min(0).max(10).optional(),
59092
- /** Date-picker granularity for `kind === 'datetime'`. 'date' → date-only,
59093
- * 'time' → time-only, 'datetime' → full timestamp. Absent for other kinds
59094
- * (UI defaults to 'datetime'). Derived live from the device's HA domain
59095
- * (date.* / time.* / datetime.*) or, for input_datetime, from the entity's
59096
- * `has_date`/`has_time` attributes on each push. */
59097
- format: _enum([
59098
- "date",
59099
- "time",
59100
- "datetime"
59101
- ]).optional()
59822
+ /** Minimum allowed value, in the device quantity's base unit. */
59823
+ min: number().optional().meta(readingMeta("device")),
59824
+ /** Maximum allowed value, in the device quantity's base unit. */
59825
+ max: number().optional().meta(readingMeta("device")),
59826
+ /** Step increment, in the device quantity's base unit. */
59827
+ step: number().optional().meta(readingMeta("device"))
59102
59828
  });
59103
59829
  var ControlSetValueInputSchema = discriminatedUnion("kind", [
59104
59830
  object({
@@ -59164,9 +59890,9 @@ var CoverStatusSchema = object({
59164
59890
  ]),
59165
59891
  /** 0 = fully closed, 100 = fully open. Null when the device has
59166
59892
  * no intermediate position surface. */
59167
- position: number().min(0).max(100).nullable(),
59893
+ position: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
59168
59894
  /** 0 = closed slats, 100 = open slats. Null when no tilt support. */
59169
- tiltPosition: number().min(0).max(100).nullable(),
59895
+ tiltPosition: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
59170
59896
  /** Ms epoch when the slice was last updated. */
59171
59897
  lastChangedAt: number()
59172
59898
  });
@@ -59269,9 +59995,9 @@ var NormalizedRangeSchema$1 = object({
59269
59995
  var DayNightStatusSchema = object({
59270
59996
  mode: DayNightModeSchema,
59271
59997
  /** IR-cut trigger sensitivity, NORMALIZED 0–100 (higher = switches to night sooner). */
59272
- sensitivity: number().optional(),
59998
+ sensitivity: number().optional().meta(readingMeta("none")),
59273
59999
  /** Delay before the IR-cut filter flips, in seconds. */
59274
- switchDelaySec: number().optional(),
60000
+ switchDelaySec: number().optional().meta(readingMeta("duration")),
59275
60001
  lastFetchedAt: number()
59276
60002
  });
59277
60003
  /**
@@ -59489,11 +60215,11 @@ var DishwasherStatusSchema = object({
59489
60215
  /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
59490
60216
  availablePrograms: array(string()),
59491
60217
  /** Seconds remaining on the active cycle, or null when not running / not known. */
59492
- remainingSeconds: number().int().nonnegative().nullable(),
60218
+ remainingSeconds: number().int().nonnegative().nullable().meta(readingMeta("duration")),
59493
60219
  /** Seconds the delayed start is set to (time until the cycle starts), or null. */
59494
- delayedStartSeconds: number().int().nonnegative().nullable(),
60220
+ delayedStartSeconds: number().int().nonnegative().nullable().meta(readingMeta("duration")),
59495
60221
  /** Cycle completion 0..100, or null when not applicable. */
59496
- progressPercent: number().min(0).max(100).nullable(),
60222
+ progressPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
59497
60223
  /** True when the door is reported open; null when the door state is not known. */
59498
60224
  doorOpen: boolean().nullable(),
59499
60225
  /** True when the door is latched (locked) during a cycle; null when not reported. */
@@ -59517,7 +60243,7 @@ var DishwasherStatusSchema = object({
59517
60243
  /** True while the machine-care (descaling / cleaning-program) reminder is raised; false when clear; null when not reported. */
59518
60244
  machineCareDue: boolean().nullable(),
59519
60245
  /** Program runs left before the machine-care reminder is due; null when the appliance does not say. */
59520
- machineCareRemainingRuns: number().int().nonnegative().nullable(),
60246
+ machineCareRemainingRuns: number().int().nonnegative().nullable().meta(readingMeta("count")),
59521
60247
  /** Option states: null when the appliance does not expose the option or has not said. */
59522
60248
  halfLoad: boolean().nullable(),
59523
60249
  hygienePlus: boolean().nullable(),
@@ -59532,7 +60258,7 @@ var DishwasherStatusSchema = object({
59532
60258
  /** Feature keys of the events currently raised (salt low, rinse aid low, program finished, …). */
59533
60259
  activeEvents: array(string()),
59534
60260
  /** Numeric error code when the appliance reports one; null otherwise. */
59535
- errorCode: number().nullable(),
60261
+ errorCode: number().nullable().meta(readingMeta("none")),
59536
60262
  /** Name of the raised alert-level event while the appliance is in error; null otherwise. */
59537
60263
  errorLabel: string().nullable(),
59538
60264
  /** Ms epoch of the last value received from the appliance; 0 = never. */
@@ -59763,7 +60489,7 @@ var DoorbellStatusSchema = object({
59763
60489
  /** Ms epoch of the last press. null = never observed since this provider started. */
59764
60490
  lastPressedAt: number().nullable(),
59765
60491
  /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
59766
- pressCountSinceStart: number()
60492
+ pressCountSinceStart: number().meta(readingMeta("count"))
59767
60493
  });
59768
60494
  var DoorbellPressEventSchema = object({
59769
60495
  deviceId: number(),
@@ -59828,17 +60554,7 @@ onPressed: {
59828
60554
  history: "none",
59829
60555
  customize: doorbellCustomize
59830
60556
  };
59831
- /**
59832
- * Enum-state sensor — a string value picked from a finite option set.
59833
- * Drives HA `sensor` entries with `state_class: enum` (HVAC action
59834
- * states, weather conditions, contact-source channels, mode strings).
59835
- * The option set is stable across observations; it is persisted in the
59836
- * device config blob (via the control slice at adoption) and is NOT
59837
- * stored in `sourceInfo`.
59838
- */
59839
- /** Locale-render shape for an ISO `value` carried by a `DateTimeSensor`-role
59840
- * enum sensor: `date` (date-only), `time` (time-only), `datetime` (both). */
59841
- var EnumSensorDateTimeFormatSchema = _enum([
60557
+ _enum([
59842
60558
  "date",
59843
60559
  "time",
59844
60560
  "datetime"
@@ -59846,12 +60562,11 @@ var EnumSensorDateTimeFormatSchema = _enum([
59846
60562
  var EnumSensorStatusSchema = object({
59847
60563
  value: string(),
59848
60564
  /**
59849
- * Set for `DateTimeSensor`-role sensors so the UI renders the ISO `value`
59850
- * as a locale date/time/datetime; absent for plain enum sensors. HA
59851
- * `device_class=timestamp` → `'datetime'`, `device_class=date` → `'date'`,
59852
- * a time-only sensor → `'time'`.
60565
+ * Set when `value` is a timestamp rather than an enum state, so history
60566
+ * does not learn ISO strings as states. The display shape (date / time /
60567
+ * datetime) lives on `SourceInfo.dateTimeShape`, written once at adopt.
59853
60568
  */
59854
- format: EnumSensorDateTimeFormatSchema.optional(),
60569
+ timestamp: boolean().optional(),
59855
60570
  /** Ms epoch when the slice was last updated. */
59856
60571
  lastFetchedAt: number()
59857
60572
  });
@@ -59878,11 +60593,11 @@ var enumSensorCapability = {
59878
60593
  * History (D850): the value as an `enum` series (an appliance's program or
59879
60594
  * operation state, an HVAC action). The option set is per device, so the
59880
60595
  * value list is LEARNED as values are first seen (bounded). A sensor with a
59881
- * `format` carries a timestamp, not a state, and is not recorded.
60596
+ * `timestamp` carries a clock, not a state, and is not recorded.
59882
60597
  */
59883
60598
  history: { fields: { value: {
59884
60599
  kind: "enum",
59885
- skipWhenSet: "format"
60600
+ skipWhenSet: "timestamp"
59886
60601
  } } },
59887
60602
  /** Clock fields: written, but excluded from the compare that decides
59888
60603
  * whether persisting is worth a SQLite commit. */
@@ -59902,13 +60617,13 @@ var EventFireSchema = object({
59902
60617
  deviceId: number(),
59903
60618
  eventType: string(),
59904
60619
  data: record(string(), unknown()).nullable(),
59905
- timestamp: number(),
59906
- seq: number()
60620
+ timestamp: number().meta(readingMeta("none")),
60621
+ seq: number().meta(readingMeta("count"))
59907
60622
  });
59908
60623
  var EventEmitterStatusSchema = object({
59909
60624
  eventTypes: array(string()),
59910
60625
  lastEvent: EventFireSchema.nullable(),
59911
- eventCountSinceStart: number()
60626
+ eventCountSinceStart: number().meta(readingMeta("count"))
59912
60627
  });
59913
60628
  var eventEmitterCapability = {
59914
60629
  name: "event-emitter",
@@ -60321,10 +61036,10 @@ var FanDirectionSchema = _enum(["forward", "reverse"]);
60321
61036
  var FanControlStatusSchema = object({
60322
61037
  /** Active speed as 0..100 inclusive. Null when the device has no
60323
61038
  * speed surface (single-speed fan). */
60324
- percentage: number().min(0).max(100).nullable(),
61039
+ percentage: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
60325
61040
  /** Speed granularity the device accepts (HA `percentage_step`, e.g. 25 for
60326
61041
  * a 4-speed fan). Absent when unknown — the UI then falls back to step 1. */
60327
- percentageStep: number().positive().optional(),
61042
+ percentageStep: number().positive().optional().meta(readingMeta("percentage")),
60328
61043
  /** Active preset mode (`auto` / `quiet` / `turbo` / vendor-specific)
60329
61044
  * — empty string when no preset is active or supported. */
60330
61045
  preset: string(),
@@ -60445,7 +61160,7 @@ var FeatureProbeStatusSchema = object({
60445
61160
  /** Camera/firmware model string. `null` when the firmware doesn't expose it. */
60446
61161
  model: string().nullable(),
60447
61162
  /** Channel count for NVR/Hub devices; `1` for standalone cameras; `null` pre-probe. */
60448
- channelCount: number().nullable(),
61163
+ channelCount: number().nullable().meta(readingMeta("count")),
60449
61164
  /**
60450
61165
  * Ms epoch of the last SUCCESSFUL probe. `0` before the first probe
60451
61166
  * completes — drivers' `getAccessoryChildren()` should treat zero as
@@ -60568,9 +61283,151 @@ var gasCapability = {
60568
61283
  * whether persisting is worth a SQLite commit. */
60569
61284
  volatileStateFields: ["lastChangedAt"]
60570
61285
  };
61286
+ var GroupCommandsSchema = object({
61287
+ /** One row per member that has been commanded. A later command replaces that member's row. */
61288
+ results: array(object({
61289
+ deviceId: number().int().nonnegative(),
61290
+ cap: string().min(1),
61291
+ method: string().min(1),
61292
+ ok: boolean(),
61293
+ error: string().optional(),
61294
+ /** Ms epoch of the attempt. */
61295
+ at: number()
61296
+ })) });
61297
+ var groupCommandsCapability = {
61298
+ name: "group-commands",
61299
+ scope: "device",
61300
+ deviceNative: true,
61301
+ mode: "singleton",
61302
+ deviceTypes: [
61303
+ DeviceType.Switch,
61304
+ DeviceType.Light,
61305
+ DeviceType.Fan,
61306
+ DeviceType.Cover,
61307
+ DeviceType.Valve,
61308
+ DeviceType.Lock,
61309
+ DeviceType.MediaPlayer,
61310
+ DeviceType.Thermostat,
61311
+ DeviceType.Climate
61312
+ ],
61313
+ methods: {},
61314
+ status: {
61315
+ schema: GroupCommandsSchema,
61316
+ kind: "push"
61317
+ },
61318
+ runtimeState: GroupCommandsSchema,
61319
+ /**
61320
+ * Runtime-state durability: **session** — the last attempt. A restored
61321
+ * failure would outlive the command that caused it.
61322
+ *
61323
+ * See `RuntimeStateDurability`. Enforced by
61324
+ * `scripts/check-runtime-state-durability.ts`.
61325
+ */
61326
+ durability: "session",
61327
+ history: "none"
61328
+ };
61329
+ /**
61330
+ * Whether a helper actuator group counts as active (D944): at least one
61331
+ * included member is, or every included member is. What "active" means is the
61332
+ * type's: a cover is open, a lock is locked, a media player is playing, a
61333
+ * climate device is not off. A group of lights, switches and fans reports
61334
+ * `switch.on` instead; this cap is for the types whose own state is not a
61335
+ * yes/no. Unknown members are left out (`group-status` counts them) and an
61336
+ * empty included set takes the device offline, never `active: false`.
61337
+ */
61338
+ var GroupActiveSchema = object({
61339
+ active: boolean().meta({ label: "Active" }),
61340
+ /** Ms epoch when the slice was last updated. */
61341
+ lastChangedAt: number()
61342
+ });
61343
+ var groupActiveCapability = {
61344
+ name: "group-active",
61345
+ scope: "device",
61346
+ deviceNative: true,
61347
+ mode: "singleton",
61348
+ deviceTypes: [
61349
+ DeviceType.Cover,
61350
+ DeviceType.Valve,
61351
+ DeviceType.Lock,
61352
+ DeviceType.MediaPlayer,
61353
+ DeviceType.Climate,
61354
+ DeviceType.Thermostat
61355
+ ],
61356
+ methods: {},
61357
+ status: {
61358
+ schema: GroupActiveSchema,
61359
+ kind: "push"
61360
+ },
61361
+ runtimeState: GroupActiveSchema,
61362
+ /**
61363
+ * Runtime-state durability: **session** — recomputed from the members on the
61364
+ * next source event; a restored value would outlive the members it named.
61365
+ *
61366
+ * See `RuntimeStateDurability`. Enforced by
61367
+ * `scripts/check-runtime-state-durability.ts`.
61368
+ */
61369
+ durability: "session",
61370
+ history: "none"
61371
+ };
61372
+ /**
61373
+ * How many members of a helper group answered (D944). Counts are integers,
61374
+ * not measurements: zero included is a real count, never a stand-in reading.
61375
+ * The reading itself stays on the output capability. History is none — the
61376
+ * series that later statistics read is the output cap's own history block.
61377
+ */
61378
+ var GroupStatusSchema = object({
61379
+ /** Members whose current value entered the aggregate. */
61380
+ included: number().int().nonnegative().meta(readingMeta("count", {
61381
+ precision: 0,
61382
+ label: "Reporting"
61383
+ })),
61384
+ /** Members left out: offline, unknown, or not a finite reading (D393). */
61385
+ excluded: number().int().nonnegative().meta(readingMeta("count", {
61386
+ precision: 0,
61387
+ label: "Excluded"
61388
+ })),
61389
+ /** `included` + `excluded`. */
61390
+ total: number().int().nonnegative().meta(readingMeta("count", {
61391
+ precision: 0,
61392
+ label: "Members"
61393
+ }))
61394
+ });
61395
+ var groupStatusCapability = {
61396
+ name: "group-status",
61397
+ scope: "device",
61398
+ deviceNative: true,
61399
+ mode: "singleton",
61400
+ deviceTypes: [
61401
+ DeviceType.Sensor,
61402
+ DeviceType.Switch,
61403
+ DeviceType.Light,
61404
+ DeviceType.Fan,
61405
+ DeviceType.Cover,
61406
+ DeviceType.Valve,
61407
+ DeviceType.Lock,
61408
+ DeviceType.MediaPlayer,
61409
+ DeviceType.Thermostat,
61410
+ DeviceType.Climate
61411
+ ],
61412
+ methods: {},
61413
+ status: {
61414
+ schema: GroupStatusSchema,
61415
+ kind: "push"
61416
+ },
61417
+ runtimeState: GroupStatusSchema,
61418
+ /**
61419
+ * Runtime-state durability: **session** — recomputed from members on the
61420
+ * next source event; a restored count would outlive the readings it named.
61421
+ *
61422
+ * See `RuntimeStateDurability`. Enforced by
61423
+ * `scripts/check-runtime-state-durability.ts`.
61424
+ */
61425
+ durability: "session",
61426
+ history: "none"
61427
+ };
60571
61428
  var HeatingValveStatusSchema = object({
60572
61429
  /** Radiator valve opening 0 (closed) .. 100 (open). Null = not yet known. */
60573
- position: number().min(0).max(100).nullable(),
61430
+ position: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
60574
61431
  /** Ms epoch when the slice was last updated (push or poll). */
60575
61432
  lastFetchedAt: number()
60576
61433
  });
@@ -60613,9 +61470,9 @@ var HumidifierStatusSchema = object({
60613
61470
  /** Whether the humidifier is currently on. */
60614
61471
  on: boolean(),
60615
61472
  /** Current measured relative humidity (0..100). Null when not reported. */
60616
- currentHumidity: number().min(0).max(100).nullable(),
61473
+ currentHumidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
60617
61474
  /** Target relative humidity (0..100). Null when no setpoint surface. */
60618
- targetHumidity: number().min(0).max(100).nullable(),
61475
+ targetHumidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
60619
61476
  /** Active mode (`auto` / `normal` / `baby` / vendor). Null when the
60620
61477
  * device has no mode surface. */
60621
61478
  mode: string().nullable(),
@@ -60625,9 +61482,9 @@ var HumidifierStatusSchema = object({
60625
61482
  * `idle` / `off`). Null when the device doesn't report it. */
60626
61483
  action: string().nullable(),
60627
61484
  /** HA `min_humidity` attribute. Null → UI uses 0. */
60628
- minHumidity: number().nullable(),
61485
+ minHumidity: number().nullable().meta(readingMeta("humidity")),
60629
61486
  /** HA `max_humidity` attribute. Null → UI uses 100. */
60630
- maxHumidity: number().nullable(),
61487
+ maxHumidity: number().nullable().meta(readingMeta("humidity")),
60631
61488
  /** Ms epoch when the slice was last updated. */
60632
61489
  lastChangedAt: number()
60633
61490
  });
@@ -60697,22 +61554,13 @@ var humidifierCapability = {
60697
61554
  * `sourceInfo`.
60698
61555
  */
60699
61556
  var HumiditySensorStatusSchema = object({
60700
- /** Current relative humidity, 0..100. */
60701
- percent: number().min(0).max(100).meta({
60702
- unit: "%",
61557
+ /** Current relative humidity, 0..100. `null` when the sample was refused (D393). */
61558
+ percent: number().min(0).max(100).nullable().meta(readingMeta("humidity", {
61559
+ precision: 0,
60703
61560
  label: "Humidity"
60704
- }),
61561
+ })),
60705
61562
  /** Ms epoch when the slice was last updated. */
60706
- lastFetchedAt: number(),
60707
- /** Live display unit from the upstream source (e.g. HA
60708
- * `attributes.unit_of_measurement`). The UI prefers this over the
60709
- * role's canonical unit. Absent → fall back to the canonical unit. */
60710
- unit: string().optional(),
60711
- /** Suggested decimal places for numeric display.
60712
- * Populated live from the upstream source when provided (e.g. HA
60713
- * `attributes.suggested_display_precision`). Falls back to
60714
- * auto-formatting when absent. */
60715
- precision: number().int().min(0).max(10).optional()
61563
+ lastFetchedAt: number()
60716
61564
  });
60717
61565
  var humiditySensorCapability = {
60718
61566
  name: "humidity-sensor",
@@ -60743,12 +61591,7 @@ var humiditySensorCapability = {
60743
61591
  } } },
60744
61592
  /** Clock fields: written, but excluded from the compare that decides
60745
61593
  * whether persisting is worth a SQLite commit. */
60746
- volatileStateFields: ["lastFetchedAt"],
60747
- customize: {
60748
- version: 1,
60749
- advanced: "derive",
60750
- targets: []
60751
- }
61594
+ volatileStateFields: ["lastFetchedAt"]
60752
61595
  };
60753
61596
  /**
60754
61597
  * Image display cap. Models a single still image exposed by an integration —
@@ -60769,7 +61612,7 @@ var ImageStatusSchema = object({
60769
61612
  * entity exposes no `entity_picture` (yet). */
60770
61613
  url: string().nullable(),
60771
61614
  /** Ms epoch of the upstream last-updated timestamp. Null at cold-start. */
60772
- lastUpdated: number().nullable()
61615
+ lastUpdated: number().nullable().meta(readingMeta("none"))
60773
61616
  });
60774
61617
  var imageCapability = {
60775
61618
  name: "image",
@@ -60857,19 +61700,19 @@ var NormalizedRangeSchema = object({
60857
61700
  */
60858
61701
  var ImageSettingsStatusSchema = object({
60859
61702
  /** Normalized 0–100. */
60860
- brightness: number().optional(),
61703
+ brightness: number().optional().meta(readingMeta("none")),
60861
61704
  /** Normalized 0–100. */
60862
- contrast: number().optional(),
61705
+ contrast: number().optional().meta(readingMeta("none")),
60863
61706
  /** Normalized 0–100. */
60864
- saturation: number().optional(),
61707
+ saturation: number().optional().meta(readingMeta("none")),
60865
61708
  /** Normalized 0–100. */
60866
- sharpness: number().optional(),
61709
+ sharpness: number().optional().meta(readingMeta("none")),
60867
61710
  mirror: boolean().optional(),
60868
61711
  flip: boolean().optional(),
60869
61712
  rotate: ImageRotateSchema.optional(),
60870
61713
  whiteBalance: WhiteBalanceModeSchema.optional(),
60871
61714
  /** Manual white-balance warmth, NORMALIZED 0–100. Meaningful only when `whiteBalance === 'manual'`. */
60872
- warmth: number().optional(),
61715
+ warmth: number().optional().meta(readingMeta("none")),
60873
61716
  exposureMode: ExposureModeSchema.optional(),
60874
61717
  backlightMode: BacklightModeSchema.optional(),
60875
61718
  lastFetchedAt: number()
@@ -61148,10 +61991,10 @@ var IntercomAbilitySchema = object({
61148
61991
  /** Codecs accepted by firmware, in preference order. Driver-authored strings. */
61149
61992
  codecs: array(string()),
61150
61993
  /** Sample rate (Hz) the firmware expects. Reolink typical: 16000. */
61151
- sampleRate: number(),
61994
+ sampleRate: number().meta(readingMeta("none")),
61152
61995
  duplex: _enum(["half", "full"]),
61153
61996
  /** Max in-flight audio backlog before drop (ms). Server uses this to bound latency. */
61154
- maxBacklogMs: number()
61997
+ maxBacklogMs: number().meta(readingMeta("duration-ms"))
61155
61998
  });
61156
61999
  var IntercomStatusSchema = object({
61157
62000
  /** True while a talk session is open. */
@@ -61378,13 +62221,13 @@ var LawnMowerControlStatusSchema = object({
61378
62221
  activity: LawnMowerActivitySchema,
61379
62222
  /** 0..100 battery percentage. Null when the device has no battery
61380
62223
  * reading. */
61381
- batteryLevel: number().min(0).max(100).nullable(),
62224
+ batteryLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
61382
62225
  /** 0..100 mowing-completion percentage of the current task, or null when no
61383
62226
  * task is active / progress is unavailable. */
61384
- progressPercent: number().min(0).max(100).nullable(),
62227
+ progressPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
61385
62228
  /** Current device/event code (dynamic — mostly status, sometimes an error),
61386
62229
  * or null when unknown. */
61387
- currentCode: number().nullable(),
62230
+ currentCode: number().nullable().meta(readingMeta("none")),
61388
62231
  /** Human label for {@link currentCode}, or null when undecodable. */
61389
62232
  currentCodeLabel: string().nullable(),
61390
62233
  /** Severity of {@link currentCode}. `error` (and often `warning`) warrants UI
@@ -61837,7 +62680,14 @@ var lockControlCapability = {
61837
62680
  }),
61838
62681
  unlock: method(object({
61839
62682
  deviceId: number().int().nonnegative(),
61840
- code: string().min(1).optional()
62683
+ code: string().min(1).optional(),
62684
+ /**
62685
+ * Honoured by a helper lock GROUP only (D944): unlocking several doors
62686
+ * with one call is refused unless the caller says it was confirmed. A
62687
+ * single lock ignores it. The refusal lives in the callee, so no
62688
+ * automation or API caller reaches the doors by skipping a dialog.
62689
+ */
62690
+ confirm: boolean().optional()
61841
62691
  }), _void(), {
61842
62692
  kind: "mutation",
61843
62693
  auth: "protected"
@@ -61874,6 +62724,44 @@ var lockControlCapability = {
61874
62724
  volatileStateFields: ["lastChangedAt"]
61875
62725
  };
61876
62726
  /**
62727
+ * A monotonic total between resets (D944). Energy uses `power-meter.kwhTotal`
62728
+ * so dashboards keep one series; every other instantaneous reading lands here.
62729
+ * `value` is the time integral in the source quantity's accumulated base
62730
+ * (base-unit seconds, or kWh on the power meter). `null` is a gap, never zero.
62731
+ */
62732
+ var MeterStatusSchema = object({
62733
+ value: number().nullable().meta(readingMeta("device", { label: "Total" })),
62734
+ lastFetchedAt: number()
62735
+ });
62736
+ var meterCapability = {
62737
+ name: "meter",
62738
+ scope: "device",
62739
+ deviceNative: true,
62740
+ mode: "singleton",
62741
+ deviceTypes: [DeviceType.Sensor],
62742
+ methods: {},
62743
+ status: {
62744
+ schema: MeterStatusSchema,
62745
+ kind: "push"
62746
+ },
62747
+ runtimeState: MeterStatusSchema,
62748
+ /**
62749
+ * Runtime-state durability: **restored** — the total is a cache of the
62750
+ * history integral. A restart shows it only until the history pass
62751
+ * recomputes the open period; it is not an in-memory buffer.
62752
+ *
62753
+ * See `RuntimeStateDurability`. Enforced by
62754
+ * `scripts/check-runtime-state-durability.ts`.
62755
+ */
62756
+ durability: "restored",
62757
+ history: { fields: { value: {
62758
+ kind: "counter",
62759
+ deadband: .001,
62760
+ minIntervalMs: 6e4
62761
+ } } },
62762
+ volatileStateFields: ["lastFetchedAt"]
62763
+ };
62764
+ /**
61877
62765
  * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
61878
62766
  * Apple TV, Spotify, Roku, generic OTT receivers, …) on
61879
62767
  * `DeviceType.MediaPlayer`. Disjoint from the camera streaming
@@ -61917,7 +62805,7 @@ var MediaPlayerStatusSchema = object({
61917
62805
  state: MediaPlayerStateSchema,
61918
62806
  /** Volume as 0..100 inclusive. Null when the device has no volume
61919
62807
  * surface. Pair with `DeviceFeature.MediaPlayerVolume`. */
61920
- volumeLevel: number().min(0).max(100).nullable(),
62808
+ volumeLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
61921
62809
  /** Mute toggle distinct from volume=0. Null when no mute surface.
61922
62810
  * Pair with `DeviceFeature.MediaPlayerMute`. */
61923
62811
  isMuted: boolean().nullable(),
@@ -61930,10 +62818,10 @@ var MediaPlayerStatusSchema = object({
61930
62818
  currentMedia: MediaInfoSchema.nullable(),
61931
62819
  /** Current playback position in ms. Null when not seekable or
61932
62820
  * nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
61933
- positionMs: number().int().nonnegative().nullable(),
62821
+ positionMs: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
61934
62822
  /** Total duration of the current media in ms. Null when unknown
61935
62823
  * (live stream) or nothing is playing. */
61936
- durationMs: number().int().nonnegative().nullable(),
62824
+ durationMs: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
61937
62825
  /** Shuffle toggle. Null when no shuffle surface.
61938
62826
  * Pair with `DeviceFeature.MediaPlayerShuffle`. */
61939
62827
  shuffle: boolean().nullable(),
@@ -62242,7 +63130,7 @@ var motionCustomize = {
62242
63130
  eventName: "onMotionChanged"
62243
63131
  },
62244
63132
  deviceTypes: [DeviceType.Camera],
62245
- apply: "replace",
63133
+ apply: "add",
62246
63134
  applyAuthority: {
62247
63135
  kind: "camera-sensors",
62248
63136
  timeoutField: "motionCooldownMs"
@@ -62314,7 +63202,7 @@ var MotionStatusSchema = object({
62314
63202
  * it, every provider seeded it at boot, and every session left it
62315
63203
  * `detected: true` after its detach.
62316
63204
  */
62317
- autoClearAfterMs: number().nullable()
63205
+ autoClearAfterMs: number().nullable().meta(readingMeta("duration-ms"))
62318
63206
  });
62319
63207
  /**
62320
63208
  * Payload of `motion.onMotionChanged` event + the corresponding bus
@@ -62351,12 +63239,18 @@ var motionCapability = {
62351
63239
  methods: {
62352
63240
  /**
62353
63241
  * Pull the current motion state synchronously. Convenience shortcut
62354
- * for consumers that don't need the full status object; equivalent
62355
- * to `getStatus()?.detected ?? false`. Will likely be folded into
62356
- * `getStatus` once the auto-injected status surface lands in every
62357
- * consumer.
63242
+ * for consumers that don't need the full status object. A composed
63243
+ * group answers from its slice (D944): unknown throws, it is not off.
62358
63244
  */
62359
63245
  isDetected: method(object({ deviceId: number() }), boolean()) },
63246
+ /**
63247
+ * A composed motion group serves `isDetected` from `detected` (D944).
63248
+ * Without this the cap stays uncomposable (`has-commands`).
63249
+ */
63250
+ composedMethods: { isDetected: {
63251
+ kind: "slice",
63252
+ field: "detected"
63253
+ } },
62360
63254
  events: {
62361
63255
  /**
62362
63256
  * Fires every time the runner transitions a camera between
@@ -62496,7 +63390,7 @@ var MotionZoneRegionSchema = object({
62496
63390
  * the grid region(s). */
62497
63391
  var MotionZoneStatusSchema = object({
62498
63392
  enabled: boolean(),
62499
- sensitivity: number(),
63393
+ sensitivity: number().meta(readingMeta("none")),
62500
63394
  /** Grid region(s). Today exactly one `grid` shape. */
62501
63395
  regions: array(MotionZoneRegionSchema),
62502
63396
  lastFetchedAt: number()
@@ -62866,7 +63760,7 @@ var NavigationStatusSchema = object({
62866
63760
  following: boolean(),
62867
63761
  flash: boolean(),
62868
63762
  lightMode: NavigationLightModeSchema,
62869
- lightLevel: number().min(40).max(100),
63763
+ lightLevel: number().min(40).max(100).meta(readingMeta("none")),
62870
63764
  /** Ms epoch when the slice was last updated. */
62871
63765
  lastChangedAt: number()
62872
63766
  });
@@ -63000,13 +63894,13 @@ var NetworkLinkStatusSchema = object({
63000
63894
  * one whose reading has not landed must not be drawn at 0 %. Consumers
63001
63895
  * SKIP a null rather than coerce it.
63002
63896
  */
63003
- signalPercent: number().min(0).max(100).nullable(),
63897
+ signalPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
63004
63898
  /** Raw received signal strength in dBm, when the firmware reports one. */
63005
- rssiDbm: number().optional(),
63899
+ rssiDbm: number().optional().meta(readingMeta("signal-level")),
63006
63900
  /** Network name of a wireless link, when the firmware reports it. */
63007
63901
  ssid: string().optional(),
63008
63902
  /** Ms epoch of the last observation. Lets consumers reason about freshness. */
63009
- lastUpdated: number()
63903
+ lastUpdated: number().meta(readingMeta("none"))
63010
63904
  });
63011
63905
  var networkLinkCapability = {
63012
63906
  name: "network-link",
@@ -63391,7 +64285,7 @@ var NotifierStatusSchema = object({
63391
64285
  lastError: string().nullable(),
63392
64286
  /** Number of deliveries currently buffered server-side (rate-limited
63393
64287
  * notifiers may queue). 0 when the provider sends synchronously. */
63394
- queueDepth: number().int().nonnegative(),
64288
+ queueDepth: number().int().nonnegative().meta(readingMeta("count")),
63395
64289
  /** Per-feature capability matrix — authoritative source for the
63396
64290
  * compose-form field gating. */
63397
64291
  supports: NotifierSupportsSchema
@@ -63483,11 +64377,9 @@ onSent: { data: object({
63483
64377
  * cap fits (HA `sensor` whose `device_class` we don't have a typed cap
63484
64378
  * for: water flow, distance, weight, frequency, signal strength, …).
63485
64379
  *
63486
- * The `unit` and `precision` fields carry the live display metadata that
63487
- * the upstream source provides with each state push (HA
63488
- * `attributes.unit_of_measurement` / `attributes.suggested_display_precision`).
63489
- * The UI reads them directly from the slice — they are the single source
63490
- * of truth for generic numeric rendering and do NOT live on `sourceInfo`.
64380
+ * The quantity is not on this slice. It is chosen when the device is
64381
+ * adopted and stored once on `SourceInfo.quantity` (D944). `value` is in
64382
+ * that quantity's base unit. `null` is a refused sample (D393).
63491
64383
  *
63492
64384
  * Prefer the typed alternatives (`temperature-sensor`, `humidity-sensor`,
63493
64385
  * `ambient-light-sensor`, `pressure-sensor`, `power-meter`,
@@ -63496,15 +64388,8 @@ onSent: { data: object({
63496
64388
  * numeric values land here.
63497
64389
  */
63498
64390
  var NumericSensorStatusSchema = object({
63499
- value: number(),
63500
- /** Display unit-of-measurement (e.g. 'dBm', 's', 'rpm', 'steps').
63501
- * Populated live from the upstream source on each state push.
63502
- * Absent for unitless sensors. */
63503
- unit: string().optional(),
63504
- /** Suggested decimal places for numeric display.
63505
- * Populated live from the upstream source when provided.
63506
- * Falls back to auto-formatting when absent. */
63507
- precision: number().int().min(0).max(10).optional(),
64391
+ /** Reading in the device quantity's base unit. `null` when refused (D393). */
64392
+ value: number().nullable().meta(readingMeta("device")),
63508
64393
  /** Ms epoch when the slice was last updated. */
63509
64394
  lastFetchedAt: number()
63510
64395
  });
@@ -63528,11 +64413,11 @@ var numericSensorCapability = {
63528
64413
  */
63529
64414
  durability: "restored",
63530
64415
  /**
63531
- * History (D850): recorded series. The unit is per device, read from the sibling `unit` field.
64416
+ * History (D850): recorded series. The unit is the device quantity's base,
64417
+ * resolved when the series is read — the cap has no single unit.
63532
64418
  */
63533
64419
  history: { fields: { value: {
63534
64420
  kind: "gauge",
63535
- unitFrom: "unit",
63536
64421
  minIntervalMs: 3e4
63537
64422
  } } },
63538
64423
  /** Clock fields: written, but excluded from the compare that decides
@@ -63870,23 +64755,26 @@ var PetFeederStatusSchema = object({
63870
64755
  /** Food currently in the bowl (grams). Null when the device has not
63871
64756
  * reported a reading yet. On dual-hopper models this is the combined
63872
64757
  * bowl reading; per-hopper levels live in `food1`/`food2`. */
63873
- foodLevel: number().nullable(),
64758
+ foodLevel: number().nullable().meta(readingMeta("none")),
63874
64759
  /** Hopper-1 food level (grams) on dual-hopper feeders; null on
63875
64760
  * single-hopper models. */
63876
- food1: number().nullable(),
64761
+ food1: number().nullable().meta(readingMeta("none")),
63877
64762
  /** Hopper-2 food level (grams) on dual-hopper feeders; null on
63878
64763
  * single-hopper models. */
63879
- food2: number().nullable(),
64764
+ food2: number().nullable().meta(readingMeta("none")),
63880
64765
  /** Derived low-food flag — mirrors the HA `food_level` binary_sensor
63881
64766
  * (`device_class: problem`, on = low). True when the bowl is empty /
63882
64767
  * below the feeder's low threshold. */
63883
64768
  lowFood: boolean(),
63884
64769
  /** Battery charge 0..100 (%). Null on mains-powered models or when the
63885
64770
  * device has no battery reading. */
63886
- batteryPower: number().min(0).max(100).nullable(),
63887
- /** Days of desiccant life remaining. Null when the model has no
63888
- * desiccant sensor. */
63889
- desiccantLeftDays: number().nullable(),
64771
+ batteryPower: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
64772
+ /**
64773
+ * Desiccant life remaining, stored in seconds (duration base, D944).
64774
+ * Providers convert from the days the feeder reports. Null when the
64775
+ * model has no desiccant sensor.
64776
+ */
64777
+ desiccantLeftDays: number().nullable().meta(readingMeta("duration")),
63890
64778
  /** True while a feed is in progress. */
63891
64779
  feeding: boolean(),
63892
64780
  /** Decoded connectivity / power status (HA petkit device-status enum).
@@ -63897,7 +64785,7 @@ var PetFeederStatusSchema = object({
63897
64785
  * with `errorCode` for consumers that want the raw integer. */
63898
64786
  error: string().nullable(),
63899
64787
  /** Raw device error code (0 / null = no error). */
63900
- errorCode: number().nullable(),
64788
+ errorCode: number().nullable().meta(readingMeta("none")),
63901
64789
  /** True for D4S/D4SH dual-hopper hardware — gates the per-hopper UI. */
63902
64790
  isDualHopper: boolean(),
63903
64791
  /** Child-lock (manual-lock) setting — buttons on the unit are disabled. */
@@ -63907,7 +64795,7 @@ var PetFeederStatusSchema = object({
63907
64795
  /** Play a chime when dispensing. */
63908
64796
  feedSound: boolean(),
63909
64797
  /** Speaker / prompt volume level (device-scaled integer). */
63910
- volume: number(),
64798
+ volume: number().meta(readingMeta("none")),
63911
64799
  /** Ms epoch when the slice was last refreshed from the cloud. */
63912
64800
  lastFetchedAt: number()
63913
64801
  });
@@ -64026,7 +64914,7 @@ var petFeederCapability = {
64026
64914
  },
64027
64915
  desiccantLeftDays: {
64028
64916
  kind: "gauge",
64029
- unit: "days"
64917
+ unit: "s"
64030
64918
  }
64031
64919
  } }
64032
64920
  };
@@ -64427,43 +65315,88 @@ method(_void(), PlatformCapabilitiesSchema), method(_void(), HardwareInfoSchema)
64427
65315
  */
64428
65316
  var PowerMeterStatusSchema = object({
64429
65317
  /** Instantaneous power draw in watts. */
64430
- watts: number().optional().meta({
64431
- unit: "W",
64432
- label: "Power"
64433
- }),
65318
+ watts: number().optional().meta(readingMeta("power", { label: "Power" })),
64434
65319
  /** Cumulative energy in kilowatt-hours since the meter was reset. */
64435
- kwhTotal: number().optional().meta({
64436
- unit: "kWh",
64437
- label: "Energy"
64438
- }),
65320
+ kwhTotal: number().optional().meta(readingMeta("energy", { label: "Energy" })),
64439
65321
  /** Voltage in volts. */
64440
- volts: number().optional(),
65322
+ volts: number().optional().meta(readingMeta("voltage", { label: "Voltage" })),
64441
65323
  /** Current in amperes. */
64442
- amps: number().optional(),
64443
- /** Apparent power in volt-amperes (W × power-factor reciprocal). */
64444
- va: number().optional(),
65324
+ amps: number().optional().meta(readingMeta("current", { label: "Current" })),
65325
+ /** Apparent power in volt-amperes. */
65326
+ va: number().optional().meta(readingMeta("apparent-power")),
64445
65327
  /** Power factor (0..1) if reported. */
64446
- powerFactor: number().min(0).max(1).optional(),
65328
+ powerFactor: number().min(0).max(1).optional().meta(readingMeta("ratio")),
64447
65329
  /** Ms epoch when the slice was last updated. */
64448
- lastFetchedAt: number(),
64449
- /** Live display unit of the single metric this slice carries (e.g. HA
64450
- * `attributes.unit_of_measurement` → 'V' / 'A' / 'W' / 'kW' / 'kWh').
64451
- * Each upstream `sensor.*` entity surfaces ONE device_class, so one
64452
- * unit per slice is unambiguous. The UI prefers this over the role's
64453
- * canonical unit so a 'kW' / 'Wh' feed renders verbatim. */
64454
- unit: string().optional(),
64455
- /** Suggested decimal places for numeric display.
64456
- * Populated live from the upstream source when provided (e.g. HA
64457
- * `attributes.suggested_display_precision`). Falls back to
64458
- * auto-formatting when absent. */
64459
- precision: number().int().min(0).max(10).optional()
65330
+ lastFetchedAt: number()
64460
65331
  });
65332
+ /**
65333
+ * Loads that draw metered mains power (D951). The reading is a feature of the
65334
+ * device itself — a plug, a lamp, a fan, an air conditioner, a boiler, a
65335
+ * vacuum dock — not a separate sensor beside it. A `Sensor` stays: a clamp
65336
+ * meter or a standalone energy monitor IS the device. Cover, lock, valve,
65337
+ * camera and the like are left out: their draw is not what anyone meters.
65338
+ */
65339
+ var POWER_METER_DEVICE_TYPES = [
65340
+ DeviceType.Sensor,
65341
+ DeviceType.Switch,
65342
+ DeviceType.Light,
65343
+ DeviceType.Fan,
65344
+ DeviceType.Climate,
65345
+ DeviceType.Thermostat,
65346
+ DeviceType.Humidifier,
65347
+ DeviceType.WaterHeater,
65348
+ DeviceType.MediaPlayer,
65349
+ DeviceType.Washer,
65350
+ DeviceType.Dryer,
65351
+ DeviceType.Dishwasher,
65352
+ DeviceType.Vacuum,
65353
+ DeviceType.LawnMower,
65354
+ DeviceType.PetFeeder
65355
+ ];
65356
+ /** Everything but a bare `Sensor`: a sensor that takes its reading from another sensor adds nothing. */
65357
+ var POWER_METER_CUSTOMIZE_DEVICE_TYPES = POWER_METER_DEVICE_TYPES.filter((type) => type !== DeviceType.Sensor);
65358
+ /** One scalar target per reading; each is sourced from a device of its own (D951). */
65359
+ function powerTarget(id, unit) {
65360
+ return {
65361
+ id,
65362
+ cardinality: "scalar",
65363
+ vocabulary: {
65364
+ cap: "power-meter",
65365
+ stateField: id
65366
+ },
65367
+ deviceTypes: POWER_METER_CUSTOMIZE_DEVICE_TYPES,
65368
+ apply: "add",
65369
+ path: id,
65370
+ sources: [{
65371
+ kind: "numeric",
65372
+ requiredUnit: unit,
65373
+ transforms: [{ kind: "identity" }]
65374
+ }],
65375
+ companions: [{
65376
+ kind: "clock",
65377
+ path: "lastFetchedAt",
65378
+ when: "always"
65379
+ }],
65380
+ sourceReport: { status: "assignment-status" },
65381
+ advancedExpression: true
65382
+ };
65383
+ }
65384
+ /** "Power and energy" extension: watts, energy, voltage and current from other devices (D951). */
65385
+ var powerMeterCustomize = {
65386
+ version: 1,
65387
+ targets: [
65388
+ powerTarget("watts", "W"),
65389
+ powerTarget("kwhTotal", "kWh"),
65390
+ powerTarget("volts", "V"),
65391
+ powerTarget("amps", "A")
65392
+ ]
65393
+ };
64461
65394
  var powerMeterCapability = {
64462
65395
  name: "power-meter",
64463
65396
  scope: "device",
64464
65397
  deviceNative: true,
64465
65398
  mode: "singleton",
64466
- deviceTypes: [DeviceType.Sensor],
65399
+ deviceTypes: POWER_METER_DEVICE_TYPES,
64467
65400
  methods: {},
64468
65401
  status: {
64469
65402
  schema: PowerMeterStatusSchema,
@@ -64521,11 +65454,7 @@ var powerMeterCapability = {
64521
65454
  /** Clock fields: written, but excluded from the compare that decides
64522
65455
  * whether persisting is worth a SQLite commit. */
64523
65456
  volatileStateFields: ["lastFetchedAt"],
64524
- customize: {
64525
- version: 1,
64526
- advanced: "derive",
64527
- targets: []
64528
- }
65457
+ customize: powerMeterCustomize
64529
65458
  };
64530
65459
  /**
64531
65460
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
@@ -64545,11 +65474,11 @@ var powerMeterCapability = {
64545
65474
  */
64546
65475
  var GpsLocationSchema = object({
64547
65476
  /** Latitude in decimal degrees, -90..90. */
64548
- latitude: number().min(-90).max(90),
65477
+ latitude: number().min(-90).max(90).meta(readingMeta("angle")),
64549
65478
  /** Longitude in decimal degrees, -180..180. */
64550
- longitude: number().min(-180).max(180),
65479
+ longitude: number().min(-180).max(180).meta(readingMeta("angle")),
64551
65480
  /** Reported accuracy in meters (lower = better). */
64552
- accuracyMeters: number().nonnegative()
65481
+ accuracyMeters: number().nonnegative().meta(readingMeta("length"))
64553
65482
  });
64554
65483
  var PresenceStatusSchema = object({
64555
65484
  /** `home` / `not_home` / any user-defined zone name. */
@@ -64561,7 +65490,7 @@ var PresenceStatusSchema = object({
64561
65490
  gps: GpsLocationSchema.nullable(),
64562
65491
  /** Optional battery level of the tracking device (0..100). Null
64563
65492
  * when not reported. */
64564
- batteryPercent: number().min(0).max(100).nullable(),
65493
+ batteryPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
64565
65494
  /** Ms epoch when the slice was last updated. */
64566
65495
  lastChangedAt: number()
64567
65496
  });
@@ -64611,19 +65540,10 @@ var presenceCapability = {
64611
65540
  * `sourceInfo`.
64612
65541
  */
64613
65542
  var PressureSensorStatusSchema = object({
64614
- /** Current pressure in hPa. */
64615
- hpa: number(),
65543
+ /** Current pressure in hPa. `null` when the sample was refused (D393). */
65544
+ hpa: number().nullable().meta(readingMeta("pressure", { precision: 0 })),
64616
65545
  /** Ms epoch when the slice was last updated. */
64617
- lastFetchedAt: number(),
64618
- /** Live display unit from the upstream source (e.g. HA
64619
- * `attributes.unit_of_measurement`). The UI prefers this over the
64620
- * role's canonical unit. Absent → fall back to the canonical unit. */
64621
- unit: string().optional(),
64622
- /** Suggested decimal places for numeric display.
64623
- * Populated live from the upstream source when provided (e.g. HA
64624
- * `attributes.suggested_display_precision`). Falls back to
64625
- * auto-formatting when absent. */
64626
- precision: number().int().min(0).max(10).optional()
65546
+ lastFetchedAt: number()
64627
65547
  });
64628
65548
  var pressureSensorCapability = {
64629
65549
  name: "pressure-sensor",
@@ -65149,8 +66069,8 @@ var ptzCapability = {
65149
66069
  };
65150
66070
  var PtzAutotrackSettingsSchema = object({
65151
66071
  targetType: string().describe("Vendor target string (people/vehicle/pet); empty = camera default"),
65152
- stopDelaySeconds: number().int().min(0).max(300),
65153
- disappearDelaySeconds: number().int().min(0).max(300)
66072
+ stopDelaySeconds: number().int().min(0).max(300).meta(readingMeta("duration")),
66073
+ disappearDelaySeconds: number().int().min(0).max(300).meta(readingMeta("duration"))
65154
66074
  });
65155
66075
  /**
65156
66076
  * One option the camera advertises as a valid `targetType`. Drivers
@@ -65304,7 +66224,7 @@ var RunningStateStatusSchema = object({
65304
66224
  /** null = unknown — never coerced to false (D393). */
65305
66225
  running: boolean().nullable(),
65306
66226
  /** Epoch ms the current boolean began; null while `running` is null. */
65307
- since: number().nullable(),
66227
+ since: number().nullable().meta(readingMeta("none")),
65308
66228
  source: RunningStateSourceSchema.meta({ label: "Source" }),
65309
66229
  phase: string().nullable(),
65310
66230
  /** null until a reading has been published (D393). */
@@ -65319,7 +66239,6 @@ var RUNNING_DEVICE_TYPES = Object.values(DeviceType);
65319
66239
  /** Generic Customize target for the running boolean (D936). */
65320
66240
  var runningCustomize = {
65321
66241
  version: 1,
65322
- advanced: "derive",
65323
66242
  targets: [{
65324
66243
  id: "running",
65325
66244
  cardinality: "scalar",
@@ -65328,6 +66247,8 @@ var runningCustomize = {
65328
66247
  stateField: "running"
65329
66248
  },
65330
66249
  deviceTypes: [
66250
+ DeviceType.Washer,
66251
+ DeviceType.Dryer,
65331
66252
  DeviceType.Dishwasher,
65332
66253
  DeviceType.Vacuum,
65333
66254
  DeviceType.LawnMower,
@@ -65339,7 +66260,7 @@ var runningCustomize = {
65339
66260
  DeviceType.Thermostat,
65340
66261
  DeviceType.PetFeeder
65341
66262
  ],
65342
- apply: "add-or-replace",
66263
+ apply: "add",
65343
66264
  path: "running",
65344
66265
  sources: [
65345
66266
  {
@@ -66632,9 +67553,9 @@ var RecordTriggerSchema = _enum([
66632
67553
  */
66633
67554
  var RecordWindowSchema = object({
66634
67555
  trigger: RecordTriggerSchema,
66635
- day: number().int().min(0).max(6),
66636
- startMinute: number().int().min(0).max(1439),
66637
- endMinute: number().int().min(1).max(1440)
67556
+ day: number().int().min(0).max(6).meta(readingMeta("none")),
67557
+ startMinute: number().int().min(0).max(1439).meta(readingMeta("none")),
67558
+ endMinute: number().int().min(1).max(1440).meta(readingMeta("none"))
66638
67559
  });
66639
67560
  /** Status of one physical volume, as the camera itself describes it. */
66640
67561
  var OnboardStorageVolumeSchema = object({
@@ -66710,10 +67631,10 @@ var RecordingOnboardStatusSchema = object({
66710
67631
  /** Master "record to the card at all" switch. */
66711
67632
  enabled: boolean().nullable(),
66712
67633
  overwriteWhenFull: boolean().nullable(),
66713
- preRecordSec: number().nullable(),
66714
- postRecordSec: number().nullable(),
67634
+ preRecordSec: number().nullable().meta(readingMeta("duration")),
67635
+ postRecordSec: number().nullable().meta(readingMeta("duration")),
66715
67636
  /** Length of one recorded file, in minutes. */
66716
- segmentMinutes: number().nullable(),
67637
+ segmentMinutes: number().nullable().meta(readingMeta("none")),
66717
67638
  /** The primary track's weekly windows, flattened. */
66718
67639
  windows: array(RecordWindowSchema),
66719
67640
  /**
@@ -66729,7 +67650,7 @@ var RecordingOnboardStatusSchema = object({
66729
67650
  * provider reporting a non-zero count also reports the schedule as not
66730
67651
  * writable.
66731
67652
  */
66732
- unreadableWindows: number(),
67653
+ unreadableWindows: number().meta(readingMeta("count")),
66733
67654
  /**
66734
67655
  * The camera is scheduled to record and has NO usable storage.
66735
67656
  *
@@ -67750,7 +68671,7 @@ var CamStreamDescriptorSchema = object({
67750
68671
  url: string().optional(),
67751
68672
  codec: string().optional(),
67752
68673
  resolution: CamStreamResolutionSchema.optional(),
67753
- fps: number().positive().optional(),
68674
+ fps: number().positive().optional().meta(readingMeta("rate")),
67754
68675
  label: string().optional(),
67755
68676
  /** Device-level features (e.g. `battery-operated`) — drives broker policy. */
67756
68677
  deviceFeatures: array(string()).optional(),
@@ -67837,18 +68758,18 @@ var StreamProfileSchema = _enum([
67837
68758
  ]);
67838
68759
  /** The current encoding config of one stream profile. */
67839
68760
  var StreamProfileConfigSchema = object({
67840
- width: number(),
67841
- height: number(),
68761
+ width: number().meta(readingMeta("none")),
68762
+ height: number().meta(readingMeta("none")),
67842
68763
  codec: _enum(["h264", "h265"]),
67843
- framerate: number(),
67844
- bitrate: number(),
68764
+ framerate: number().meta(readingMeta("rate")),
68765
+ bitrate: number().meta(readingMeta("bitrate")),
67845
68766
  bitrateMode: _enum(["vbr", "cbr"]).optional(),
67846
68767
  encoderProfile: _enum([
67847
68768
  "high",
67848
68769
  "main",
67849
68770
  "baseline"
67850
68771
  ]).optional(),
67851
- gop: number().optional(),
68772
+ gop: number().optional().meta(readingMeta("none")),
67852
68773
  /**
67853
68774
  * Whether THIS profile currently carries an audio track. READ-ONLY here.
67854
68775
  *
@@ -68220,7 +69141,8 @@ var switchCapability = {
68220
69141
  deviceTypes: [
68221
69142
  DeviceType.Switch,
68222
69143
  DeviceType.Siren,
68223
- DeviceType.Light
69144
+ DeviceType.Light,
69145
+ DeviceType.Fan
68224
69146
  ],
68225
69147
  methods: { setState: method(object({
68226
69148
  deviceId: number(),
@@ -68267,12 +69189,7 @@ var switchCapability = {
68267
69189
  label: "On",
68268
69190
  kind: "boolean"
68269
69191
  }
68270
- }] },
68271
- customize: {
68272
- version: 1,
68273
- advanced: "derive",
68274
- targets: []
68275
- }
69192
+ }] }
68276
69193
  };
68277
69194
  /** C0 controls, DEL and the C1 range: none of them belongs in a name. */
68278
69195
  function hasControlCharacter(value) {
@@ -68855,35 +69772,21 @@ var tamperCapability = {
68855
69772
  * entries with `device_class: temperature` and any future native
68856
69773
  * thermometer.
68857
69774
  *
68858
- * Unit normalisation: providers convert to Celsius before storing.
68859
- * The slice value is always Celsius so cross-cap aggregators
68860
- * (climate-control's `currentTemp`, energy analytics) can compose
68861
- * without per-source unit fixups. The canonical display unit (`°C`) is
68862
- * a descriptor constant in the UI (ROLE_DESCRIPTOR), not stored in
68863
- * `sourceInfo`.
69775
+ * The number is Celsius (D944). Providers convert on ingest. A failed
69776
+ * conversion is `null`, never a guess. Display unit is a read-time preference.
68864
69777
  *
68865
69778
  * Status `lastFetchedAt` lets staleness-aware consumers detect a
68866
69779
  * frozen feed (provider hung) distinct from a "temperature hasn't
68867
69780
  * changed" steady state.
68868
69781
  */
68869
69782
  var TemperatureSensorStatusSchema = object({
68870
- /** Current temperature in Celsius. */
68871
- celsius: number().meta({
68872
- unit: "°C",
69783
+ /** Current temperature in Celsius. `null` when the sample was refused (D393). */
69784
+ celsius: number().nullable().meta(readingMeta("temperature", {
69785
+ precision: 1,
68873
69786
  label: "Temperature"
68874
- }),
69787
+ })),
68875
69788
  /** Ms epoch when the slice was last updated (push or poll). */
68876
- lastFetchedAt: number(),
68877
- /** Live display unit from the upstream source (e.g. HA
68878
- * `attributes.unit_of_measurement`). The UI prefers this over the
68879
- * role's canonical unit, so a Fahrenheit feed renders '°F' not '°C'.
68880
- * Absent → the UI falls back to the role's canonical unit. */
68881
- unit: string().optional(),
68882
- /** Suggested decimal places for numeric display.
68883
- * Populated live from the upstream source when provided (e.g. HA
68884
- * `attributes.suggested_display_precision`). Falls back to
68885
- * auto-formatting when absent. */
68886
- precision: number().int().min(0).max(10).optional()
69789
+ lastFetchedAt: number()
68887
69790
  });
68888
69791
  var temperatureSensorCapability = {
68889
69792
  name: "temperature-sensor",
@@ -68914,12 +69817,7 @@ var temperatureSensorCapability = {
68914
69817
  } } },
68915
69818
  /** Clock fields: written, but excluded from the compare that decides
68916
69819
  * whether persisting is worth a SQLite commit. */
68917
- volatileStateFields: ["lastFetchedAt"],
68918
- customize: {
68919
- version: 1,
68920
- advanced: "derive",
68921
- targets: []
68922
- }
69820
+ volatileStateFields: ["lastFetchedAt"]
68923
69821
  };
68924
69822
  /**
68925
69823
  * toast — system-scoped singleton capability that streams toast
@@ -69202,16 +70100,16 @@ var VacuumControlStatusSchema = object({
69202
70100
  ]),
69203
70101
  /** 0..100 battery percentage. Null when the device has no battery
69204
70102
  * reading. */
69205
- batteryLevel: number().min(0).max(100).nullable(),
70103
+ batteryLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
69206
70104
  /** Current fan-speed token (provider-verbatim). Null when unknown or
69207
70105
  * the vacuum has no speed control. */
69208
70106
  fanSpeed: string().nullable(),
69209
70107
  /** Speed tokens the hardware accepts — drives the UI selector. */
69210
70108
  availableFanSpeeds: array(string()),
69211
70109
  /** 0..100 cleaning-completion percentage of the current task, or null. */
69212
- progressPercent: number().min(0).max(100).nullable(),
70110
+ progressPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
69213
70111
  /** Current error code (0 / null = no error). */
69214
- errorCode: number().nullable(),
70112
+ errorCode: number().nullable().meta(readingMeta("none")),
69215
70113
  /** Human label for {@link errorCode}, or null when none / undecodable. */
69216
70114
  errorLabel: string().nullable(),
69217
70115
  /** Ms epoch when the slice was last updated. */
@@ -69289,7 +70187,7 @@ var ValveStatusSchema = object({
69289
70187
  ]),
69290
70188
  /** 0 = fully closed, 100 = fully open. Null when the device has no
69291
70189
  * intermediate position surface. */
69292
- position: number().min(0).max(100).nullable(),
70190
+ position: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
69293
70191
  /** Ms epoch when the slice was last updated. */
69294
70192
  lastChangedAt: number()
69295
70193
  });
@@ -69397,9 +70295,9 @@ var vibrationCapability = {
69397
70295
  */
69398
70296
  var WaterHeaterStatusSchema = object({
69399
70297
  /** Current measured temperature. Null when not reported. */
69400
- currentTemp: number().nullable(),
70298
+ currentTemp: number().nullable().meta(readingMeta("temperature")),
69401
70299
  /** Target temperature setpoint. Null when no setpoint surface. */
69402
- targetTemp: number().nullable(),
70300
+ targetTemp: number().nullable().meta(readingMeta("temperature")),
69403
70301
  /** Active operation mode = HA `state` (`eco` / `electric` / `gas` /
69404
70302
  * `heat_pump` / `high_demand` / `performance` / `off`). Null when the
69405
70303
  * device reports an unknown state. */
@@ -69410,9 +70308,9 @@ var WaterHeaterStatusSchema = object({
69410
70308
  * has no away surface. */
69411
70309
  away: boolean().nullable(),
69412
70310
  /** HA `min_temp` attribute. Null when not reported. */
69413
- minTemp: number().nullable(),
70311
+ minTemp: number().nullable().meta(readingMeta("temperature")),
69414
70312
  /** HA `max_temp` attribute. Null when not reported. */
69415
- maxTemp: number().nullable(),
70313
+ maxTemp: number().nullable().meta(readingMeta("temperature")),
69416
70314
  /** Ms epoch when the slice was last updated. */
69417
70315
  lastChangedAt: number()
69418
70316
  });
@@ -69497,25 +70395,18 @@ var waterHeaterCapability = {
69497
70395
  * Forecast deferred — current conditions only for v1.
69498
70396
  */
69499
70397
  var WeatherStatusSchema = object({
69500
- /** Verbatim HA condition state (`sunny`, `cloudy`, `rainy`, …). Null
69501
- * when no condition has been reported yet. */
70398
+ /** Verbatim condition state (`sunny`, `cloudy`, `rainy`, …). Null when none yet. */
69502
70399
  condition: string().nullable(),
69503
- /** Current temperature in the reported unit. Null when not provided. */
69504
- temperature: number().nullable(),
69505
- /** Temperature unit string (e.g. `°C` / `°F`). Null when not provided. */
69506
- temperatureUnit: string().nullable(),
70400
+ /** Current temperature in Celsius. Null when not provided or refused. */
70401
+ temperature: number().nullable().meta(readingMeta("temperature", { precision: 1 })),
69507
70402
  /** Relative humidity (0..100). Null when not provided. */
69508
- humidity: number().min(0).max(100).nullable(),
69509
- /** Barometric pressure in the reported unit. Null when not provided. */
69510
- pressure: number().nullable(),
69511
- /** Pressure unit string (e.g. `hPa` / `inHg`). Null when not provided. */
69512
- pressureUnit: string().nullable(),
69513
- /** Wind speed in the reported unit. Null when not provided. */
69514
- windSpeed: number().nullable(),
69515
- /** Wind-speed unit string (e.g. `km/h` / `mph`). Null when not provided. */
69516
- windSpeedUnit: string().nullable(),
70403
+ humidity: number().min(0).max(100).nullable().meta(readingMeta("humidity")),
70404
+ /** Barometric pressure in hPa. Null when not provided or refused. */
70405
+ pressure: number().nullable().meta(readingMeta("pressure")),
70406
+ /** Wind speed in metres per second. Null when not provided or refused. */
70407
+ windSpeed: number().nullable().meta(readingMeta("speed")),
69517
70408
  /** Wind bearing in degrees (0..360, meteorological). Null when not provided. */
69518
- windBearing: number().nullable(),
70409
+ windBearing: number().nullable().meta(readingMeta("angle")),
69519
70410
  /** Ms epoch when the slice was last updated. */
69520
70411
  lastFetchedAt: number()
69521
70412
  });
@@ -69543,12 +70434,12 @@ var weatherCapability = {
69543
70434
  */
69544
70435
  durability: "session",
69545
70436
  /**
69546
- * History (D850): recorded series. Units follow the sibling `*Unit` fields.
70437
+ * History (D850): recorded series. Numbers are the quantity base (D944).
69547
70438
  */
69548
70439
  history: { fields: {
69549
70440
  temperature: {
69550
70441
  kind: "gauge",
69551
- unitFrom: "temperatureUnit",
70442
+ unit: "°C",
69552
70443
  deadband: .2
69553
70444
  },
69554
70445
  humidity: {
@@ -69558,12 +70449,12 @@ var weatherCapability = {
69558
70449
  },
69559
70450
  pressure: {
69560
70451
  kind: "gauge",
69561
- unitFrom: "pressureUnit",
70452
+ unit: "hPa",
69562
70453
  deadband: .5
69563
70454
  },
69564
70455
  windSpeed: {
69565
70456
  kind: "gauge",
69566
- unitFrom: "windSpeedUnit",
70457
+ unit: "m/s",
69567
70458
  deadband: .5
69568
70459
  }
69569
70460
  } }
@@ -70597,8 +71488,9 @@ function withClipEventLabels(provider, deps) {
70597
71488
  listClips
70598
71489
  };
70599
71490
  }
71491
+ DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.ValvePositionable, DeviceFeature.MediaPlayerVolume, DeviceFeature.ClimateFanMode;
70600
71492
  SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
70601
- 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;
71493
+ 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;
70602
71494
  String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
70603
71495
  DeviceRole.BinarySensor, DeviceRole.MotionSensor;
70604
71496
  new Set(CAP_NAMES);
@@ -70942,6 +71834,9 @@ var DEVICE_LOCAL_STATE_CAPS = {
70942
71834
  featureProbe: featureProbeCapability,
70943
71835
  flood: floodCapability,
70944
71836
  gas: gasCapability,
71837
+ groupActive: groupActiveCapability,
71838
+ groupCommands: groupCommandsCapability,
71839
+ groupStatus: groupStatusCapability,
70945
71840
  heatingValve: heatingValveCapability,
70946
71841
  humidifier: humidifierCapability,
70947
71842
  humiditySensor: humiditySensorCapability,
@@ -70951,6 +71846,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
70951
71846
  lawnMowerControl: lawnMowerControlCapability,
70952
71847
  lockControl: lockControlCapability,
70953
71848
  mediaPlayer: mediaPlayerCapability,
71849
+ meter: meterCapability,
70954
71850
  motion: motionCapability,
70955
71851
  motionTrigger: motionTriggerCapability,
70956
71852
  motionZones: motionZonesCapability,
@@ -72214,7 +73110,7 @@ var BaseDeviceProvider = class extends BaseAddon {
72214
73110
  function widenDeviceConstructor(ctor) {
72215
73111
  return ctor;
72216
73112
  }
72217
- 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;
73113
+ 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;
72218
73114
  new Set(Object.values(DeviceType));
72219
73115
  Object.freeze({
72220
73116
  "accessories.getStatus": {
@@ -72322,6 +73218,13 @@ Object.freeze({
72322
73218
  access: "view",
72323
73219
  role: "admin"
72324
73220
  },
73221
+ "addons.getPackageDocs": {
73222
+ capName: "addons",
73223
+ capScope: "system",
73224
+ addonId: null,
73225
+ access: "view",
73226
+ role: "admin"
73227
+ },
72325
73228
  "addons.getVersions": {
72326
73229
  capName: "addons",
72327
73230
  capScope: "system",
@@ -75430,6 +76333,27 @@ Object.freeze({
75430
76333
  access: "view",
75431
76334
  role: "viewer"
75432
76335
  },
76336
+ "groupActive.getStatus": {
76337
+ capName: "group-active",
76338
+ capScope: "device",
76339
+ addonId: null,
76340
+ access: "view",
76341
+ role: "viewer"
76342
+ },
76343
+ "groupCommands.getStatus": {
76344
+ capName: "group-commands",
76345
+ capScope: "device",
76346
+ addonId: null,
76347
+ access: "view",
76348
+ role: "viewer"
76349
+ },
76350
+ "groupStatus.getStatus": {
76351
+ capName: "group-status",
76352
+ capScope: "device",
76353
+ addonId: null,
76354
+ access: "view",
76355
+ role: "viewer"
76356
+ },
75433
76357
  "heatingValve.getStatus": {
75434
76358
  capName: "heating-valve",
75435
76359
  capScope: "device",
@@ -76382,6 +77306,13 @@ Object.freeze({
76382
77306
  access: "create",
76383
77307
  role: "admin"
76384
77308
  },
77309
+ "meter.getStatus": {
77310
+ capName: "meter",
77311
+ capScope: "device",
77312
+ addonId: null,
77313
+ access: "view",
77314
+ role: "viewer"
77315
+ },
76385
77316
  "metricsProvider.collectSnapshot": {
76386
77317
  capName: "metrics-provider",
76387
77318
  capScope: "system",
@@ -84480,7 +85411,39 @@ var APPLIANCE_CAP_VOCABULARY = {
84480
85411
  phrase: t("When {device} finishes", "Quando {device} finisce"),
84481
85412
  icon: "square"
84482
85413
  }
84483
- }
85414
+ },
85415
+ overrides: { byType: {
85416
+ [DeviceType.Washer]: {
85417
+ state: { running: {
85418
+ whenTrue: t("When the washing machine starts", "Quando la lavatrice inizia"),
85419
+ whenFalse: t("When the washing machine has finished", "Quando la lavatrice ha finito")
85420
+ } },
85421
+ events: {
85422
+ onStarted: { phrase: t("When the washing machine starts", "Quando la lavatrice inizia") },
85423
+ onFinished: { phrase: t("When the washing machine has finished", "Quando la lavatrice ha finito") }
85424
+ }
85425
+ },
85426
+ [DeviceType.Dryer]: {
85427
+ state: { running: {
85428
+ whenTrue: t("When the dryer starts", "Quando l'asciugatrice inizia"),
85429
+ whenFalse: t("When the dryer has finished", "Quando l'asciugatrice ha finito")
85430
+ } },
85431
+ events: {
85432
+ onStarted: { phrase: t("When the dryer starts", "Quando l'asciugatrice inizia") },
85433
+ onFinished: { phrase: t("When the dryer has finished", "Quando l'asciugatrice ha finito") }
85434
+ }
85435
+ },
85436
+ [DeviceType.Dishwasher]: {
85437
+ state: { running: {
85438
+ whenTrue: t("When the dishwasher starts", "Quando la lavastoviglie inizia"),
85439
+ whenFalse: t("When the dishwasher has finished", "Quando la lavastoviglie ha finito")
85440
+ } },
85441
+ events: {
85442
+ onStarted: { phrase: t("When the dishwasher starts", "Quando la lavastoviglie inizia") },
85443
+ onFinished: { phrase: t("When the dishwasher has finished", "Quando la lavastoviglie ha finito") }
85444
+ }
85445
+ }
85446
+ } }
84484
85447
  },
84485
85448
  update: {
84486
85449
  scope: "device",
@@ -85252,6 +86215,41 @@ var SENSOR_CAP_VOCABULARY = {
85252
86215
  icon: "flame"
85253
86216
  }]
85254
86217
  },
86218
+ "group-active": {
86219
+ scope: "device",
86220
+ noun: t("Group state", "Stato del gruppo")
86221
+ },
86222
+ "group-commands": {
86223
+ scope: "device",
86224
+ noun: t("Group command", "Comando di gruppo")
86225
+ },
86226
+ "group-status": {
86227
+ scope: "device",
86228
+ noun: t("Group", "Gruppo"),
86229
+ state: [
86230
+ {
86231
+ kind: "numeric",
86232
+ field: "included",
86233
+ quantity: t("the members reporting", "i membri che rispondono"),
86234
+ label: t("Reporting", "Rispondono"),
86235
+ icon: "users"
86236
+ },
86237
+ {
86238
+ kind: "numeric",
86239
+ field: "excluded",
86240
+ quantity: t("the members left out", "i membri esclusi"),
86241
+ label: t("Excluded", "Esclusi"),
86242
+ icon: "users"
86243
+ },
86244
+ {
86245
+ kind: "numeric",
86246
+ field: "total",
86247
+ quantity: t("the member count", "il numero di membri"),
86248
+ label: t("Members", "Membri"),
86249
+ icon: "sigma"
86250
+ }
86251
+ ]
86252
+ },
85255
86253
  "humidity-sensor": {
85256
86254
  scope: "device",
85257
86255
  noun: t("Humidity", "Umidità"),
@@ -85277,6 +86275,17 @@ var SENSOR_CAP_VOCABULARY = {
85277
86275
  }],
85278
86276
  events: { onMotionChanged: { notOperatorFacing: "the `detected` state trigger phrases both edges, from the mirror that survives a dropped event (D49)" } }
85279
86277
  },
86278
+ meter: {
86279
+ scope: "device",
86280
+ noun: t("Meter", "Contatore"),
86281
+ state: [{
86282
+ kind: "numeric",
86283
+ field: "value",
86284
+ quantity: t("the total", "il totale"),
86285
+ label: t("Total", "Totale"),
86286
+ icon: "gauge"
86287
+ }]
86288
+ },
85280
86289
  "numeric-sensor": {
85281
86290
  scope: "device",
85282
86291
  noun: t("Sensor", "Sensore"),
@@ -85285,7 +86294,6 @@ var SENSOR_CAP_VOCABULARY = {
85285
86294
  field: "value",
85286
86295
  quantity: t("the reading", "il valore"),
85287
86296
  label: t("Reading", "Valore"),
85288
- unitField: "unit",
85289
86297
  icon: "gauge"
85290
86298
  }]
85291
86299
  },
@@ -85421,7 +86429,7 @@ var SENSOR_CAP_VOCABULARY = {
85421
86429
  field: "temperature",
85422
86430
  quantity: t("the outdoor temperature", "la temperatura esterna"),
85423
86431
  label: t("Temperature", "Temperatura"),
85424
- unitField: "temperatureUnit",
86432
+ unit: "°C",
85425
86433
  icon: "thermometer"
85426
86434
  },
85427
86435
  {
@@ -85437,7 +86445,7 @@ var SENSOR_CAP_VOCABULARY = {
85437
86445
  field: "windSpeed",
85438
86446
  quantity: t("the wind speed", "la velocità del vento"),
85439
86447
  label: t("Wind", "Vento"),
85440
- unitField: "windSpeedUnit",
86448
+ unit: "m/s",
85441
86449
  icon: "wind"
85442
86450
  },
85443
86451
  {
@@ -85445,7 +86453,7 @@ var SENSOR_CAP_VOCABULARY = {
85445
86453
  field: "pressure",
85446
86454
  quantity: t("the air pressure", "la pressione atmosferica"),
85447
86455
  label: t("Pressure", "Pressione"),
85448
- unitField: "pressureUnit",
86456
+ unit: "hPa",
85449
86457
  icon: "gauge"
85450
86458
  }
85451
86459
  ]
@@ -85750,8 +86758,47 @@ function projectAction(cap, action) {
85750
86758
  };
85751
86759
  }
85752
86760
  Object.entries(CAP_VOCABULARY_BY_NAME).flatMap(([cap, entry]) => entry.scope === "device" ? (entry.actions ?? []).map((a) => projectAction(cap, a)) : []);
85753
- 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;
86761
+ 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;
85754
86762
  DeviceFeature.BatteryOperated;
86763
+ DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
86764
+ 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.";
86765
+ 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.";
86766
+ var ALEXA_REASON = "Alexa has no laundry category in this export, and neither power nor running has an Alexa interface.";
86767
+ var GOOGLE_REASON = "Google WASHER, DRYER and DISHWASHER require RunCycle. A power threshold is not that trait, and this export does not publish RunCycle.";
86768
+ 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.";
86769
+ function withheld(reason) {
86770
+ return {
86771
+ [DeviceType.Washer]: {
86772
+ exported: false,
86773
+ reason
86774
+ },
86775
+ [DeviceType.Dryer]: {
86776
+ exported: false,
86777
+ reason
86778
+ },
86779
+ [DeviceType.Dishwasher]: {
86780
+ exported: false,
86781
+ reason
86782
+ }
86783
+ };
86784
+ }
86785
+ function offered(received) {
86786
+ return {
86787
+ [DeviceType.Washer]: {
86788
+ exported: true,
86789
+ as: received
86790
+ },
86791
+ [DeviceType.Dryer]: {
86792
+ exported: true,
86793
+ as: received
86794
+ },
86795
+ [DeviceType.Dishwasher]: {
86796
+ exported: true,
86797
+ as: received
86798
+ }
86799
+ };
86800
+ }
86801
+ offered(HA_AS), withheld(HOMEKIT_REASON), withheld(ALEXA_REASON), withheld(GOOGLE_REASON), withheld(MATTER_REASON);
85755
86802
  /** Reject after `ms`; always clears its own timer. */
85756
86803
  async function withTimeout$1(promise, ms, label) {
85757
86804
  let timer;
@@ -86936,6 +87983,21 @@ Object.freeze({
86936
87983
  form: "single",
86937
87984
  optional: false
86938
87985
  }],
87986
+ "groupActive.getStatus": [{
87987
+ name: "deviceId",
87988
+ form: "single",
87989
+ optional: false
87990
+ }],
87991
+ "groupCommands.getStatus": [{
87992
+ name: "deviceId",
87993
+ form: "single",
87994
+ optional: false
87995
+ }],
87996
+ "groupStatus.getStatus": [{
87997
+ name: "deviceId",
87998
+ form: "single",
87999
+ optional: false
88000
+ }],
86939
88001
  "heatingValve.getStatus": [{
86940
88002
  name: "deviceId",
86941
88003
  form: "single",
@@ -87136,6 +88198,11 @@ Object.freeze({
87136
88198
  form: "single",
87137
88199
  optional: false
87138
88200
  }],
88201
+ "meter.getStatus": [{
88202
+ name: "deviceId",
88203
+ form: "single",
88204
+ optional: false
88205
+ }],
87139
88206
  "motion.getStatus": [{
87140
88207
  name: "deviceId",
87141
88208
  form: "single",
@@ -88743,7 +89810,6 @@ Object.freeze({
88743
89810
  "network-access": "ingress",
88744
89811
  "smtp-provider": "email"
88745
89812
  });
88746
- DeviceType.Camera;
88747
89813
  /**
88748
89814
  * A saved Customize assignment (D936). The schema is the type: callers use
88749
89815
  * `z.infer`, they do not restate the shape.
@@ -88920,6 +89986,8 @@ new Map(Object.entries({
88920
89986
  "detection-blind": "device-events",
88921
89987
  "motion-noisy": "device-events",
88922
89988
  "motion-calm": "device-events",
89989
+ "package-llm-silent": "device-events",
89990
+ "package-llm-answered": "device-events",
88923
89991
  "recording-stalled": "device-events",
88924
89992
  "recording-healthy": "device-events",
88925
89993
  "recording-degraded": "device-events",
@@ -89003,6 +90071,12 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
89003
90071
  label: "Motion without a subject",
89004
90072
  kinds: ["motion-noisy", "motion-calm"]
89005
90073
  },
90074
+ {
90075
+ id: "package-llm",
90076
+ family: "device-events",
90077
+ label: "Package confirm",
90078
+ kinds: ["package-llm-silent", "package-llm-answered"]
90079
+ },
89006
90080
  {
89007
90081
  id: "recording",
89008
90082
  family: "device-events",
@@ -89184,6 +90258,8 @@ var DEVICE_EVENTS = [
89184
90258
  "detection-blind",
89185
90259
  "motion-noisy",
89186
90260
  "motion-calm",
90261
+ "package-llm-silent",
90262
+ "package-llm-answered",
89187
90263
  "recording-stalled",
89188
90264
  "recording-healthy",
89189
90265
  "recording-degraded",
@@ -89452,6 +90528,15 @@ new Map([
89452
90528
  snapshotLabel: "Cameras with constant motion now",
89453
90529
  snapshotSection: null
89454
90530
  },
90531
+ {
90532
+ id: "package-llm-confirm",
90533
+ family: "device-events",
90534
+ label: "Package confirm (not answering / answering again)",
90535
+ bad: ["package-llm-silent"],
90536
+ recovery: ["package-llm-answered"],
90537
+ snapshotLabel: "Cameras whose package confirm is not answering",
90538
+ snapshotSection: null
90539
+ },
89455
90540
  {
89456
90541
  id: "recording-health",
89457
90542
  family: "device-events",