@camstack/addon-provider-hikvision 1.2.176 → 1.2.178

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/addon.js CHANGED
@@ -34,7 +34,7 @@ let node_os = require("node:os");
34
34
  let node_net = require("node:net");
35
35
  let node_http = require("node:http");
36
36
  let node_https = require("node:https");
37
- //#region ../types/dist/event-category-CT-hz5Rb.mjs
37
+ //#region ../types/dist/event-category-DmZDPDf_.mjs
38
38
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
39
39
  EventCategory["SystemBoot"] = "system.boot";
40
40
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -661,7 +661,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
661
661
  * (a track was promoted to a stationary-registry entry) or departs (the
662
662
  * object moved / was removed). Telemetry (D8): lossy, drives a UI refresh of
663
663
  * the dedicated "Stationary" section — never the live event feed. Payload:
664
- * `{ deviceId, entryId, className, phase:'appeared'|'departed', timestamp }`.
664
+ * `{ deviceId, entryId, className, phase:'appeared'|'departed', timestamp, observedAt, zones }`.
665
665
  */
666
666
  EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
667
667
  /**
@@ -799,6 +799,11 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
799
799
  */
800
800
  EventCategory["AccessoriesChanged"] = "accessories.onAccessoriesChanged";
801
801
  /**
802
+ * An action run started or ended. Emitted by the `actions` surface.
803
+ * Payload: `ActionRunChanged` (`{ actionId, runId, isRunning, outcome?, lastRunAt, lastError }`).
804
+ */
805
+ EventCategory["ActionsRunChanged"] = "actions.onRunChanged";
806
+ /**
802
807
  * Progress update from a running model conversion job.
803
808
  * Payload: `{ kind: 'model-convert', phase, sessionId?, pct?, detail? }`.
804
809
  * Emitted by `addon-model-studio` on the converting node.
@@ -5477,7 +5482,7 @@ var ZodIssueCode = {
5477
5482
  var ZodFirstPartyTypeKind;
5478
5483
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5479
5484
  //#endregion
5480
- //#region ../types/dist/sleep-bykKrTgu.mjs
5485
+ //#region ../types/dist/sleep-Crlmu_tO.mjs
5481
5486
  /**
5482
5487
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5483
5488
  * window to float samples (D455).
@@ -8609,6 +8614,8 @@ Object.freeze({ "doorbell": "lastPressedAt" });
8609
8614
  /** Every capability name, so addon code can check a name without the schema graph. */
8610
8615
  var CAP_NAMES = Object.freeze([
8611
8616
  "accessories",
8617
+ "action-source",
8618
+ "actions",
8612
8619
  "addon-pages",
8613
8620
  "addon-pages-source",
8614
8621
  "addon-routes",
@@ -8682,6 +8689,7 @@ var CAP_NAMES = Object.freeze([
8682
8689
  "filesystem-browse",
8683
8690
  "flood",
8684
8691
  "gas",
8692
+ "group-active",
8685
8693
  "group-commands",
8686
8694
  "group-status",
8687
8695
  "heating-valve",
@@ -8704,6 +8712,7 @@ var CAP_NAMES = Object.freeze([
8704
8712
  "login-method",
8705
8713
  "media-player",
8706
8714
  "mesh-network",
8715
+ "meter",
8707
8716
  "metrics-provider",
8708
8717
  "model-convert",
8709
8718
  "model-distributor",
@@ -8795,11 +8804,11 @@ var CAP_NAMES = Object.freeze([
8795
8804
  Object.freeze({
8796
8805
  "air-quality-sensor": [
8797
8806
  {
8798
- "path": "co2Ppm",
8807
+ "path": "co2",
8799
8808
  "valueType": "number"
8800
8809
  },
8801
8810
  {
8802
- "path": "vocPpb",
8811
+ "path": "voc",
8803
8812
  "valueType": "number"
8804
8813
  },
8805
8814
  {
@@ -8849,7 +8858,7 @@ Object.freeze({
8849
8858
  }
8850
8859
  ],
8851
8860
  "ambient-light-sensor": [{
8852
- "path": "lux",
8861
+ "path": "illuminance",
8853
8862
  "valueType": "number"
8854
8863
  }],
8855
8864
  "audio-metrics": [
@@ -8910,7 +8919,7 @@ Object.freeze({
8910
8919
  ],
8911
8920
  "battery": [
8912
8921
  {
8913
- "path": "percentage",
8922
+ "path": "level",
8914
8923
  "valueType": "number"
8915
8924
  },
8916
8925
  {
@@ -8932,7 +8941,7 @@ Object.freeze({
8932
8941
  "valueType": "number"
8933
8942
  },
8934
8943
  {
8935
- "path": "volts",
8944
+ "path": "voltage",
8936
8945
  "valueType": "number"
8937
8946
  },
8938
8947
  {
@@ -8953,7 +8962,7 @@ Object.freeze({
8953
8962
  "valueType": "boolean"
8954
8963
  }],
8955
8964
  "brightness": [{
8956
- "path": "percentage",
8965
+ "path": "level",
8957
8966
  "valueType": "number"
8958
8967
  }],
8959
8968
  "broker": [{
@@ -9154,7 +9163,7 @@ Object.freeze({
9154
9163
  "valueType": "number"
9155
9164
  },
9156
9165
  {
9157
- "path": "mireds",
9166
+ "path": "colorTemperature",
9158
9167
  "valueType": "number"
9159
9168
  }
9160
9169
  ],
@@ -9333,15 +9342,15 @@ Object.freeze({
9333
9342
  "valueType": "string"
9334
9343
  },
9335
9344
  {
9336
- "path": "remainingSeconds",
9345
+ "path": "remaining",
9337
9346
  "valueType": "number"
9338
9347
  },
9339
9348
  {
9340
- "path": "delayedStartSeconds",
9349
+ "path": "delayedStart",
9341
9350
  "valueType": "number"
9342
9351
  },
9343
9352
  {
9344
- "path": "progressPercent",
9353
+ "path": "progress",
9345
9354
  "valueType": "number"
9346
9355
  },
9347
9356
  {
@@ -9455,7 +9464,7 @@ Object.freeze({
9455
9464
  ],
9456
9465
  "fan-control": [
9457
9466
  {
9458
- "path": "percentage",
9467
+ "path": "speed",
9459
9468
  "valueType": "number"
9460
9469
  },
9461
9470
  {
@@ -9502,6 +9511,10 @@ Object.freeze({
9502
9511
  "path": "detected",
9503
9512
  "valueType": "boolean"
9504
9513
  }],
9514
+ "group-active": [{
9515
+ "path": "active",
9516
+ "valueType": "boolean"
9517
+ }],
9505
9518
  "group-status": [
9506
9519
  {
9507
9520
  "path": "included",
@@ -9551,7 +9564,7 @@ Object.freeze({
9551
9564
  }
9552
9565
  ],
9553
9566
  "humidity-sensor": [{
9554
- "path": "percent",
9567
+ "path": "humidity",
9555
9568
  "valueType": "number"
9556
9569
  }],
9557
9570
  "image": [{
@@ -9661,7 +9674,7 @@ Object.freeze({
9661
9674
  "valueType": "number"
9662
9675
  },
9663
9676
  {
9664
- "path": "progressPercent",
9677
+ "path": "progress",
9665
9678
  "valueType": "number"
9666
9679
  },
9667
9680
  {
@@ -9740,11 +9753,11 @@ Object.freeze({
9740
9753
  "valueType": "string"
9741
9754
  },
9742
9755
  {
9743
- "path": "positionMs",
9756
+ "path": "position",
9744
9757
  "valueType": "number"
9745
9758
  },
9746
9759
  {
9747
- "path": "durationMs",
9760
+ "path": "duration",
9748
9761
  "valueType": "number"
9749
9762
  },
9750
9763
  {
@@ -9761,6 +9774,10 @@ Object.freeze({
9761
9774
  ]
9762
9775
  }
9763
9776
  ],
9777
+ "meter": [{
9778
+ "path": "value",
9779
+ "valueType": "number"
9780
+ }],
9764
9781
  "motion": [
9765
9782
  {
9766
9783
  "path": "detected",
@@ -9842,11 +9859,11 @@ Object.freeze({
9842
9859
  ]
9843
9860
  },
9844
9861
  {
9845
- "path": "signalPercent",
9862
+ "path": "signal",
9846
9863
  "valueType": "number"
9847
9864
  },
9848
9865
  {
9849
- "path": "rssiDbm",
9866
+ "path": "rssi",
9850
9867
  "valueType": "number"
9851
9868
  },
9852
9869
  {
@@ -9901,6 +9918,18 @@ Object.freeze({
9901
9918
  "path": "foodLevel",
9902
9919
  "valueType": "number"
9903
9920
  },
9921
+ {
9922
+ "path": "bowlFood",
9923
+ "valueType": "number"
9924
+ },
9925
+ {
9926
+ "path": "eating",
9927
+ "valueType": "boolean"
9928
+ },
9929
+ {
9930
+ "path": "supportsMarkRefilled",
9931
+ "valueType": "boolean"
9932
+ },
9904
9933
  {
9905
9934
  "path": "food1",
9906
9935
  "valueType": "number"
@@ -9965,23 +9994,23 @@ Object.freeze({
9965
9994
  ],
9966
9995
  "power-meter": [
9967
9996
  {
9968
- "path": "watts",
9997
+ "path": "power",
9969
9998
  "valueType": "number"
9970
9999
  },
9971
10000
  {
9972
- "path": "kwhTotal",
10001
+ "path": "energy",
9973
10002
  "valueType": "number"
9974
10003
  },
9975
10004
  {
9976
- "path": "volts",
10005
+ "path": "voltage",
9977
10006
  "valueType": "number"
9978
10007
  },
9979
10008
  {
9980
- "path": "amps",
10009
+ "path": "current",
9981
10010
  "valueType": "number"
9982
10011
  },
9983
10012
  {
9984
- "path": "va",
10013
+ "path": "apparentPower",
9985
10014
  "valueType": "number"
9986
10015
  },
9987
10016
  {
@@ -10009,14 +10038,10 @@ Object.freeze({
10009
10038
  {
10010
10039
  "path": "gps.accuracyMeters",
10011
10040
  "valueType": "number"
10012
- },
10013
- {
10014
- "path": "batteryPercent",
10015
- "valueType": "number"
10016
10041
  }
10017
10042
  ],
10018
10043
  "pressure-sensor": [{
10019
- "path": "hpa",
10044
+ "path": "pressure",
10020
10045
  "valueType": "number"
10021
10046
  }],
10022
10047
  "privacy-mask": [{
@@ -10330,7 +10355,7 @@ Object.freeze({
10330
10355
  "valueType": "boolean"
10331
10356
  }],
10332
10357
  "temperature-sensor": [{
10333
- "path": "celsius",
10358
+ "path": "temperature",
10334
10359
  "valueType": "number"
10335
10360
  }],
10336
10361
  "update": [
@@ -10378,7 +10403,7 @@ Object.freeze({
10378
10403
  "valueType": "string"
10379
10404
  },
10380
10405
  {
10381
- "path": "progressPercent",
10406
+ "path": "progress",
10382
10407
  "valueType": "number"
10383
10408
  },
10384
10409
  {
@@ -10518,7 +10543,7 @@ function userError(code, params, englishFallback) {
10518
10543
  return new CamstackError(code, params, englishFallback);
10519
10544
  }
10520
10545
  //#endregion
10521
- //#region ../types/dist/err-msg-BXKzRBwg.mjs
10546
+ //#region ../types/dist/err-msg-DIorGYeC.mjs
10522
10547
  var DeviceType = /* @__PURE__ */ function(DeviceType) {
10523
10548
  DeviceType["Camera"] = "camera";
10524
10549
  DeviceType["Hub"] = "hub";
@@ -10612,8 +10637,14 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
10612
10637
  DeviceType["PetFeeder"] = "pet-feeder";
10613
10638
  /** Built-in dishwasher — program lifecycle, door / remote-start gates,
10614
10639
  * salt and rinse-aid levels. Installed with the `dishwasher` cap.
10615
- * Sources: native Bosch Home Connect, reusable by similar integrations. */
10640
+ * Sources: native Bosch Home Connect, reusable by similar integrations.
10641
+ * A plug-built dishwasher carries running-state and power instead. */
10616
10642
  DeviceType["Dishwasher"] = "dishwasher";
10643
+ /** Washing machine. A plug-built one is running while its power stays
10644
+ * above a threshold. No program cap — that surface is the dishwasher's. */
10645
+ DeviceType["Washer"] = "washer";
10646
+ /** Tumble dryer. Same plug-built running surface as {@link Washer}. */
10647
+ DeviceType["Dryer"] = "dryer";
10617
10648
  return DeviceType;
10618
10649
  }({});
10619
10650
  var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
@@ -10861,7 +10892,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
10861
10892
  return DeviceRole;
10862
10893
  }({});
10863
10894
  //#endregion
10864
- //#region ../types/dist/composition-OhpuespA.mjs
10895
+ //#region ../types/dist/composition-CZImLpOI.mjs
10865
10896
  /**
10866
10897
  * The ffmpeg build every CamStack node downloads, per platform and arch.
10867
10898
  *
@@ -11176,6 +11207,13 @@ var table = {
11176
11207
  apply: () => {
11177
11208
  throw new ExpressionEvalError("latchedAt: stateful evaluation context is required");
11178
11209
  }
11210
+ },
11211
+ schmitt: {
11212
+ minArgs: 3,
11213
+ maxArgs: 5,
11214
+ apply: () => {
11215
+ throw new ExpressionEvalError("schmitt: stateful evaluation context is required");
11216
+ }
11179
11217
  }
11180
11218
  };
11181
11219
  Object.freeze(Object.assign(Object.create(null), table));
@@ -11617,6 +11655,99 @@ function validateExpressionSource(src) {
11617
11655
  return null;
11618
11656
  }
11619
11657
  /**
11658
+ * One power reading becomes a washer, dryer or dishwasher (D944 helper).
11659
+ *
11660
+ * Standby of the control board is under 5 W; a motor or a heater is far
11661
+ * above that, so 5 W is the line. A door lock or a short pump spike is not
11662
+ * a cycle, so running starts only after 30 s above the line.
11663
+ *
11664
+ * A wash, dry or dishwasher pause (soak, heat-wait, heater off between
11665
+ * bursts) lasts several minutes. Ending the cycle on the first dip would
11666
+ * report "finished" in the middle of the program, so the stop dwell is
11667
+ * 10 minutes on every type. The number is stored per type so one machine
11668
+ * can move later without moving the others.
11669
+ */
11670
+ var APPLIANCE_TEMPLATE_ID = "appliance";
11671
+ var APPLIANCE_KINDS = [
11672
+ "washer",
11673
+ "dryer",
11674
+ "dishwasher"
11675
+ ];
11676
+ DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
11677
+ /**
11678
+ * Statistics and integrals over a history read (D944).
11679
+ *
11680
+ * Pure: the same points always give the same answer, so a restart recomputes
11681
+ * rather than trusting a buffer. A gauge mean is time-weighted (value × ms),
11682
+ * never the mean of the samples. A hole with no held value is not integrated
11683
+ * as zero. A truncated read is not published.
11684
+ */
11685
+ var STATISTIC_STATS = [
11686
+ "min",
11687
+ "max",
11688
+ "mean",
11689
+ "sum",
11690
+ "count",
11691
+ "change"
11692
+ ];
11693
+ /**
11694
+ * The range a statistics or integral helper asks history for (D944).
11695
+ *
11696
+ * Calendar edges are the hub's timezone, never UTC midnight: a day is 23, 24
11697
+ * or 25 hours across a DST change. A tier is eligible only when its retention
11698
+ * is strictly longer than the longest that range can be. Forever qualifies.
11699
+ * Equal to a tier's retention is a refusal, not a short answer.
11700
+ */
11701
+ var MINUTE_MS = 6e4;
11702
+ var HOUR_MS = 60 * MINUTE_MS;
11703
+ var DAY_MS = 24 * HOUR_MS;
11704
+ var ROLLING_SPANS = [
11705
+ "1h",
11706
+ "24h",
11707
+ "2d",
11708
+ "7d",
11709
+ "30d",
11710
+ "custom"
11711
+ ];
11712
+ var CALENDAR_PERIODS = [
11713
+ "today",
11714
+ "yesterday",
11715
+ "this-week",
11716
+ "this-month"
11717
+ ];
11718
+ var RESET_PERIODS = [
11719
+ "never",
11720
+ "daily",
11721
+ "weekly",
11722
+ "monthly"
11723
+ ];
11724
+ 5 * MINUTE_MS;
11725
+ 24 * HOUR_MS, 2 * DAY_MS, 7 * DAY_MS, 30 * DAY_MS;
11726
+ 7 * DAY_MS, 30 * DAY_MS, 365 * DAY_MS;
11727
+ var rollingWindowObject = object({
11728
+ kind: literal("rolling"),
11729
+ span: _enum(ROLLING_SPANS),
11730
+ customMinutes: number().int().min(5).optional()
11731
+ }).check((payload) => {
11732
+ if (payload.value.span === "custom" && payload.value.customMinutes === void 0) payload.issues.push({
11733
+ code: "custom",
11734
+ message: "a custom range needs a duration in minutes",
11735
+ path: ["customMinutes"],
11736
+ input: payload.value
11737
+ });
11738
+ if (payload.value.span !== "custom" && payload.value.customMinutes !== void 0) payload.issues.push({
11739
+ code: "custom",
11740
+ message: "only a custom range carries a duration",
11741
+ path: ["customMinutes"],
11742
+ input: payload.value
11743
+ });
11744
+ });
11745
+ var RollingWindowSchema = rollingWindowObject;
11746
+ var StatisticWindowSchema = discriminatedUnion("kind", [rollingWindowObject, object({
11747
+ kind: literal("calendar"),
11748
+ period: _enum(CALENDAR_PERIODS)
11749
+ })]);
11750
+ /**
11620
11751
  * A composition source identity: `(addonId, stableId)`, never a numeric device
11621
11752
  * id. Split out so helper schemas can name it without a cycle through
11622
11753
  * `composition.ts` (D659).
@@ -11642,7 +11773,13 @@ var GROUP_TEMPLATE_IDS = [
11642
11773
  "occupancy",
11643
11774
  "binary",
11644
11775
  "switch",
11645
- "light"
11776
+ "light",
11777
+ "fan",
11778
+ "cover",
11779
+ "valve",
11780
+ "lock",
11781
+ "media-player",
11782
+ "climate"
11646
11783
  ];
11647
11784
  var NUMERIC_AGGREGATES = [
11648
11785
  "mean",
@@ -11672,14 +11809,73 @@ var HelperMemberSchema = object({
11672
11809
  cap: string().min(1),
11673
11810
  fieldPath: string().min(1)
11674
11811
  });
11675
- var HelperSpecSchema = discriminatedUnion("kind", [object({
11676
- kind: literal("group"),
11677
- templateId: GroupTemplateIdSchema,
11678
- aggregate: AggregateReducerSchema,
11679
- members: array(HelperMemberSchema).min(1).max(64),
11680
- /** Actuator groups only. Readings leave this unset. */
11681
- active: ActiveCriterionSchema.optional()
11682
- })]);
11812
+ var HelperSpecSchema = discriminatedUnion("kind", [
11813
+ object({
11814
+ kind: literal("group"),
11815
+ templateId: GroupTemplateIdSchema,
11816
+ aggregate: AggregateReducerSchema,
11817
+ members: array(HelperMemberSchema).min(1).max(64),
11818
+ /** Actuator groups only. Readings leave this unset. */
11819
+ active: ActiveCriterionSchema.optional()
11820
+ }),
11821
+ object({
11822
+ kind: literal("appliance"),
11823
+ templateId: literal(APPLIANCE_TEMPLATE_ID),
11824
+ appliance: _enum(APPLIANCE_KINDS),
11825
+ thresholdWatts: number().positive(),
11826
+ startDwellMs: number().int().nonnegative(),
11827
+ stopDwellMs: number().int().nonnegative(),
11828
+ member: HelperMemberSchema
11829
+ }),
11830
+ object({
11831
+ kind: literal("statistic"),
11832
+ stat: _enum(STATISTIC_STATS),
11833
+ window: StatisticWindowSchema,
11834
+ source: HelperMemberSchema
11835
+ }),
11836
+ object({
11837
+ kind: literal("integral"),
11838
+ reset: _enum(RESET_PERIODS),
11839
+ output: _enum(["energy", "meter"]),
11840
+ source: HelperMemberSchema
11841
+ }),
11842
+ object({
11843
+ kind: literal("threshold"),
11844
+ source: HelperMemberSchema,
11845
+ high: number(),
11846
+ low: number(),
11847
+ onForMs: number().int().nonnegative(),
11848
+ offForMs: number().int().nonnegative()
11849
+ }),
11850
+ object({
11851
+ kind: literal("arithmetic"),
11852
+ op: _enum([
11853
+ "sum",
11854
+ "difference",
11855
+ "ratio"
11856
+ ]),
11857
+ inputs: array(HelperMemberSchema).min(2).max(64)
11858
+ }),
11859
+ object({
11860
+ kind: literal("expression"),
11861
+ expr: string().min(1),
11862
+ inputs: array(object({
11863
+ name: string().min(1),
11864
+ member: HelperMemberSchema
11865
+ })).min(1).max(64),
11866
+ output: _enum(["number", "boolean"])
11867
+ }),
11868
+ object({
11869
+ kind: literal("derivative"),
11870
+ window: RollingWindowSchema,
11871
+ per: _enum([
11872
+ "second",
11873
+ "minute",
11874
+ "hour"
11875
+ ]),
11876
+ source: HelperMemberSchema
11877
+ })
11878
+ ]);
11683
11879
  /** A composed device's stableId is this prefix plus the block id. */
11684
11880
  var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
11685
11881
  /** Longest snippet a `code` source may carry (slice 4). */
@@ -11740,6 +11936,12 @@ var CompositionFieldSourceSchema = discriminatedUnion("kind", [
11740
11936
  "all"
11741
11937
  ]),
11742
11938
  reads: array(CompositionFieldReadSchema).min(1).max(64),
11939
+ /**
11940
+ * Set when the reads are an enum state, not a yes/no: the listed states
11941
+ * count as active (a cover is `open`). A state outside the list is inactive;
11942
+ * a read that is not a state at all is left out. Only `any` / `all` use it.
11943
+ */
11944
+ activeWhen: array(string().min(1)).min(1).optional(),
11743
11945
  /** `value` is the reading; the others are the member counts. */
11744
11946
  publish: _enum([
11745
11947
  "value",
@@ -11753,6 +11955,26 @@ var CompositionFieldSourceSchema = discriminatedUnion("kind", [
11753
11955
  "omit",
11754
11956
  "offline"
11755
11957
  ])
11958
+ }),
11959
+ object({
11960
+ kind: literal("series"),
11961
+ read: CompositionFieldReadSchema,
11962
+ /** `value` is the statistic or the integral. The others are the gap counts. */
11963
+ publish: _enum([
11964
+ "value",
11965
+ "included",
11966
+ "excluded",
11967
+ "total"
11968
+ ]),
11969
+ /**
11970
+ * What an unanswered `value` does. Counts ignore this. `offline` leaves the
11971
+ * device unseeded until history answers, so a restart cannot publish 0.
11972
+ */
11973
+ empty: _enum([
11974
+ "null",
11975
+ "omit",
11976
+ "offline"
11977
+ ])
11756
11978
  })
11757
11979
  ]);
11758
11980
  var CompositionCommandTargetSchema = discriminatedUnion("kind", [object({
@@ -15509,6 +15731,14 @@ var AutomationConditionLeafSchema = object({
15509
15731
  array(union([string(), number()]))
15510
15732
  ])
15511
15733
  });
15734
+ var AutomationConditionStationaryPresentSchema = object({
15735
+ kind: literal("stationary-present"),
15736
+ deviceId: number().int().nonnegative(),
15737
+ /** Class names; a macro class matches every raw class that maps to it. */
15738
+ classes: array(string().min(1)).min(1).optional(),
15739
+ /** The parked object must be in at least one of these zones. */
15740
+ zones: array(string().min(1)).min(1).optional()
15741
+ });
15512
15742
  /**
15513
15743
  * The expression leaf, declared as a plain object rather than an intersection
15514
15744
  * with {@link ExpressionSourceSchema}: a discriminated union has to be able to
@@ -15542,7 +15772,8 @@ var AutomationConditionSchema = lazy(() => discriminatedUnion("kind", [
15542
15772
  child: AutomationConditionSchema
15543
15773
  }),
15544
15774
  AutomationConditionLeafSchema,
15545
- AutomationConditionExpressionSchema
15775
+ AutomationConditionExpressionSchema,
15776
+ AutomationConditionStationaryPresentSchema
15546
15777
  ]));
15547
15778
  /**
15548
15779
  * What starts a run.
@@ -15583,7 +15814,34 @@ var AutomationTriggerSchema = discriminatedUnion("kind", [
15583
15814
  kind: literal("schedule"),
15584
15815
  cron: string().min(1).max(120)
15585
15816
  }),
15586
- object({ kind: literal("manual") })
15817
+ object({ kind: literal("manual") }),
15818
+ object({
15819
+ kind: literal("detection"),
15820
+ /** Class names. A macro class (`animal`, `vehicle`, `person`, `package`)
15821
+ * matches every raw class that maps to it; any other name matches
15822
+ * exactly. */
15823
+ classes: array(string().min(1)).min(1),
15824
+ deviceIds: array(number().int().nonnegative()).min(1),
15825
+ /** The track must have visited at least one of these zones. */
15826
+ zones: array(string().min(1)).min(1).optional(),
15827
+ /** Best-so-far confidence the track must reach. */
15828
+ minScore: number().min(0).max(1).optional()
15829
+ }),
15830
+ object({
15831
+ kind: literal("stationary"),
15832
+ deviceIds: array(number().int().nonnegative()).min(1),
15833
+ /** Class names; a macro class matches like the detection trigger. */
15834
+ classes: array(string().min(1)).min(1).optional(),
15835
+ /** The parked object must be in at least one of these zones. */
15836
+ zones: array(string().min(1)).min(1).optional(),
15837
+ /** `appeared`: it became parked. `departed`: the registry retired it.
15838
+ * The vocabulary of `PipelineAnalyticsStationaryChanged`. */
15839
+ phase: _enum(["appeared", "departed"])
15840
+ }),
15841
+ object({
15842
+ kind: literal("interval"),
15843
+ minutes: number().int().min(1).max(1440)
15844
+ })
15587
15845
  ]);
15588
15846
  /**
15589
15847
  * One action step.
@@ -15603,28 +15861,47 @@ var AutomationTriggerSchema = discriminatedUnion("kind", [
15603
15861
  * is called. The runner still receives a number and is untouched; the
15604
15862
  * resolution is the recipe's job, not the runner's.
15605
15863
  */
15864
+ var AutomationWaitStepSchema = object({
15865
+ kind: literal("wait"),
15866
+ seconds: number().min(0).max(300)
15867
+ });
15868
+ var AutomationCapStepSchema = object({
15869
+ kind: literal("cap"),
15870
+ /**
15871
+ * One device, several same-family devices (locks / climate family / …),
15872
+ * or `{ $var }` for the device that triggered the run. An array is
15873
+ * fan-out at codegen — each id gets the same cap.method call.
15874
+ */
15875
+ deviceId: union([
15876
+ number().int(),
15877
+ array(number().int()).min(1),
15878
+ object({ $var: string().min(1) })
15879
+ ]),
15880
+ cap: string().min(1),
15881
+ method: string().min(1),
15882
+ /** Values may carry `{{vars.x}}` slots, or be exactly `{ $var: 'name' }`, which
15883
+ * SUBSTITUTE and do not evaluate (§3.2.3). Anything beyond substitution is
15884
+ * the expression leaf. */
15885
+ args: record(string(), unknown()).optional()
15886
+ });
15887
+ /**
15888
+ * The steps an internal Action may contain: cap and wait, and nothing that can
15889
+ * call back into an Action — so an Action can never reach itself (no cycles).
15890
+ */
15891
+ var ActionStepSchema = discriminatedUnion("kind", [AutomationWaitStepSchema, AutomationCapStepSchema]);
15606
15892
  var AutomationActionSchema = discriminatedUnion("kind", [
15893
+ AutomationWaitStepSchema,
15894
+ AutomationCapStepSchema,
15607
15895
  object({
15608
- kind: literal("wait"),
15609
- seconds: number().min(0).max(300)
15610
- }),
15611
- object({
15612
- kind: literal("cap"),
15613
- /**
15614
- * One device, several same-family devices (locks / climate family / …),
15615
- * or `{ $var }` for the device that triggered the run. An array is
15616
- * fan-out at codegen — each id gets the same cap.method call.
15617
- */
15618
- deviceId: union([
15619
- number().int(),
15620
- array(number().int()).min(1),
15621
- object({ $var: string().min(1) })
15622
- ]),
15623
- cap: string().min(1),
15624
- method: string().min(1),
15625
- /** Values may carry `{{vars.x}}` slots, which SUBSTITUTE and do not
15626
- * evaluate (§3.2.3). Anything beyond substitution is the expression leaf. */
15627
- args: record(string(), unknown()).optional()
15896
+ kind: literal("action"),
15897
+ /** An entry of the `actions` surface (`internal:<uuid>` or `<addonId>:<localId>`). */
15898
+ actionId: string().min(1),
15899
+ /** Values for the action's declared variables; the others take their default. */
15900
+ variables: record(string(), union([
15901
+ string(),
15902
+ number(),
15903
+ boolean()
15904
+ ])).optional()
15628
15905
  }),
15629
15906
  object({
15630
15907
  kind: literal("code"),
@@ -15633,10 +15910,357 @@ var AutomationActionSchema = discriminatedUnion("kind", [
15633
15910
  code: string().min(1).max(2e4)
15634
15911
  })
15635
15912
  ]);
15913
+ /**
15914
+ * How a trigger that arrives while the automation is busy (or cooling down) is
15915
+ * handled. One of the automation's execution modes, never a property of its
15916
+ * actions. Absent means `single`.
15917
+ *
15918
+ * - `single` — drop the trigger while a run is in progress (traced + logged).
15919
+ * - `restart` — abort the run in progress (at its next step boundary), start fresh.
15920
+ * - `queued` — queue up to `max` triggers, drop the rest (traced).
15921
+ * - `parallel` — up to `max` runs at once, drop the rest (traced).
15922
+ * - `cooldown` — `single`, and no new run until `minutes` after the last run
15923
+ * STARTED; persisted across a restart. A manual trigger bypasses only this
15924
+ * wait, never the single/queued limits.
15925
+ */
15926
+ var AutomationRunModeSchema = discriminatedUnion("mode", [
15927
+ object({ mode: literal("single") }),
15928
+ object({ mode: literal("restart") }),
15929
+ object({
15930
+ mode: literal("queued"),
15931
+ max: number().int().min(1).max(10)
15932
+ }),
15933
+ object({
15934
+ mode: literal("parallel"),
15935
+ max: number().int().min(1).max(10)
15936
+ }),
15937
+ object({
15938
+ mode: literal("cooldown"),
15939
+ minutes: number().int().min(1).max(1440)
15940
+ })
15941
+ ]);
15636
15942
  var AutomationRecipeSchema = object({
15637
15943
  triggers: array(AutomationTriggerSchema),
15638
15944
  conditions: AutomationConditionSchema.optional(),
15639
- actions: array(AutomationActionSchema)
15945
+ actions: array(AutomationActionSchema),
15946
+ runMode: AutomationRunModeSchema.optional(),
15947
+ /** How many run traces the automation keeps (default {@link DEFAULT_TRACE_KEEP}). */
15948
+ keepTraces: number().int().min(1).max(100).optional()
15949
+ });
15950
+ new Set([
15951
+ {
15952
+ id: "person",
15953
+ name: "Person"
15954
+ },
15955
+ {
15956
+ id: "vehicle",
15957
+ name: "Vehicle"
15958
+ },
15959
+ {
15960
+ id: "animal",
15961
+ name: "Animal"
15962
+ },
15963
+ {
15964
+ id: "package",
15965
+ name: "Package"
15966
+ }
15967
+ ].map((l) => l.id));
15968
+ var COCO_TO_MACRO = {
15969
+ mapping: {
15970
+ person: "person",
15971
+ bicycle: "vehicle",
15972
+ car: "vehicle",
15973
+ motorcycle: "vehicle",
15974
+ airplane: "vehicle",
15975
+ bus: "vehicle",
15976
+ train: "vehicle",
15977
+ truck: "vehicle",
15978
+ boat: "vehicle",
15979
+ bird: "animal",
15980
+ cat: "animal",
15981
+ dog: "animal",
15982
+ horse: "animal",
15983
+ sheep: "animal",
15984
+ cow: "animal",
15985
+ elephant: "animal",
15986
+ bear: "animal",
15987
+ zebra: "animal",
15988
+ giraffe: "animal",
15989
+ suitcase: "package",
15990
+ backpack: "package",
15991
+ handbag: "package"
15992
+ },
15993
+ preserveOriginal: false
15994
+ };
15995
+ new Set(Object.values(COCO_TO_MACRO.mapping));
15996
+ /**
15997
+ * Run traces — what an automation (or, later, an Action run) DID, node by node,
15998
+ * so the editor can paint every block green or red with its reason.
15999
+ *
16000
+ * A trace is data, not a log: it covers the WHOLE tree — the trigger stage,
16001
+ * every condition node (containers and leaves, including the ones a
16002
+ * short-circuit never reached), the run-mode verdict and every action step —
16003
+ * each addressed by a stable path (`conditions.0.1`, `actions.2`, or `steps.N`
16004
+ * for an Action run). Skipped
16005
+ * evaluations are traced too, and identical consecutive skips collapse into a
16006
+ * repeat count so a trigger that fails every 5 minutes cannot flush real runs.
16007
+ *
16008
+ * {@link AutomationStepTraceSchema} is deliberately free of automation
16009
+ * vocabulary so an Action run records the same step shape.
16010
+ */
16011
+ /** A value a trace may show: JSON primitives and short lists, nothing deeper. */
16012
+ var TraceValueSchema = union([
16013
+ string(),
16014
+ number(),
16015
+ boolean(),
16016
+ _null(),
16017
+ array(union([string(), number()]))
16018
+ ]);
16019
+ var AutomationRunOutcomeSchema = _enum([
16020
+ "ran",
16021
+ "skipped-trigger",
16022
+ "skipped-conditions",
16023
+ "skipped-cooldown",
16024
+ "skipped-overlap",
16025
+ "failed",
16026
+ "aborted"
16027
+ ]);
16028
+ /** `not-evaluated` = a short-circuit never reached the node. */
16029
+ var TraceNodeOutcomeSchema = _enum([
16030
+ "pass",
16031
+ "fail",
16032
+ "not-evaluated"
16033
+ ]);
16034
+ var AutomationTriggerTraceSchema = object({
16035
+ kind: string().min(1),
16036
+ outcome: _enum(["pass", "fail"]),
16037
+ /** Why an event was rejected ("class person not in [dog]") or what fired. */
16038
+ reason: string(),
16039
+ /** deviceId, className, trackId, score … — only what the trigger exposes. */
16040
+ vars: record(string(), TraceValueSchema)
16041
+ });
16042
+ var AutomationConditionTraceNodeSchema = object({
16043
+ /** `conditions` for the root, `conditions.<i>` for its i-th child, … */
16044
+ path: string().min(1),
16045
+ kind: _enum([
16046
+ "all",
16047
+ "any",
16048
+ "not",
16049
+ "condition",
16050
+ "expression",
16051
+ "stationary-present"
16052
+ ]),
16053
+ outcome: TraceNodeOutcomeSchema,
16054
+ reason: string(),
16055
+ deviceId: number().int().optional(),
16056
+ cap: string().optional(),
16057
+ fieldPath: string().optional(),
16058
+ operator: string().optional(),
16059
+ expected: TraceValueSchema.optional(),
16060
+ /** What the mirror held; `null` when it held nothing (unknown). */
16061
+ observed: TraceValueSchema.optional()
16062
+ });
16063
+ var AutomationRunVerdictSchema = object({
16064
+ mode: AutomationRunModeSchema,
16065
+ decision: _enum([
16066
+ "run",
16067
+ "queued",
16068
+ "restart",
16069
+ "drop",
16070
+ "cooldown",
16071
+ "bypass"
16072
+ ]),
16073
+ reason: string()
16074
+ });
16075
+ /** One executed (or not-run) step — shared by automations and Action runs. */
16076
+ var AutomationStepTraceSchema = object({
16077
+ /** `actions.<i>` */
16078
+ path: string().min(1),
16079
+ kind: string().min(1),
16080
+ cap: string().optional(),
16081
+ method: string().optional(),
16082
+ deviceId: number().int().optional(),
16083
+ startedAt: number().optional(),
16084
+ endedAt: number().optional(),
16085
+ outcome: _enum([
16086
+ "ok",
16087
+ "error",
16088
+ "not-run"
16089
+ ]),
16090
+ message: string().optional()
16091
+ });
16092
+ var AutomationRunTraceSchema = object({
16093
+ runId: string().min(1),
16094
+ startedAt: number(),
16095
+ endedAt: number(),
16096
+ trigger: AutomationTriggerTraceSchema,
16097
+ conditions: array(AutomationConditionTraceNodeSchema),
16098
+ verdict: AutomationRunVerdictSchema.optional(),
16099
+ steps: array(AutomationStepTraceSchema),
16100
+ outcome: AutomationRunOutcomeSchema,
16101
+ /** How many identical consecutive skips this trace stands for (>= 1). */
16102
+ repeat: number().int().min(1),
16103
+ /** When the latest of those repeats happened. */
16104
+ lastAt: number()
16105
+ });
16106
+ /**
16107
+ * What the hub's `runs` ledger holds for one owner (`automation:<blockId>` or
16108
+ * `action:<actionId>`): the cooldown stamp and the trace ring.
16109
+ */
16110
+ var AutomationStateDocSchema = object({
16111
+ version: literal(1),
16112
+ lastRunStartedAt: number().nullable(),
16113
+ traces: array(AutomationRunTraceSchema)
16114
+ });
16115
+ /**
16116
+ * Actions — named, runnable things an operator (or an automation) can start,
16117
+ * declared as LIST ENTRIES, never as devices.
16118
+ *
16119
+ * An entry is either **internal** (a short list of cap/wait steps kept in the
16120
+ * hub's `actions` record kind) or declared by an addon through the
16121
+ * `action-source` collection (a Home Assistant script, a scene …). The one
16122
+ * surface the UI and automations talk to is the `actions` cap; it keeps no
16123
+ * catalog of its own (D3) — every `list` asks the providers live.
16124
+ *
16125
+ * This file is the data half: the entry schema, the variables an entry may
16126
+ * declare, and the pure resolution of the values a run was given. It holds no
16127
+ * runtime.
16128
+ */
16129
+ /** What a variable's value is. `select` takes one of `options`. */
16130
+ var ActionVariableTypeSchema = _enum([
16131
+ "string",
16132
+ "number",
16133
+ "boolean",
16134
+ "select"
16135
+ ]);
16136
+ var ACTION_VARIABLE_NAME_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
16137
+ var ActionVariableValueSchema = union([
16138
+ string(),
16139
+ number(),
16140
+ boolean()
16141
+ ]);
16142
+ /**
16143
+ * One declared variable. Steps reference it as `{ $var: 'name' }` (the whole
16144
+ * value) or `{{vars.name}}` (inside a string) in their args.
16145
+ */
16146
+ var ActionVariableSchema = object({
16147
+ name: string().regex(ACTION_VARIABLE_NAME_RE),
16148
+ label: string().min(1).max(120).optional(),
16149
+ type: ActionVariableTypeSchema,
16150
+ required: boolean().optional(),
16151
+ default: ActionVariableValueSchema.optional(),
16152
+ /** The allowed values of a `select`. */
16153
+ options: array(string().min(1)).min(1).optional()
16154
+ }).superRefine((v, ctx) => {
16155
+ if (v.type === "select" && v.options === void 0) ctx.addIssue({
16156
+ code: "custom",
16157
+ message: "a select variable needs options",
16158
+ path: ["options"]
16159
+ });
16160
+ if (v.default !== void 0 && variableValueError(v, v.default) !== null) ctx.addIssue({
16161
+ code: "custom",
16162
+ message: variableValueError(v, v.default) ?? "invalid default",
16163
+ path: ["default"]
16164
+ });
16165
+ });
16166
+ /** Why `value` is not a legal value for the variable, or null when it is. */
16167
+ function variableValueError(variable, value) {
16168
+ switch (variable.type) {
16169
+ case "string": return typeof value === "string" ? null : `variable "${variable.name}" must be a string`;
16170
+ case "number": return typeof value === "number" && Number.isFinite(value) ? null : `variable "${variable.name}" must be a number`;
16171
+ case "boolean": return typeof value === "boolean" ? null : `variable "${variable.name}" must be true or false`;
16172
+ case "select": return typeof value === "string" && (variable.options ?? []).includes(value) ? null : `variable "${variable.name}" must be one of ${(variable.options ?? []).join(", ")}`;
16173
+ }
16174
+ }
16175
+ var ActionSourceKindSchema = _enum(["internal", "addon"]);
16176
+ function isInternalActionId(actionId) {
16177
+ return actionId.startsWith("internal:") && actionId.length > 9;
16178
+ }
16179
+ /** The addon behind a `<addonId>:<localId>` id, or null for anything else (internal included). */
16180
+ function addonIdOfActionId(actionId) {
16181
+ if (isInternalActionId(actionId)) return null;
16182
+ const at = actionId.indexOf(":");
16183
+ return at > 0 && at < actionId.length - 1 ? actionId.slice(0, at) : null;
16184
+ }
16185
+ var ActionStatusSchema = object({
16186
+ isRunning: boolean(),
16187
+ /** Ms epoch the latest run STARTED; null when it never ran. */
16188
+ lastRunAt: number().nullable(),
16189
+ /** The latest run's failure; null on success or when it never ran. */
16190
+ lastError: string().nullable()
16191
+ });
16192
+ var ActionEntrySchema = object({
16193
+ /** `internal:<uuid>` or `<addonId>:<localId>`. */
16194
+ id: string().min(3),
16195
+ name: string().min(1).max(120),
16196
+ /** The addon that declared it; `core-blocks` for an internal one. */
16197
+ addonId: string().min(1),
16198
+ source: ActionSourceKindSchema,
16199
+ /** An addon-declared entry is edited where it was declared. */
16200
+ readOnly: boolean(),
16201
+ /** Internal only: cap and wait steps. No action-in-action, so no cycles. */
16202
+ steps: array(ActionStepSchema).min(1).max(50).optional(),
16203
+ variables: array(ActionVariableSchema).max(20).optional(),
16204
+ status: ActionStatusSchema
16205
+ }).superRefine((entry, ctx) => {
16206
+ if (entry.source === "internal") {
16207
+ if (!isInternalActionId(entry.id)) ctx.addIssue({
16208
+ code: "custom",
16209
+ message: "an internal action id is internal:<uuid>",
16210
+ path: ["id"]
16211
+ });
16212
+ return;
16213
+ }
16214
+ if (entry.steps !== void 0) ctx.addIssue({
16215
+ code: "custom",
16216
+ message: "only an internal action carries steps",
16217
+ path: ["steps"]
16218
+ });
16219
+ if (!entry.readOnly) ctx.addIssue({
16220
+ code: "custom",
16221
+ message: "an addon action is read-only here",
16222
+ path: ["readOnly"]
16223
+ });
16224
+ if (addonIdOfActionId(entry.id) === null) ctx.addIssue({
16225
+ code: "custom",
16226
+ message: "an addon action id is <addonId>:<localId>",
16227
+ path: ["id"]
16228
+ });
16229
+ });
16230
+ /** What an operator writes for an internal action. */
16231
+ var ActionInputSchema = object({
16232
+ name: string().min(1).max(120),
16233
+ steps: array(ActionStepSchema).min(1).max(50),
16234
+ variables: array(ActionVariableSchema).max(20).optional()
16235
+ });
16236
+ /** Who started a run. Absent = the operator pressed it. */
16237
+ var ActionRunOriginSchema = object({
16238
+ /** The automation block whose step started it. */
16239
+ blockId: string().min(1).optional() });
16240
+ /** `started` = the caller did not ask to wait. */
16241
+ var ActionRunOutcomeSchema = union([AutomationRunOutcomeSchema, literal("started")]);
16242
+ var ActionRunResultSchema = object({
16243
+ runId: string().min(1),
16244
+ outcome: ActionRunOutcomeSchema,
16245
+ /** Why it did not run, or what failed. */
16246
+ message: string().optional()
16247
+ });
16248
+ _enum([
16249
+ "not-found",
16250
+ "read-only",
16251
+ "invalid-variables",
16252
+ "invalid-steps",
16253
+ "not-linked",
16254
+ "busy"
16255
+ ]);
16256
+ object({
16257
+ actionId: string(),
16258
+ runId: string(),
16259
+ isRunning: boolean(),
16260
+ /** Set when the run ended. */
16261
+ outcome: AutomationRunOutcomeSchema.optional(),
16262
+ lastRunAt: number().nullable(),
16263
+ lastError: string().nullable()
15640
16264
  });
15641
16265
  /**
15642
16266
  * `addon-pages` — system-scoped singleton aggregator cap. Public-facing
@@ -17231,7 +17855,22 @@ var BrokerProviderInfoSchema = object({
17231
17855
  */
17232
17856
  interactiveConnectPath: string().min(1).optional(),
17233
17857
  /** Relative hub path to disconnect the linked account (same popup pattern). */
17234
- interactiveDisconnectPath: string().min(1).optional()
17858
+ interactiveDisconnectPath: string().min(1).optional(),
17859
+ /**
17860
+ * The kind signs in through a server-held interactive session instead of
17861
+ * (or before) typed credentials. `basePath` is a hub-relative route set
17862
+ * served by the owning addon (`/addon/<id>/...`) speaking the sign-in
17863
+ * contract: `POST {basePath}/start` (body: the form's settings) answers
17864
+ * `{ sessionId, loginUrl }`; `GET {basePath}/status?sessionId=` answers
17865
+ * `{ phase: 'starting' | 'awaiting-login' | 'captured' | 'error' |
17866
+ * 'cancelled', loginUrl, error }`; `POST {basePath}/commit`
17867
+ * (`{ sessionId, name, brokerId? }`) stores the credentials on a new or
17868
+ * existing broker and answers `{ brokerId }`; `POST {basePath}/cancel`
17869
+ * (`{ sessionId }`) drops the session. The dialog that edits a broker
17870
+ * offers it as the default path; the fields the session fills are
17871
+ * marked `filledBySignIn` in the kind's settings schema.
17872
+ */
17873
+ signIn: object({ basePath: string().min(1) }).optional()
17235
17874
  }))
17236
17875
  });
17237
17876
  var ListInputSchema = object({
@@ -18308,7 +18947,7 @@ var CompositionEventPlanSchema = object({
18308
18947
  stateField: string(),
18309
18948
  fieldKey: string()
18310
18949
  });
18311
- /** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.celsius`. */
18950
+ /** One refusal, named (D391). `path` points into the composition, e.g. `features[0].fields.temperature`. */
18312
18951
  var CompositionProblemSchema = object({
18313
18952
  code: _enum([
18314
18953
  "reserved-variant",
@@ -18336,7 +18975,8 @@ var CompositionProblemSchema = object({
18336
18975
  "native-capability-replace",
18337
18976
  "mixed-quantity",
18338
18977
  "helper-mismatch",
18339
- "member-constraint"
18978
+ "member-constraint",
18979
+ "retention"
18340
18980
  ]),
18341
18981
  path: string(),
18342
18982
  message: string()
@@ -18570,13 +19210,17 @@ Object.freeze({
18570
19210
  latchedAt: {
18571
19211
  kind: "fixed",
18572
19212
  result: ["number", "null"]
19213
+ },
19214
+ schmitt: {
19215
+ kind: "fixed",
19216
+ result: ["boolean", "null"]
18573
19217
  }
18574
19218
  });
18575
19219
  /**
18576
19220
  * One catalog row per base reading a group helper can build (D944 §3).
18577
19221
  * Data, not a form default written into the block.
18578
19222
  */
18579
- var NOW = {
19223
+ var NOW$2 = {
18580
19224
  fieldPath: "lastFetchedAt",
18581
19225
  expr: "now"
18582
19226
  };
@@ -18590,6 +19234,8 @@ function numeric(input) {
18590
19234
  family: "numeric",
18591
19235
  deviceType: DeviceType.Sensor,
18592
19236
  memberDeviceType: DeviceType.Sensor,
19237
+ memberDeviceTypes: [DeviceType.Sensor],
19238
+ activeWhen: void 0,
18593
19239
  commandCaps: [],
18594
19240
  baseUnit: baseUnitOf(input.quantity),
18595
19241
  aggregates: NUMERIC_AGGREGATES,
@@ -18605,6 +19251,8 @@ function binary(input) {
18605
19251
  family: "binary",
18606
19252
  deviceType: DeviceType.Sensor,
18607
19253
  memberDeviceType: DeviceType.Sensor,
19254
+ memberDeviceTypes: [DeviceType.Sensor],
19255
+ activeWhen: void 0,
18608
19256
  commandCaps: [],
18609
19257
  quantity: "none",
18610
19258
  baseUnit: void 0,
@@ -18618,73 +19266,73 @@ var GROUP_TEMPLATES = [
18618
19266
  summary: "Mean, median, min, max or sum of temperatures. Offline and unknown members are left out, never read as 0 °C.",
18619
19267
  role: DeviceRole.TemperatureSensor,
18620
19268
  outputCap: "temperature-sensor",
18621
- outputField: "celsius",
19269
+ outputField: "temperature",
18622
19270
  quantity: "temperature",
18623
19271
  defaultAggregate: "mean",
18624
19272
  empty: "null",
18625
- companions: [NOW]
19273
+ companions: [NOW$2]
18626
19274
  }),
18627
19275
  numeric({
18628
19276
  id: "humidity",
18629
19277
  summary: "Humidity in percent. Offline and unknown members are left out, never read as 0 %.",
18630
19278
  role: DeviceRole.HumiditySensor,
18631
19279
  outputCap: "humidity-sensor",
18632
- outputField: "percent",
19280
+ outputField: "humidity",
18633
19281
  quantity: "humidity",
18634
19282
  defaultAggregate: "mean",
18635
19283
  empty: "null",
18636
- companions: [NOW]
19284
+ companions: [NOW$2]
18637
19285
  }),
18638
19286
  numeric({
18639
19287
  id: "pressure",
18640
19288
  summary: "Pressure in hectopascals. Offline and unknown members are left out, never read as 0 hPa.",
18641
19289
  role: DeviceRole.PressureSensor,
18642
19290
  outputCap: "pressure-sensor",
18643
- outputField: "hpa",
19291
+ outputField: "pressure",
18644
19292
  quantity: "pressure",
18645
19293
  defaultAggregate: "mean",
18646
19294
  empty: "null",
18647
- companions: [NOW]
19295
+ companions: [NOW$2]
18648
19296
  }),
18649
19297
  numeric({
18650
19298
  id: "illuminance",
18651
19299
  summary: "Illuminance in lux. Offline and unknown members are left out, never read as 0 lx.",
18652
19300
  role: DeviceRole.AmbientLightSensor,
18653
19301
  outputCap: "ambient-light-sensor",
18654
- outputField: "lux",
19302
+ outputField: "illuminance",
18655
19303
  quantity: "illuminance",
18656
19304
  defaultAggregate: "mean",
18657
19305
  empty: "null",
18658
- companions: [NOW]
19306
+ companions: [NOW$2]
18659
19307
  }),
18660
19308
  numeric({
18661
19309
  id: "power",
18662
19310
  summary: "Power in watts, summed by default. Nobody reporting omits the key rather than writing 0 W.",
18663
19311
  role: DeviceRole.PowerSensor,
18664
19312
  outputCap: "power-meter",
18665
- outputField: "watts",
19313
+ outputField: "power",
18666
19314
  quantity: "power",
18667
19315
  defaultAggregate: "sum",
18668
19316
  empty: "omit",
18669
- companions: [NOW]
19317
+ companions: [NOW$2]
18670
19318
  }),
18671
19319
  numeric({
18672
19320
  id: "energy",
18673
19321
  summary: "Energy in kilowatt-hours, summed by default. Nobody reporting omits the key rather than writing 0 kWh.",
18674
19322
  role: DeviceRole.EnergySensor,
18675
19323
  outputCap: "power-meter",
18676
- outputField: "kwhTotal",
19324
+ outputField: "energy",
18677
19325
  quantity: "energy",
18678
19326
  defaultAggregate: "sum",
18679
19327
  empty: "omit",
18680
- companions: [NOW]
19328
+ companions: [NOW$2]
18681
19329
  }),
18682
19330
  numeric({
18683
19331
  id: "battery",
18684
19332
  summary: "Battery charge in percent. Offline and unknown members are left out, never read as 0 %.",
18685
19333
  role: DeviceRole.BatterySensor,
18686
19334
  outputCap: "battery",
18687
- outputField: "percentage",
19335
+ outputField: "level",
18688
19336
  quantity: "percentage",
18689
19337
  defaultAggregate: "mean",
18690
19338
  empty: "null",
@@ -18712,7 +19360,7 @@ var GROUP_TEMPLATES = [
18712
19360
  quantity: "device",
18713
19361
  defaultAggregate: "mean",
18714
19362
  empty: "null",
18715
- companions: [NOW]
19363
+ companions: [NOW$2]
18716
19364
  }),
18717
19365
  binary({
18718
19366
  id: "motion",
@@ -18806,6 +19454,11 @@ var GROUP_TEMPLATES = [
18806
19454
  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.",
18807
19455
  deviceType: DeviceType.Switch,
18808
19456
  outputCap: "switch",
19457
+ outputField: "on",
19458
+ member: {
19459
+ cap: "switch",
19460
+ fieldPath: "on"
19461
+ },
18809
19462
  commandCaps: ["switch"]
18810
19463
  }),
18811
19464
  actuator({
@@ -18813,34 +19466,136 @@ var GROUP_TEMPLATES = [
18813
19466
  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.",
18814
19467
  deviceType: DeviceType.Light,
18815
19468
  outputCap: "switch",
19469
+ outputField: "on",
19470
+ member: {
19471
+ cap: "switch",
19472
+ fieldPath: "on"
19473
+ },
18816
19474
  commandCaps: [
18817
19475
  "switch",
18818
19476
  "brightness",
18819
19477
  "color"
18820
19478
  ]
19479
+ }),
19480
+ actuator({
19481
+ id: "fan",
19482
+ 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.",
19483
+ deviceType: DeviceType.Fan,
19484
+ outputCap: "switch",
19485
+ outputField: "on",
19486
+ member: {
19487
+ cap: "switch",
19488
+ fieldPath: "on"
19489
+ },
19490
+ commandCaps: ["switch", "fan-control"]
19491
+ }),
19492
+ actuator({
19493
+ id: "cover",
19494
+ 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.",
19495
+ deviceType: DeviceType.Cover,
19496
+ outputCap: "group-active",
19497
+ outputField: "active",
19498
+ member: {
19499
+ cap: "cover",
19500
+ fieldPath: "state"
19501
+ },
19502
+ activeWhen: [
19503
+ "open",
19504
+ "opening",
19505
+ "stopped"
19506
+ ],
19507
+ commandCaps: ["cover"]
19508
+ }),
19509
+ actuator({
19510
+ id: "valve",
19511
+ 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.",
19512
+ deviceType: DeviceType.Valve,
19513
+ outputCap: "group-active",
19514
+ outputField: "active",
19515
+ member: {
19516
+ cap: "valve",
19517
+ fieldPath: "state"
19518
+ },
19519
+ activeWhen: [
19520
+ "open",
19521
+ "opening",
19522
+ "stopped"
19523
+ ],
19524
+ commandCaps: ["valve"]
19525
+ }),
19526
+ actuator({
19527
+ id: "lock",
19528
+ 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.",
19529
+ deviceType: DeviceType.Lock,
19530
+ outputCap: "group-active",
19531
+ outputField: "active",
19532
+ member: {
19533
+ cap: "lock-control",
19534
+ fieldPath: "state"
19535
+ },
19536
+ activeWhen: ["locked"],
19537
+ commandCaps: ["lock-control"]
19538
+ }),
19539
+ actuator({
19540
+ id: "media-player",
19541
+ 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.",
19542
+ deviceType: DeviceType.MediaPlayer,
19543
+ outputCap: "group-active",
19544
+ outputField: "active",
19545
+ member: {
19546
+ cap: "media-player",
19547
+ fieldPath: "state"
19548
+ },
19549
+ activeWhen: ["playing", "buffering"],
19550
+ commandCaps: ["media-player"]
19551
+ }),
19552
+ actuator({
19553
+ id: "climate",
19554
+ 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.",
19555
+ deviceType: DeviceType.Thermostat,
19556
+ memberDeviceTypes: [DeviceType.Thermostat, DeviceType.Climate],
19557
+ outputCap: "group-active",
19558
+ outputField: "active",
19559
+ member: {
19560
+ cap: "climate-control",
19561
+ fieldPath: "mode"
19562
+ },
19563
+ activeWhen: [
19564
+ "heat",
19565
+ "cool",
19566
+ "auto",
19567
+ "heat_cool",
19568
+ "fan_only",
19569
+ "dry"
19570
+ ],
19571
+ commandCaps: ["climate-control"]
18821
19572
  })
18822
19573
  ];
18823
19574
  function actuator(input) {
18824
19575
  return {
18825
- ...input,
19576
+ id: input.id,
19577
+ summary: input.summary,
19578
+ deviceType: input.deviceType,
19579
+ outputCap: input.outputCap,
19580
+ outputField: input.outputField,
19581
+ commandCaps: input.commandCaps,
18826
19582
  family: "actuator",
18827
19583
  role: void 0,
18828
19584
  memberDeviceType: input.deviceType,
18829
- outputField: "on",
19585
+ memberDeviceTypes: input.memberDeviceTypes ?? [input.deviceType],
19586
+ activeWhen: input.activeWhen,
18830
19587
  quantity: "none",
18831
19588
  baseUnit: void 0,
18832
19589
  aggregates: BINARY_AGGREGATES,
18833
19590
  defaultAggregate: "any",
18834
19591
  empty: "offline",
18835
- accept: [{
18836
- cap: "switch",
18837
- fieldPath: "on"
18838
- }],
19592
+ accept: [input.member],
18839
19593
  companions: [CHANGED]
18840
19594
  };
18841
19595
  }
18842
19596
  new Map(GROUP_TEMPLATES.map((template) => [template.id, template]));
18843
19597
  DeviceFeature.LightColorRgb, DeviceFeature.LightColorHsv, DeviceFeature.LightColorMired;
19598
+ DeviceType.Camera;
18844
19599
  `${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
18845
19600
  /**
18846
19601
  * What a composition may BUILD on a device type (G2, D676): the caps a new
@@ -19155,7 +19910,18 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
19155
19910
  kind: "mutation",
19156
19911
  auth: "admin",
19157
19912
  access: "view"
19158
- });
19913
+ }), method(object({
19914
+ blockId: string().min(1),
19915
+ trace: AutomationRunTraceSchema.optional(),
19916
+ runStartedAt: number().optional(),
19917
+ keepTraces: number().int().min(1).max(100).optional()
19918
+ }), _void(), {
19919
+ kind: "mutation",
19920
+ auth: "admin"
19921
+ }), method(object({ blockId: string().min(1) }), AutomationStateDocSchema, { auth: "admin" }), method(object({ blockId: string().min(1) }), object({
19922
+ traces: array(AutomationRunTraceSchema),
19923
+ lastError: string().nullable()
19924
+ }), { auth: "admin" });
19159
19925
  /**
19160
19926
  * `custom-model-registry` — collection cap exposing operator-registered
19161
19927
  * custom detection models. Each provider (today: `addon-model-studio`)
@@ -44179,7 +44945,7 @@ var NetworkAccessStatusSchema = object({
44179
44945
  });
44180
44946
  /**
44181
44947
  * Optional, richer endpoint shape returned by providers that expose
44182
- * MORE than one ingress concurrently (Tailscale Ingress with mixed
44948
+ * MORE than one ingress concurrently (Tailscale Funnel with mixed
44183
44949
  * serve+funnel rules, future ngrok multi-tunnel, …). Each entry carries
44184
44950
  * the originating provider config (mode + sourcePort) so the
44185
44951
  * orchestrator UI can label rows distinctly. Providers that expose only
@@ -44572,51 +45338,6 @@ method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSche
44572
45338
  kind: "mutation",
44573
45339
  auth: "admin"
44574
45340
  });
44575
- new Set([
44576
- {
44577
- id: "person",
44578
- name: "Person"
44579
- },
44580
- {
44581
- id: "vehicle",
44582
- name: "Vehicle"
44583
- },
44584
- {
44585
- id: "animal",
44586
- name: "Animal"
44587
- },
44588
- {
44589
- id: "package",
44590
- name: "Package"
44591
- }
44592
- ].map((l) => l.id));
44593
- var COCO_TO_MACRO = {
44594
- mapping: {
44595
- person: "person",
44596
- bicycle: "vehicle",
44597
- car: "vehicle",
44598
- motorcycle: "vehicle",
44599
- airplane: "vehicle",
44600
- bus: "vehicle",
44601
- train: "vehicle",
44602
- truck: "vehicle",
44603
- boat: "vehicle",
44604
- bird: "animal",
44605
- cat: "animal",
44606
- dog: "animal",
44607
- horse: "animal",
44608
- sheep: "animal",
44609
- cow: "animal",
44610
- elephant: "animal",
44611
- bear: "animal",
44612
- zebra: "animal",
44613
- giraffe: "animal",
44614
- suitcase: "package",
44615
- backpack: "package",
44616
- handbag: "package"
44617
- },
44618
- preserveOriginal: false
44619
- };
44620
45341
  var AUDIO_MACRO_LABELS = [
44621
45342
  {
44622
45343
  id: "speech",
@@ -46866,7 +47587,20 @@ var NcRuleInputSchema = object({
46866
47587
  * save by the hub's grouping guard). `.optional()`, never `.default()`: the addon cap
46867
47588
  * path does not run Zod defaults.
46868
47589
  */
46869
- groupingSec: number().int().min(5).max(60).optional()
47590
+ groupingSec: number().int().min(5).max(60).optional(),
47591
+ /**
47592
+ * ASK ME TO CONFIRM DETECTIONS (#243): a DETECTION notification of this rule
47593
+ * carries "Correct" / "Wrong" buttons (and, where the channel has room, a
47594
+ * "Wrong, it is a <class>" choice). A tap marks the track for retraining, the
47595
+ * same mark the Library writes, and records whose notification it was and
47596
+ * when. A channel with no buttons gets the same two choices as links.
47597
+ *
47598
+ * `.optional()`, never `.default()` (a Zod default does not run on the addon
47599
+ * cap path): absent and `false` both mean off, which is what every rule
47600
+ * authored before this field meant. An editor turns it off by writing
47601
+ * `false`, so it needs no `clear` key.
47602
+ */
47603
+ askVerdict: boolean().optional()
46870
47604
  });
46871
47605
  /**
46872
47606
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -57692,9 +58426,9 @@ method(object({ nodeId: string().optional() }).optional(), array(AddonListItemSc
57692
58426
  */
57693
58427
  var AirQualitySensorStatusSchema = object({
57694
58428
  /** Carbon dioxide concentration in ppm. */
57695
- co2Ppm: number().min(0).optional().meta(readingMeta("concentration-volume")),
58429
+ co2: number().min(0).optional().meta(readingMeta("concentration-volume")),
57696
58430
  /** Total volatile organic compounds in ppb. */
57697
- vocPpb: number().min(0).optional().meta(readingMeta("concentration-ppb")),
58431
+ voc: number().min(0).optional().meta(readingMeta("concentration-ppb")),
57698
58432
  /** Particulate matter ≤ 2.5 μm in µg/m³. */
57699
58433
  pm25: number().min(0).optional().meta(readingMeta("concentration-mass")),
57700
58434
  /** Particulate matter ≤ 10 μm in µg/m³. */
@@ -57727,12 +58461,12 @@ var airQualitySensorCapability = {
57727
58461
  * History (D850): recorded series.
57728
58462
  */
57729
58463
  history: { fields: {
57730
- co2Ppm: {
58464
+ co2: {
57731
58465
  kind: "gauge",
57732
58466
  unit: "ppm",
57733
58467
  deadband: 5
57734
58468
  },
57735
- vocPpb: {
58469
+ voc: {
57736
58470
  kind: "gauge",
57737
58471
  unit: "ppb",
57738
58472
  deadband: 5
@@ -57763,7 +58497,7 @@ var airQualitySensorCapability = {
57763
58497
  */
57764
58498
  var AmbientLightSensorStatusSchema = object({
57765
58499
  /** Current illuminance in lux (lx). `null` when the sample was refused (D393). */
57766
- lux: number().min(0).nullable().meta(readingMeta("illuminance", {
58500
+ illuminance: number().min(0).nullable().meta(readingMeta("illuminance", {
57767
58501
  precision: 0,
57768
58502
  label: "Illuminance"
57769
58503
  })),
@@ -57792,7 +58526,7 @@ var ambientLightSensorCapability = {
57792
58526
  /**
57793
58527
  * History (D850): recorded series. Wide range, so a RELATIVE deadband (10 %).
57794
58528
  */
57795
- history: { fields: { lux: {
58529
+ history: { fields: { illuminance: {
57796
58530
  kind: "gauge",
57797
58531
  unit: "lx",
57798
58532
  deadbandPct: 10,
@@ -57931,6 +58665,84 @@ var audioMetricsCapability = {
57931
58665
  */
57932
58666
  history: "none"
57933
58667
  };
58668
+ method(object({}), array(ActionEntrySchema), { auth: "admin" }), method(object({
58669
+ actionId: string().min(1),
58670
+ variables: record(string(), ActionVariableValueSchema).optional()
58671
+ }), _void(), {
58672
+ kind: "mutation",
58673
+ auth: "admin"
58674
+ }), method(object({ actionId: string().min(1) }), _void(), {
58675
+ kind: "mutation",
58676
+ auth: "admin"
58677
+ });
58678
+ /**
58679
+ * actions — the ONE surface for runnable actions, for the UI and for
58680
+ * automations. Provided by the core-blocks builtin on the hub.
58681
+ *
58682
+ * An action is a LIST ENTRY, not a device (D883): either internal (cap and wait
58683
+ * steps, kept in the hub's `actions` record kind) or declared by an addon over
58684
+ * `action-source`. `list` asks every `action-source` provider LIVE and overlays
58685
+ * the run status from the hub's `runs` ledger; there is no catalog here to
58686
+ * drift (D3).
58687
+ *
58688
+ * **Permissions follow the camera, as linked devices do.** An action is linked
58689
+ * to cameras by the operator (`setLinks`, D356: nothing links itself). A
58690
+ * non-admin may `get` / `run` an action only through a camera they may see that
58691
+ * links it: they name the camera (`deviceId`, a top-level field so the scope
58692
+ * gate sees it) and the provider refuses an action that camera does not link.
58693
+ * An admin, and an in-process caller (an automation block), may run any action.
58694
+ * Every refusal is typed (`[not-linked] …`) and logged.
58695
+ *
58696
+ * A second `run` of an action that is already running is REFUSED — traced and
58697
+ * logged — never queued.
58698
+ */
58699
+ var ActionIdInput = object({ actionId: string().min(1) });
58700
+ var ActionLinksSchema = object({
58701
+ deviceId: number().int().nonnegative(),
58702
+ actionIds: array(string().min(1)).max(100)
58703
+ });
58704
+ method(object({}), array(ActionEntrySchema), { auth: "admin" }), method(object({
58705
+ actionId: string().min(1),
58706
+ deviceId: number().int().nonnegative().optional()
58707
+ }), object({ action: ActionEntrySchema.nullable() }), {
58708
+ role: "viewer",
58709
+ auth: "protected",
58710
+ kind: "query",
58711
+ caller: "required"
58712
+ }), method(object({
58713
+ actionId: string().min(1),
58714
+ variables: record(string(), ActionVariableValueSchema).optional(),
58715
+ wait: boolean().optional(),
58716
+ origin: ActionRunOriginSchema.optional(),
58717
+ deviceId: number().int().nonnegative().optional()
58718
+ }), ActionRunResultSchema, {
58719
+ role: "viewer",
58720
+ auth: "protected",
58721
+ kind: "mutation",
58722
+ caller: "required"
58723
+ }), method(ActionIdInput, _void(), {
58724
+ kind: "mutation",
58725
+ auth: "admin"
58726
+ }), method(ActionIdInput, object({ traces: array(AutomationRunTraceSchema) }), { auth: "admin" }), method(object({ action: ActionInputSchema }), object({ action: ActionEntrySchema }), {
58727
+ kind: "mutation",
58728
+ auth: "admin"
58729
+ }), method(object({
58730
+ actionId: string().min(1),
58731
+ action: ActionInputSchema.partial()
58732
+ }), object({ action: ActionEntrySchema }), {
58733
+ kind: "mutation",
58734
+ auth: "admin"
58735
+ }), method(ActionIdInput, _void(), {
58736
+ kind: "mutation",
58737
+ auth: "admin"
58738
+ }), method(object({ deviceId: number().int().nonnegative() }), array(ActionEntrySchema), {
58739
+ role: "viewer",
58740
+ auth: "protected",
58741
+ kind: "query"
58742
+ }), method(object({ deviceId: number().int().nonnegative() }), ActionLinksSchema, { auth: "admin" }), method(ActionLinksSchema, ActionLinksSchema, {
58743
+ kind: "mutation",
58744
+ auth: "admin"
58745
+ });
57934
58746
  /**
57935
58747
  * Automation-control cap. Models HA `automation.*` entities on
57936
58748
  * `DeviceType.Automation`. An automation is a trigger+condition+
@@ -58027,7 +58839,7 @@ var BatteryStatusSchema = object({
58027
58839
  * Consumers must SKIP a null rather than coerce it — `battery-band` already
58028
58840
  * declines to band a non-finite reading, which is the correct shape.
58029
58841
  */
58030
- percentage: number().min(0).max(100).nullable().meta(readingMeta("percentage", { label: "Charge" })),
58842
+ level: number().min(0).max(100).nullable().meta(readingMeta("percentage", { label: "Charge" })),
58031
58843
  /**
58032
58844
  * Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
58033
58845
  * Reolink-specific for the Solar Panel 2 accessory (will become
@@ -58037,7 +58849,7 @@ var BatteryStatusSchema = object({
58037
58849
  * `'unknown'` is the absence of an answer: the provider has not read the
58038
58850
  * power fields yet, or the firmware reported neither. Before it existed,
58039
58851
  * two unreadable fields produced `'none'`, and a camera nobody had reached
58040
- * was drawn "on battery alone" — the same D315 defect `percentage` closed
58852
+ * was drawn "on battery alone" — the same D315 defect `level` closed
58041
58853
  * by going nullable. Consumers SKIP it (no charger state published, no
58042
58854
  * glyph, no HomeKit ChargingState) rather than coerce it either way.
58043
58855
  */
@@ -58061,7 +58873,7 @@ var BatteryStatusSchema = object({
58061
58873
  * that only report charge. A second reading on this cap, not a second
58062
58874
  * `numeric-sensor` on the same device.
58063
58875
  */
58064
- volts: number().nullable().optional().meta(readingMeta("voltage", { label: "Voltage" })),
58876
+ voltage: number().nullable().optional().meta(readingMeta("voltage", { label: "Voltage" })),
58065
58877
  /**
58066
58878
  * Ms epoch of the last time the device PROVED it was reachable — a
58067
58879
  * completed firmware round-trip, an observed wake, or an inbound push
@@ -58095,7 +58907,7 @@ var BatteryStatusSchema = object({
58095
58907
  /**
58096
58908
  * True when the source is a BINARY low-battery indicator (HA
58097
58909
  * `binary_sensor` device_class=battery / `LOW_BAT`) that has no real
58098
- * charge level — `percentage` is then a coarse stand-in (100 = normal,
58910
+ * charge level — `level` is then a coarse stand-in (100 = normal,
58099
58911
  * sub-threshold = low). UI MUST render "Normal"/"Low" instead of a
58100
58912
  * misleading exact percentage. Absent/false → genuine 0–100 % reading.
58101
58913
  */
@@ -58108,21 +58920,22 @@ var BATTERY_DEVICE_TYPES = [
58108
58920
  DeviceType.Switch,
58109
58921
  DeviceType.PetFeeder,
58110
58922
  DeviceType.Container,
58111
- DeviceType.Thermostat
58923
+ DeviceType.Thermostat,
58924
+ DeviceType.EventEmitter
58112
58925
  ];
58113
58926
  /** Generic Customize target for the percentage reading (D936). */
58114
58927
  var batteryCustomize = {
58115
58928
  version: 1,
58116
58929
  targets: [{
58117
- id: "percentage",
58930
+ id: "level",
58118
58931
  cardinality: "scalar",
58119
58932
  vocabulary: {
58120
58933
  cap: "battery",
58121
- stateField: "percentage"
58934
+ stateField: "level"
58122
58935
  },
58123
58936
  deviceTypes: BATTERY_DEVICE_TYPES,
58124
58937
  apply: "add",
58125
- path: "percentage",
58938
+ path: "level",
58126
58939
  sources: [{
58127
58940
  kind: "field",
58128
58941
  valueKinds: ["number", "string"],
@@ -58216,7 +59029,7 @@ onStatusChanged: { data: object({
58216
59029
  schema: BatteryStatusSchema,
58217
59030
  kind: "push",
58218
59031
  empty: {
58219
- percentage: null,
59032
+ level: null,
58220
59033
  charging: "unknown",
58221
59034
  sleeping: false,
58222
59035
  lastUpdated: 0
@@ -58243,11 +59056,11 @@ onStatusChanged: { data: object({
58243
59056
  * History (D850): recorded series. The generic capture replaces the `battery` series of `pipeline-analytics:stats-5m`.
58244
59057
  */
58245
59058
  history: { fields: {
58246
- percentage: {
59059
+ level: {
58247
59060
  kind: "gauge",
58248
59061
  unit: "%"
58249
59062
  },
58250
- volts: {
59063
+ voltage: {
58251
59064
  kind: "gauge",
58252
59065
  unit: "V"
58253
59066
  }
@@ -58307,14 +59120,14 @@ var binaryCapability = {
58307
59120
  * controls to this single-method surface.
58308
59121
  *
58309
59122
  * The cap is intentionally minimal: a single `setBrightness({deviceId,
58310
- * percentage})` mutation plus the auto-injected `getStatus`. Drivers
59123
+ * level})` mutation plus the auto-injected `getStatus`. Drivers
58311
59124
  * that expose richer controls (color temperature, scenes, schedules)
58312
59125
  * should surface those via the device's `getSettingsUISchema()`
58313
59126
  * instead of bloating this cap.
58314
59127
  */
58315
59128
  var BrightnessStatusSchema = object({
58316
59129
  /** Current level as 0..100 inclusive. Firmware-reported. */
58317
- percentage: number().min(0).max(100).meta(readingMeta("percentage")),
59130
+ level: number().min(0).max(100).meta(readingMeta("percentage")),
58318
59131
  /** Ms epoch of the last operator-driven change. Useful for UI freshness. */
58319
59132
  lastChangedAt: number()
58320
59133
  });
@@ -58326,7 +59139,7 @@ var brightnessCapability = {
58326
59139
  deviceTypes: [DeviceType.Light],
58327
59140
  methods: { setBrightness: method(object({
58328
59141
  deviceId: number().int().nonnegative(),
58329
- percentage: number().min(0).max(100)
59142
+ level: number().min(0).max(100)
58330
59143
  }), _void(), {
58331
59144
  kind: "mutation",
58332
59145
  auth: "protected"
@@ -58339,7 +59152,7 @@ var brightnessCapability = {
58339
59152
  */
58340
59153
  onBrightnessChanged: { data: object({
58341
59154
  deviceId: number(),
58342
- percentage: number().min(0).max(100),
59155
+ level: number().min(0).max(100),
58343
59156
  lastChangedAt: number()
58344
59157
  }) } },
58345
59158
  status: {
@@ -58362,7 +59175,7 @@ onBrightnessChanged: { data: object({
58362
59175
  /**
58363
59176
  * History (D850): recorded series. Actuator tier: level keeps every change.
58364
59177
  */
58365
- history: { fields: { percentage: {
59178
+ history: { fields: { level: {
58366
59179
  kind: "gauge",
58367
59180
  unit: "%",
58368
59181
  minIntervalMs: 0
@@ -58959,11 +59772,11 @@ var ColorInputSchema = discriminatedUnion("mode", [
58959
59772
  }),
58960
59773
  object({
58961
59774
  mode: literal("mired"),
58962
- mireds: number().int().min(50).max(1e3)
59775
+ colorTemperature: number().int().min(50).max(1e3)
58963
59776
  })
58964
59777
  ]);
58965
59778
  var ColorStatusSchema = object({
58966
- /** Active color mode — which of `rgb` / `hsv` / `mireds` reflects
59779
+ /** Active color mode — which of `rgb` / `hsv` / `colorTemperature` reflects
58967
59780
  * the bulb's current state. */
58968
59781
  mode: _enum([
58969
59782
  "rgb",
@@ -58975,7 +59788,7 @@ var ColorStatusSchema = object({
58975
59788
  /** Populated when `mode === 'hsv'`. */
58976
59789
  hsv: HsvTripletSchema.optional(),
58977
59790
  /** Populated when `mode === 'mired'`. */
58978
- mireds: number().int().optional().meta(readingMeta("colour-temperature")),
59791
+ colorTemperature: number().int().optional().meta(readingMeta("colour-temperature")),
58979
59792
  /** Ms epoch of the last operator-driven change. */
58980
59793
  lastChangedAt: number()
58981
59794
  });
@@ -59007,7 +59820,7 @@ onColorChanged: { data: object({
59007
59820
  ]),
59008
59821
  rgb: RgbTripletSchema.optional(),
59009
59822
  hsv: HsvTripletSchema.optional(),
59010
- mireds: number().int().optional(),
59823
+ colorTemperature: number().int().optional(),
59011
59824
  lastChangedAt: number()
59012
59825
  }) } },
59013
59826
  status: {
@@ -59884,11 +60697,11 @@ var DishwasherStatusSchema = object({
59884
60697
  /** Feature keys of the programs the appliance currently offers — drives the UI selector. */
59885
60698
  availablePrograms: array(string()),
59886
60699
  /** Seconds remaining on the active cycle, or null when not running / not known. */
59887
- remainingSeconds: number().int().nonnegative().nullable().meta(readingMeta("duration")),
60700
+ remaining: number().int().nonnegative().nullable().meta(readingMeta("duration")),
59888
60701
  /** Seconds the delayed start is set to (time until the cycle starts), or null. */
59889
- delayedStartSeconds: number().int().nonnegative().nullable().meta(readingMeta("duration")),
60702
+ delayedStart: number().int().nonnegative().nullable().meta(readingMeta("duration")),
59890
60703
  /** Cycle completion 0..100, or null when not applicable. */
59891
- progressPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
60704
+ progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
59892
60705
  /** True when the door is reported open; null when the door state is not known. */
59893
60706
  doorOpen: boolean().nullable(),
59894
60707
  /** True when the door is latched (locked) during a cycle; null when not reported. */
@@ -60107,14 +60920,14 @@ var dishwasherCapability = {
60107
60920
  runtimeState: DishwasherStatusSchema,
60108
60921
  durability: "session",
60109
60922
  history: { fields: {
60110
- progressPercent: {
60923
+ progress: {
60111
60924
  kind: "gauge",
60112
60925
  unit: "%",
60113
60926
  deadband: 2
60114
60927
  },
60115
60928
  state: { kind: "enum" },
60116
60929
  operationState: { kind: "enum" },
60117
- remainingSeconds: {
60930
+ remaining: {
60118
60931
  kind: "gauge",
60119
60932
  unit: "s",
60120
60933
  minIntervalMs: 6e4
@@ -60705,7 +61518,7 @@ var FanDirectionSchema = _enum(["forward", "reverse"]);
60705
61518
  var FanControlStatusSchema = object({
60706
61519
  /** Active speed as 0..100 inclusive. Null when the device has no
60707
61520
  * speed surface (single-speed fan). */
60708
- percentage: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
61521
+ speed: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
60709
61522
  /** Speed granularity the device accepts (HA `percentage_step`, e.g. 25 for
60710
61523
  * a 4-speed fan). Absent when unknown — the UI then falls back to step 1. */
60711
61524
  percentageStep: number().positive().optional().meta(readingMeta("percentage")),
@@ -60732,7 +61545,7 @@ var fanControlCapability = {
60732
61545
  methods: {
60733
61546
  setPercentage: method(object({
60734
61547
  deviceId: number().int().nonnegative(),
60735
- percentage: number().min(0).max(100)
61548
+ speed: number().min(0).max(100)
60736
61549
  }), _void(), {
60737
61550
  kind: "mutation",
60738
61551
  auth: "protected"
@@ -60765,7 +61578,7 @@ var fanControlCapability = {
60765
61578
  },
60766
61579
  /**
60767
61580
  * Runtime-state slice — mirrored by the kernel. UI fan speed
60768
- * sliders read `percentage` for live updates.
61581
+ * sliders read `speed` for live updates.
60769
61582
  */
60770
61583
  runtimeState: FanControlStatusSchema,
60771
61584
  /**
@@ -60779,7 +61592,7 @@ var fanControlCapability = {
60779
61592
  * History (D850): recorded series. Actuator tier: speed keeps every change.
60780
61593
  */
60781
61594
  history: { fields: {
60782
- percentage: {
61595
+ speed: {
60783
61596
  kind: "gauge",
60784
61597
  unit: "%",
60785
61598
  minIntervalMs: 0
@@ -60968,7 +61781,17 @@ var groupCommandsCapability = {
60968
61781
  scope: "device",
60969
61782
  deviceNative: true,
60970
61783
  mode: "singleton",
60971
- deviceTypes: [DeviceType.Switch, DeviceType.Light],
61784
+ deviceTypes: [
61785
+ DeviceType.Switch,
61786
+ DeviceType.Light,
61787
+ DeviceType.Fan,
61788
+ DeviceType.Cover,
61789
+ DeviceType.Valve,
61790
+ DeviceType.Lock,
61791
+ DeviceType.MediaPlayer,
61792
+ DeviceType.Thermostat,
61793
+ DeviceType.Climate
61794
+ ],
60972
61795
  methods: {},
60973
61796
  status: {
60974
61797
  schema: GroupCommandsSchema,
@@ -60986,6 +61809,49 @@ var groupCommandsCapability = {
60986
61809
  history: "none"
60987
61810
  };
60988
61811
  /**
61812
+ * Whether a helper actuator group counts as active (D944): at least one
61813
+ * included member is, or every included member is. What "active" means is the
61814
+ * type's: a cover is open, a lock is locked, a media player is playing, a
61815
+ * climate device is not off. A group of lights, switches and fans reports
61816
+ * `switch.on` instead; this cap is for the types whose own state is not a
61817
+ * yes/no. Unknown members are left out (`group-status` counts them) and an
61818
+ * empty included set takes the device offline, never `active: false`.
61819
+ */
61820
+ var GroupActiveSchema = object({
61821
+ active: boolean().meta({ label: "Active" }),
61822
+ /** Ms epoch when the slice was last updated. */
61823
+ lastChangedAt: number()
61824
+ });
61825
+ var groupActiveCapability = {
61826
+ name: "group-active",
61827
+ scope: "device",
61828
+ deviceNative: true,
61829
+ mode: "singleton",
61830
+ deviceTypes: [
61831
+ DeviceType.Cover,
61832
+ DeviceType.Valve,
61833
+ DeviceType.Lock,
61834
+ DeviceType.MediaPlayer,
61835
+ DeviceType.Climate,
61836
+ DeviceType.Thermostat
61837
+ ],
61838
+ methods: {},
61839
+ status: {
61840
+ schema: GroupActiveSchema,
61841
+ kind: "push"
61842
+ },
61843
+ runtimeState: GroupActiveSchema,
61844
+ /**
61845
+ * Runtime-state durability: **session** — recomputed from the members on the
61846
+ * next source event; a restored value would outlive the members it named.
61847
+ *
61848
+ * See `RuntimeStateDurability`. Enforced by
61849
+ * `scripts/check-runtime-state-durability.ts`.
61850
+ */
61851
+ durability: "session",
61852
+ history: "none"
61853
+ };
61854
+ /**
60989
61855
  * How many members of a helper group answered (D944). Counts are integers,
60990
61856
  * not measurements: zero included is a real count, never a stand-in reading.
60991
61857
  * The reading itself stays on the output capability. History is none — the
@@ -61016,7 +61882,14 @@ var groupStatusCapability = {
61016
61882
  deviceTypes: [
61017
61883
  DeviceType.Sensor,
61018
61884
  DeviceType.Switch,
61019
- DeviceType.Light
61885
+ DeviceType.Light,
61886
+ DeviceType.Fan,
61887
+ DeviceType.Cover,
61888
+ DeviceType.Valve,
61889
+ DeviceType.Lock,
61890
+ DeviceType.MediaPlayer,
61891
+ DeviceType.Thermostat,
61892
+ DeviceType.Climate
61020
61893
  ],
61021
61894
  methods: {},
61022
61895
  status: {
@@ -61164,7 +62037,7 @@ var humidifierCapability = {
61164
62037
  */
61165
62038
  var HumiditySensorStatusSchema = object({
61166
62039
  /** Current relative humidity, 0..100. `null` when the sample was refused (D393). */
61167
- percent: number().min(0).max(100).nullable().meta(readingMeta("humidity", {
62040
+ humidity: number().min(0).max(100).nullable().meta(readingMeta("humidity", {
61168
62041
  precision: 0,
61169
62042
  label: "Humidity"
61170
62043
  })),
@@ -61193,7 +62066,7 @@ var humiditySensorCapability = {
61193
62066
  /**
61194
62067
  * History (D850): recorded series.
61195
62068
  */
61196
- history: { fields: { percent: {
62069
+ history: { fields: { humidity: {
61197
62070
  kind: "gauge",
61198
62071
  unit: "%",
61199
62072
  deadband: .5
@@ -61833,7 +62706,7 @@ var LawnMowerControlStatusSchema = object({
61833
62706
  batteryLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
61834
62707
  /** 0..100 mowing-completion percentage of the current task, or null when no
61835
62708
  * task is active / progress is unavailable. */
61836
- progressPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
62709
+ progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
61837
62710
  /** Current device/event code (dynamic — mostly status, sometimes an error),
61838
62711
  * or null when unknown. */
61839
62712
  currentCode: number().nullable().meta(readingMeta("none")),
@@ -62289,7 +63162,14 @@ var lockControlCapability = {
62289
63162
  }),
62290
63163
  unlock: method(object({
62291
63164
  deviceId: number().int().nonnegative(),
62292
- code: string().min(1).optional()
63165
+ code: string().min(1).optional(),
63166
+ /**
63167
+ * Honoured by a helper lock GROUP only (D944): unlocking several doors
63168
+ * with one call is refused unless the caller says it was confirmed. A
63169
+ * single lock ignores it. The refusal lives in the callee, so no
63170
+ * automation or API caller reaches the doors by skipping a dialog.
63171
+ */
63172
+ confirm: boolean().optional()
62293
63173
  }), _void(), {
62294
63174
  kind: "mutation",
62295
63175
  auth: "protected"
@@ -62326,6 +63206,44 @@ var lockControlCapability = {
62326
63206
  volatileStateFields: ["lastChangedAt"]
62327
63207
  };
62328
63208
  /**
63209
+ * A monotonic total between resets (D944). Energy uses `power-meter.energy`
63210
+ * so dashboards keep one series; every other instantaneous reading lands here.
63211
+ * `value` is the time integral in the source quantity's accumulated base
63212
+ * (base-unit seconds, or kWh on the power meter). `null` is a gap, never zero.
63213
+ */
63214
+ var MeterStatusSchema = object({
63215
+ value: number().nullable().meta(readingMeta("device", { label: "Total" })),
63216
+ lastFetchedAt: number()
63217
+ });
63218
+ var meterCapability = {
63219
+ name: "meter",
63220
+ scope: "device",
63221
+ deviceNative: true,
63222
+ mode: "singleton",
63223
+ deviceTypes: [DeviceType.Sensor],
63224
+ methods: {},
63225
+ status: {
63226
+ schema: MeterStatusSchema,
63227
+ kind: "push"
63228
+ },
63229
+ runtimeState: MeterStatusSchema,
63230
+ /**
63231
+ * Runtime-state durability: **restored** — the total is a cache of the
63232
+ * history integral. A restart shows it only until the history pass
63233
+ * recomputes the open period; it is not an in-memory buffer.
63234
+ *
63235
+ * See `RuntimeStateDurability`. Enforced by
63236
+ * `scripts/check-runtime-state-durability.ts`.
63237
+ */
63238
+ durability: "restored",
63239
+ history: { fields: { value: {
63240
+ kind: "counter",
63241
+ deadband: .001,
63242
+ minIntervalMs: 6e4
63243
+ } } },
63244
+ volatileStateFields: ["lastFetchedAt"]
63245
+ };
63246
+ /**
62329
63247
  * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
62330
63248
  * Apple TV, Spotify, Roku, generic OTT receivers, …) on
62331
63249
  * `DeviceType.MediaPlayer`. Disjoint from the camera streaming
@@ -62382,10 +63300,10 @@ var MediaPlayerStatusSchema = object({
62382
63300
  currentMedia: MediaInfoSchema.nullable(),
62383
63301
  /** Current playback position in ms. Null when not seekable or
62384
63302
  * nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
62385
- positionMs: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
63303
+ position: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
62386
63304
  /** Total duration of the current media in ms. Null when unknown
62387
63305
  * (live stream) or nothing is playing. */
62388
- durationMs: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
63306
+ duration: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
62389
63307
  /** Shuffle toggle. Null when no shuffle surface.
62390
63308
  * Pair with `DeviceFeature.MediaPlayerShuffle`. */
62391
63309
  shuffle: boolean().nullable(),
@@ -62424,7 +63342,7 @@ var mediaPlayerCapability = {
62424
63342
  }),
62425
63343
  seek: method(object({
62426
63344
  deviceId: number().int().nonnegative(),
62427
- positionMs: number().int().nonnegative()
63345
+ position: number().int().nonnegative()
62428
63346
  }), _void(), {
62429
63347
  kind: "mutation",
62430
63348
  auth: "protected"
@@ -62496,7 +63414,7 @@ var mediaPlayerCapability = {
62496
63414
  /**
62497
63415
  * History (D850): volume (a level an operator or an automation sets; the
62498
63416
  * default 10 s floor folds a slider drag into its end value) and mute.
62499
- * `positionMs` is not recorded: it moves continuously while playing.
63417
+ * `position` is not recorded: it moves continuously while playing.
62500
63418
  */
62501
63419
  history: { fields: {
62502
63420
  volumeLevel: {
@@ -63458,9 +64376,9 @@ var NetworkLinkStatusSchema = object({
63458
64376
  * one whose reading has not landed must not be drawn at 0 %. Consumers
63459
64377
  * SKIP a null rather than coerce it.
63460
64378
  */
63461
- signalPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
64379
+ signal: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
63462
64380
  /** Raw received signal strength in dBm, when the firmware reports one. */
63463
- rssiDbm: number().optional().meta(readingMeta("signal-level")),
64381
+ rssi: number().optional().meta(readingMeta("signal-level")),
63464
64382
  /** Network name of a wireless link, when the firmware reports it. */
63465
64383
  ssid: string().optional(),
63466
64384
  /** Ms epoch of the last observation. Lets consumers reason about freshness. */
@@ -63496,7 +64414,7 @@ onStatusChanged: { data: object({
63496
64414
  kind: "push",
63497
64415
  empty: {
63498
64416
  type: "unknown",
63499
- signalPercent: null,
64417
+ signal: null,
63500
64418
  lastUpdated: 0
63501
64419
  }
63502
64420
  },
@@ -63519,13 +64437,13 @@ onStatusChanged: { data: object({
63519
64437
  * History (D850): recorded series.
63520
64438
  */
63521
64439
  history: { fields: {
63522
- signalPercent: {
64440
+ signal: {
63523
64441
  kind: "gauge",
63524
64442
  unit: "%",
63525
64443
  deadband: 3,
63526
64444
  minIntervalMs: 6e4
63527
64445
  },
63528
- rssiDbm: {
64446
+ rssi: {
63529
64447
  kind: "gauge",
63530
64448
  unit: "dBm",
63531
64449
  deadband: 2,
@@ -64316,10 +65234,20 @@ var PetFeederDeviceStatusSchema = _enum([
64316
65234
  ]);
64317
65235
  var gramsPortion = number().int().min(4).max(200);
64318
65236
  var PetFeederStatusSchema = object({
64319
- /** Food currently in the bowl (grams). Null when the device has not
64320
- * reported a reading yet. On dual-hopper models this is the combined
64321
- * bowl reading; per-hopper levels live in `food1`/`food2`. */
65237
+ /** Food in the TANK (hopper), as the feeder's own sensor reports it
65238
+ * (`state.food`). A coarse level code, not grams — `0` is empty. The
65239
+ * amount in the bowl is `bowlFood`. On dual-hopper models this is the
65240
+ * combined reading; per-hopper levels live in `food1`/`food2`. Null when
65241
+ * the device has not reported yet. */
64322
65242
  foodLevel: number().nullable().meta(readingMeta("none")),
65243
+ /** Food in the BOWL as the feeder reports it (`state.bowl`), in the
65244
+ * feeder's own units. Null when the model reports none. */
65245
+ bowlFood: number().nullable().meta(readingMeta("none")),
65246
+ /** True while the pet is eating (`state.eating`). */
65247
+ eating: boolean(),
65248
+ /** Whether `markFoodReplenished` does anything on this model. When false
65249
+ * the client must not offer it. */
65250
+ supportsMarkRefilled: boolean(),
64323
65251
  /** Hopper-1 food level (grams) on dual-hopper feeders; null on
64324
65252
  * single-hopper models. */
64325
65253
  food1: number().nullable().meta(readingMeta("none")),
@@ -64327,8 +65255,8 @@ var PetFeederStatusSchema = object({
64327
65255
  * single-hopper models. */
64328
65256
  food2: number().nullable().meta(readingMeta("none")),
64329
65257
  /** Derived low-food flag — mirrors the HA `food_level` binary_sensor
64330
- * (`device_class: problem`, on = low). True when the bowl is empty /
64331
- * below the feeder's low threshold. */
65258
+ * (`device_class: problem`, on = low). True when the tank reports empty,
65259
+ * or, on a dual-hopper model, when EITHER hopper is empty. */
64332
65260
  lowFood: boolean(),
64333
65261
  /** Battery charge 0..100 (%). Null on mains-powered models or when the
64334
65262
  * device has no battery reading. */
@@ -64396,7 +65324,9 @@ var petFeederCapability = {
64396
65324
  kind: "mutation",
64397
65325
  auth: "protected"
64398
65326
  }),
64399
- /** Mark a hopper as refilled (D4H/D4S/D4SH). */
65327
+ /** Tell the PetKit cloud a hopper was refilled so it stops its low-food
65328
+ * reminders (D4H/D4S/D4SH only — see `supportsMarkRefilled`). It does not
65329
+ * change any sensor reading. */
64400
65330
  markFoodReplenished: method(object({ deviceId: number().int().nonnegative() }), _void(), {
64401
65331
  kind: "mutation",
64402
65332
  auth: "protected"
@@ -64469,6 +65399,7 @@ var petFeederCapability = {
64469
65399
  */
64470
65400
  history: { fields: {
64471
65401
  foodLevel: { kind: "gauge" },
65402
+ bowlFood: { kind: "gauge" },
64472
65403
  food1: { kind: "gauge" },
64473
65404
  food2: { kind: "gauge" },
64474
65405
  batteryPower: {
@@ -64878,27 +65809,89 @@ method(_void(), PlatformCapabilitiesSchema), method(_void(), HardwareInfoSchema)
64878
65809
  * in real-world devices.
64879
65810
  */
64880
65811
  var PowerMeterStatusSchema = object({
64881
- /** Instantaneous power draw in watts. */
64882
- watts: number().optional().meta(readingMeta("power", { label: "Power" })),
65812
+ /** Instantaneous power draw (watts). */
65813
+ power: number().optional().meta(readingMeta("power", { label: "Power" })),
64883
65814
  /** Cumulative energy in kilowatt-hours since the meter was reset. */
64884
- kwhTotal: number().optional().meta(readingMeta("energy", { label: "Energy" })),
64885
- /** Voltage in volts. */
64886
- volts: number().optional().meta(readingMeta("voltage")),
65815
+ energy: number().optional().meta(readingMeta("energy", { label: "Energy" })),
65816
+ /** Voltage (volts). */
65817
+ voltage: number().optional().meta(readingMeta("voltage", { label: "Voltage" })),
64887
65818
  /** Current in amperes. */
64888
- amps: number().optional().meta(readingMeta("current")),
65819
+ current: number().optional().meta(readingMeta("current", { label: "Current" })),
64889
65820
  /** Apparent power in volt-amperes. */
64890
- va: number().optional().meta(readingMeta("apparent-power")),
65821
+ apparentPower: number().optional().meta(readingMeta("apparent-power")),
64891
65822
  /** Power factor (0..1) if reported. */
64892
65823
  powerFactor: number().min(0).max(1).optional().meta(readingMeta("ratio")),
64893
65824
  /** Ms epoch when the slice was last updated. */
64894
65825
  lastFetchedAt: number()
64895
65826
  });
65827
+ /**
65828
+ * Loads that draw metered mains power (D951). The reading is a feature of the
65829
+ * device itself — a plug, a lamp, a fan, an air conditioner, a boiler, a
65830
+ * vacuum dock — not a separate sensor beside it. A `Sensor` stays: a clamp
65831
+ * meter or a standalone energy monitor IS the device. Cover, lock, valve,
65832
+ * camera and the like are left out: their draw is not what anyone meters.
65833
+ */
65834
+ var POWER_METER_DEVICE_TYPES = [
65835
+ DeviceType.Sensor,
65836
+ DeviceType.Switch,
65837
+ DeviceType.Light,
65838
+ DeviceType.Fan,
65839
+ DeviceType.Climate,
65840
+ DeviceType.Thermostat,
65841
+ DeviceType.Humidifier,
65842
+ DeviceType.WaterHeater,
65843
+ DeviceType.MediaPlayer,
65844
+ DeviceType.Washer,
65845
+ DeviceType.Dryer,
65846
+ DeviceType.Dishwasher,
65847
+ DeviceType.Vacuum,
65848
+ DeviceType.LawnMower,
65849
+ DeviceType.PetFeeder
65850
+ ];
65851
+ /** Everything but a bare `Sensor`: a sensor that takes its reading from another sensor adds nothing. */
65852
+ var POWER_METER_CUSTOMIZE_DEVICE_TYPES = POWER_METER_DEVICE_TYPES.filter((type) => type !== DeviceType.Sensor);
65853
+ /** One scalar target per reading; each is sourced from a device of its own (D951). */
65854
+ function powerTarget(id, unit) {
65855
+ return {
65856
+ id,
65857
+ cardinality: "scalar",
65858
+ vocabulary: {
65859
+ cap: "power-meter",
65860
+ stateField: id
65861
+ },
65862
+ deviceTypes: POWER_METER_CUSTOMIZE_DEVICE_TYPES,
65863
+ apply: "add",
65864
+ path: id,
65865
+ sources: [{
65866
+ kind: "numeric",
65867
+ requiredUnit: unit,
65868
+ transforms: [{ kind: "identity" }]
65869
+ }],
65870
+ companions: [{
65871
+ kind: "clock",
65872
+ path: "lastFetchedAt",
65873
+ when: "always"
65874
+ }],
65875
+ sourceReport: { status: "assignment-status" },
65876
+ advancedExpression: true
65877
+ };
65878
+ }
65879
+ /** "Power and energy" extension: power, energy, voltage and current from other devices (D951). */
65880
+ var powerMeterCustomize = {
65881
+ version: 1,
65882
+ targets: [
65883
+ powerTarget("power", "W"),
65884
+ powerTarget("energy", "kWh"),
65885
+ powerTarget("voltage", "V"),
65886
+ powerTarget("current", "A")
65887
+ ]
65888
+ };
64896
65889
  var powerMeterCapability = {
64897
65890
  name: "power-meter",
64898
65891
  scope: "device",
64899
65892
  deviceNative: true,
64900
65893
  mode: "singleton",
64901
- deviceTypes: [DeviceType.Sensor],
65894
+ deviceTypes: POWER_METER_DEVICE_TYPES,
64902
65895
  methods: {},
64903
65896
  status: {
64904
65897
  schema: PowerMeterStatusSchema,
@@ -64906,41 +65899,41 @@ var powerMeterCapability = {
64906
65899
  },
64907
65900
  runtimeState: PowerMeterStatusSchema,
64908
65901
  /**
64909
- * Runtime-state durability: **restored** — as `numeric-sensor`; `kwhTotal` is an accumulator whose restored value is the baseline.
65902
+ * Runtime-state durability: **restored** — as `numeric-sensor`; `energy` is an accumulator whose restored value is the baseline.
64910
65903
  *
64911
65904
  * See `RuntimeStateDurability`. Enforced by
64912
65905
  * `scripts/check-runtime-state-durability.ts`.
64913
65906
  */
64914
65907
  durability: "restored",
64915
65908
  /**
64916
- * History (D850): recorded series. Gauges are floored at 30 s; `kwhTotal` is the one monotonic meter (counter).
65909
+ * History (D850): recorded series. Gauges are floored at 30 s; `energy` is the one monotonic meter (counter).
64917
65910
  */
64918
65911
  history: { fields: {
64919
- watts: {
65912
+ power: {
64920
65913
  kind: "gauge",
64921
65914
  unit: "W",
64922
65915
  deadband: 1,
64923
65916
  minIntervalMs: 3e4
64924
65917
  },
64925
- kwhTotal: {
65918
+ energy: {
64926
65919
  kind: "counter",
64927
65920
  unit: "kWh",
64928
65921
  deadband: .01,
64929
65922
  minIntervalMs: 6e4
64930
65923
  },
64931
- volts: {
65924
+ voltage: {
64932
65925
  kind: "gauge",
64933
65926
  unit: "V",
64934
65927
  deadband: 1,
64935
65928
  minIntervalMs: 3e4
64936
65929
  },
64937
- amps: {
65930
+ current: {
64938
65931
  kind: "gauge",
64939
65932
  unit: "A",
64940
65933
  deadband: .05,
64941
65934
  minIntervalMs: 3e4
64942
65935
  },
64943
- va: {
65936
+ apparentPower: {
64944
65937
  kind: "gauge",
64945
65938
  unit: "VA",
64946
65939
  deadband: 1,
@@ -64955,7 +65948,8 @@ var powerMeterCapability = {
64955
65948
  } },
64956
65949
  /** Clock fields: written, but excluded from the compare that decides
64957
65950
  * whether persisting is worth a SQLite commit. */
64958
- volatileStateFields: ["lastFetchedAt"]
65951
+ volatileStateFields: ["lastFetchedAt"],
65952
+ customize: powerMeterCustomize
64959
65953
  };
64960
65954
  /**
64961
65955
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
@@ -64989,9 +65983,6 @@ var PresenceStatusSchema = object({
64989
65983
  location: string().nullable(),
64990
65984
  /** GPS coordinates when available. Null otherwise. */
64991
65985
  gps: GpsLocationSchema.nullable(),
64992
- /** Optional battery level of the tracking device (0..100). Null
64993
- * when not reported. */
64994
- batteryPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
64995
65986
  /** Ms epoch when the slice was last updated. */
64996
65987
  lastChangedAt: number()
64997
65988
  });
@@ -65020,14 +66011,7 @@ var presenceCapability = {
65020
66011
  * `scripts/check-runtime-state-durability.ts`.
65021
66012
  */
65022
66013
  durability: "restored",
65023
- /**
65024
- * History (D850): recorded series.
65025
- */
65026
- history: { fields: { batteryPercent: {
65027
- kind: "gauge",
65028
- unit: "%",
65029
- deadband: 1
65030
- } } },
66014
+ history: "none",
65031
66015
  /** Clock fields: written, but excluded from the compare that decides
65032
66016
  * whether persisting is worth a SQLite commit. */
65033
66017
  volatileStateFields: ["lastChangedAt"]
@@ -65042,7 +66026,7 @@ var presenceCapability = {
65042
66026
  */
65043
66027
  var PressureSensorStatusSchema = object({
65044
66028
  /** Current pressure in hPa. `null` when the sample was refused (D393). */
65045
- hpa: number().nullable().meta(readingMeta("pressure", { precision: 0 })),
66029
+ pressure: number().nullable().meta(readingMeta("pressure", { precision: 0 })),
65046
66030
  /** Ms epoch when the slice was last updated. */
65047
66031
  lastFetchedAt: number()
65048
66032
  });
@@ -65068,7 +66052,7 @@ var pressureSensorCapability = {
65068
66052
  /**
65069
66053
  * History (D850): recorded series.
65070
66054
  */
65071
- history: { fields: { hpa: {
66055
+ history: { fields: { pressure: {
65072
66056
  kind: "gauge",
65073
66057
  unit: "hPa",
65074
66058
  deadband: .1
@@ -65748,6 +66732,8 @@ var runningCustomize = {
65748
66732
  stateField: "running"
65749
66733
  },
65750
66734
  deviceTypes: [
66735
+ DeviceType.Washer,
66736
+ DeviceType.Dryer,
65751
66737
  DeviceType.Dishwasher,
65752
66738
  DeviceType.Vacuum,
65753
66739
  DeviceType.LawnMower,
@@ -68640,7 +69626,8 @@ var switchCapability = {
68640
69626
  deviceTypes: [
68641
69627
  DeviceType.Switch,
68642
69628
  DeviceType.Siren,
68643
- DeviceType.Light
69629
+ DeviceType.Light,
69630
+ DeviceType.Fan
68644
69631
  ],
68645
69632
  methods: { setState: method(object({
68646
69633
  deviceId: number(),
@@ -69279,7 +70266,7 @@ var tamperCapability = {
69279
70266
  */
69280
70267
  var TemperatureSensorStatusSchema = object({
69281
70268
  /** Current temperature in Celsius. `null` when the sample was refused (D393). */
69282
- celsius: number().nullable().meta(readingMeta("temperature", {
70269
+ temperature: number().nullable().meta(readingMeta("temperature", {
69283
70270
  precision: 1,
69284
70271
  label: "Temperature"
69285
70272
  })),
@@ -69308,7 +70295,7 @@ var temperatureSensorCapability = {
69308
70295
  /**
69309
70296
  * History (D850): recorded series.
69310
70297
  */
69311
- history: { fields: { celsius: {
70298
+ history: { fields: { temperature: {
69312
70299
  kind: "gauge",
69313
70300
  unit: "°C",
69314
70301
  deadband: .1
@@ -69605,7 +70592,7 @@ var VacuumControlStatusSchema = object({
69605
70592
  /** Speed tokens the hardware accepts — drives the UI selector. */
69606
70593
  availableFanSpeeds: array(string()),
69607
70594
  /** 0..100 cleaning-completion percentage of the current task, or null. */
69608
- progressPercent: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
70595
+ progress: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
69609
70596
  /** Current error code (0 / null = no error). */
69610
70597
  errorCode: number().nullable().meta(readingMeta("none")),
69611
70598
  /** Human label for {@link errorCode}, or null when none / undecodable. */
@@ -70986,8 +71973,9 @@ function withClipEventLabels(provider, deps) {
70986
71973
  listClips
70987
71974
  };
70988
71975
  }
71976
+ DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.ValvePositionable, DeviceFeature.MediaPlayerVolume, DeviceFeature.ClimateFanMode;
70989
71977
  SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
70990
- 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;
71978
+ 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;
70991
71979
  String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
70992
71980
  DeviceRole.BinarySensor, DeviceRole.MotionSensor;
70993
71981
  new Set(CAP_NAMES);
@@ -71331,6 +72319,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
71331
72319
  featureProbe: featureProbeCapability,
71332
72320
  flood: floodCapability,
71333
72321
  gas: gasCapability,
72322
+ groupActive: groupActiveCapability,
71334
72323
  groupCommands: groupCommandsCapability,
71335
72324
  groupStatus: groupStatusCapability,
71336
72325
  heatingValve: heatingValveCapability,
@@ -71342,6 +72331,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
71342
72331
  lawnMowerControl: lawnMowerControlCapability,
71343
72332
  lockControl: lockControlCapability,
71344
72333
  mediaPlayer: mediaPlayerCapability,
72334
+ meter: meterCapability,
71345
72335
  motion: motionCapability,
71346
72336
  motionTrigger: motionTriggerCapability,
71347
72337
  motionZones: motionZonesCapability,
@@ -71404,7 +72394,7 @@ var BaseDevice = class {
71404
72394
  * `device-local-state.ts`. Drivers access via:
71405
72395
  *
71406
72396
  * `this.state.battery.sleeping = true` // patches the battery slice
71407
- * `const pct = this.state.battery.percentage` // reads the battery slice
72397
+ * `const pct = this.state.battery.level` // reads the battery slice
71408
72398
  * `this.state.deviceStatus.online = true` // mirrors `markOnline(true)`
71409
72399
  *
71410
72400
  * Adding a new cap with `runtimeState:` automatically extends this
@@ -71444,7 +72434,7 @@ var BaseDevice = class {
71444
72434
  * shape; drivers don't redeclare it, they just write through.
71445
72435
  *
71446
72436
  * Read: `this.runtimeState.getCapState('battery')` →
71447
- * `{percentage, charging, sleeping, lastUpdated}` for any
72437
+ * `{level, charging, sleeping, lastUpdated}` for any
71448
72438
  * provider that registers `batteryCapability`.
71449
72439
  * Write: `this.runtimeState.setCapState('battery', { … })`.
71450
72440
  *
@@ -72605,7 +73595,7 @@ var BaseDeviceProvider = class extends BaseAddon {
72605
73595
  function widenDeviceConstructor(ctor) {
72606
73596
  return ctor;
72607
73597
  }
72608
- 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;
73598
+ 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;
72609
73599
  new Set(Object.values(DeviceType));
72610
73600
  Object.freeze({
72611
73601
  "accessories.getStatus": {
@@ -72622,6 +73612,104 @@ Object.freeze({
72622
73612
  access: "create",
72623
73613
  role: "admin"
72624
73614
  },
73615
+ "actions.create": {
73616
+ capName: "actions",
73617
+ capScope: "system",
73618
+ addonId: null,
73619
+ access: "create",
73620
+ role: "admin"
73621
+ },
73622
+ "actions.delete": {
73623
+ capName: "actions",
73624
+ capScope: "system",
73625
+ addonId: null,
73626
+ access: "delete",
73627
+ role: "admin"
73628
+ },
73629
+ "actions.get": {
73630
+ capName: "actions",
73631
+ capScope: "system",
73632
+ addonId: null,
73633
+ access: "view",
73634
+ role: "viewer"
73635
+ },
73636
+ "actions.getLinks": {
73637
+ capName: "actions",
73638
+ capScope: "system",
73639
+ addonId: null,
73640
+ access: "view",
73641
+ role: "admin"
73642
+ },
73643
+ "actions.getTraces": {
73644
+ capName: "actions",
73645
+ capScope: "system",
73646
+ addonId: null,
73647
+ access: "view",
73648
+ role: "admin"
73649
+ },
73650
+ "actions.list": {
73651
+ capName: "actions",
73652
+ capScope: "system",
73653
+ addonId: null,
73654
+ access: "view",
73655
+ role: "admin"
73656
+ },
73657
+ "actions.listForCamera": {
73658
+ capName: "actions",
73659
+ capScope: "system",
73660
+ addonId: null,
73661
+ access: "view",
73662
+ role: "viewer"
73663
+ },
73664
+ "actions.run": {
73665
+ capName: "actions",
73666
+ capScope: "system",
73667
+ addonId: null,
73668
+ access: "create",
73669
+ role: "viewer"
73670
+ },
73671
+ "actions.setLinks": {
73672
+ capName: "actions",
73673
+ capScope: "system",
73674
+ addonId: null,
73675
+ access: "create",
73676
+ role: "admin"
73677
+ },
73678
+ "actions.stop": {
73679
+ capName: "actions",
73680
+ capScope: "system",
73681
+ addonId: null,
73682
+ access: "create",
73683
+ role: "admin"
73684
+ },
73685
+ "actions.update": {
73686
+ capName: "actions",
73687
+ capScope: "system",
73688
+ addonId: null,
73689
+ access: "create",
73690
+ role: "admin"
73691
+ },
73692
+ "actionSource.listActions": {
73693
+ capName: "action-source",
73694
+ capScope: "system",
73695
+ addonId: null,
73696
+ access: "view",
73697
+ role: "admin"
73698
+ },
73699
+ "actionSource.runAction": {
73700
+ capName: "action-source",
73701
+ capScope: "system",
73702
+ addonId: null,
73703
+ access: "create",
73704
+ role: "admin"
73705
+ },
73706
+ "actionSource.stopAction": {
73707
+ capName: "action-source",
73708
+ capScope: "system",
73709
+ addonId: null,
73710
+ access: "create",
73711
+ role: "admin"
73712
+ },
72625
73713
  "addonPages.listPages": {
72626
73714
  capName: "addon-pages",
72627
73715
  capScope: "system",
@@ -73903,6 +74991,13 @@ Object.freeze({
73903
74991
  access: "view",
73904
74992
  role: "admin"
73905
74993
  },
74994
+ "coreBlocks.getAutomationRunState": {
74995
+ capName: "core-blocks",
74996
+ capScope: "system",
74997
+ addonId: null,
74998
+ access: "view",
74999
+ role: "admin"
75000
+ },
73906
75001
  "coreBlocks.getBlockSettings": {
73907
75002
  capName: "core-blocks",
73908
75003
  capScope: "system",
@@ -73924,6 +75019,13 @@ Object.freeze({
73924
75019
  access: "view",
73925
75020
  role: "admin"
73926
75021
  },
75022
+ "coreBlocks.getTraces": {
75023
+ capName: "core-blocks",
75024
+ capScope: "system",
75025
+ addonId: null,
75026
+ access: "view",
75027
+ role: "admin"
75028
+ },
73927
75029
  "coreBlocks.getTypeDefs": {
73928
75030
  capName: "core-blocks",
73929
75031
  capScope: "system",
@@ -73959,6 +75061,13 @@ Object.freeze({
73959
75061
  access: "create",
73960
75062
  role: "admin"
73961
75063
  },
75064
+ "coreBlocks.reportAutomationRun": {
75065
+ capName: "core-blocks",
75066
+ capScope: "system",
75067
+ addonId: null,
75068
+ access: "create",
75069
+ role: "admin"
75070
+ },
73962
75071
  "coreBlocks.restart": {
73963
75072
  capName: "core-blocks",
73964
75073
  capScope: "system",
@@ -75828,6 +76937,13 @@ Object.freeze({
75828
76937
  access: "view",
75829
76938
  role: "viewer"
75830
76939
  },
76940
+ "groupActive.getStatus": {
76941
+ capName: "group-active",
76942
+ capScope: "device",
76943
+ addonId: null,
76944
+ access: "view",
76945
+ role: "viewer"
76946
+ },
75831
76947
  "groupCommands.getStatus": {
75832
76948
  capName: "group-commands",
75833
76949
  capScope: "device",
@@ -76794,6 +77910,13 @@ Object.freeze({
76794
77910
  access: "create",
76795
77911
  role: "admin"
76796
77912
  },
77913
+ "meter.getStatus": {
77914
+ capName: "meter",
77915
+ capScope: "device",
77916
+ addonId: null,
77917
+ access: "view",
77918
+ role: "viewer"
77919
+ },
76797
77920
  "metricsProvider.collectSnapshot": {
76798
77921
  capName: "metrics-provider",
76799
77922
  capScope: "system",
@@ -82518,7 +83641,7 @@ var ACTUATOR_CAP_VOCABULARY = {
82518
83641
  label: t("Full brightness", "Luminosità massima"),
82519
83642
  phrase: t("Set {device} to full brightness", "Porta {device} alla massima luminosità"),
82520
83643
  icon: "sun",
82521
- args: { percentage: 100 }
83644
+ args: { level: 100 }
82522
83645
  },
82523
83646
  {
82524
83647
  id: "brightness.half",
@@ -82526,7 +83649,7 @@ var ACTUATOR_CAP_VOCABULARY = {
82526
83649
  label: t("Half brightness", "Luminosità a metà"),
82527
83650
  phrase: t("Dim {device} to half", "Abbassa {device} a metà luminosità"),
82528
83651
  icon: "sun-dim",
82529
- args: { percentage: 50 }
83652
+ args: { level: 50 }
82530
83653
  },
82531
83654
  {
82532
83655
  id: "brightness.off",
@@ -82534,16 +83657,16 @@ var ACTUATOR_CAP_VOCABULARY = {
82534
83657
  label: t("Brightness off", "Luminosità a zero"),
82535
83658
  phrase: t("Dim {device} to zero", "Abbassa {device} a zero"),
82536
83659
  icon: "lightbulb-off",
82537
- args: { percentage: 0 }
83660
+ args: { level: 0 }
82538
83661
  },
82539
83662
  {
82540
83663
  id: "brightness.set",
82541
83664
  method: "setBrightness",
82542
83665
  label: t("Set brightness", "Imposta la luminosità"),
82543
- phrase: t("Set the brightness of {device} to {percentage}", "Imposta la luminosità di {device} a {percentage}"),
83666
+ phrase: t("Set the brightness of {device} to {level}", "Imposta la luminosità di {device} a {level}"),
82544
83667
  icon: "sun-medium",
82545
83668
  openArgs: [{
82546
- key: "percentage",
83669
+ key: "level",
82547
83670
  label: PERCENT,
82548
83671
  offer: {
82549
83672
  kind: "number",
@@ -82557,13 +83680,13 @@ var ACTUATOR_CAP_VOCABULARY = {
82557
83680
  ],
82558
83681
  state: [{
82559
83682
  kind: "numeric",
82560
- field: "percentage",
83683
+ field: "level",
82561
83684
  quantity: t("the brightness", "la luminosità"),
82562
83685
  label: t("Brightness", "Luminosità"),
82563
83686
  unit: "%",
82564
83687
  icon: "sun"
82565
83688
  }],
82566
- events: { onBrightnessChanged: { notOperatorFacing: "the `percentage` state trigger reads the same change" } }
83689
+ events: { onBrightnessChanged: { notOperatorFacing: "the `level` state trigger reads the same change" } }
82567
83690
  },
82568
83691
  color: {
82569
83692
  scope: "device",
@@ -82577,7 +83700,7 @@ var ACTUATOR_CAP_VOCABULARY = {
82577
83700
  icon: "sun",
82578
83701
  args: { color: {
82579
83702
  mode: "mired",
82580
- mireds: 370
83703
+ colorTemperature: 370
82581
83704
  } }
82582
83705
  },
82583
83706
  {
@@ -82588,7 +83711,7 @@ var ACTUATOR_CAP_VOCABULARY = {
82588
83711
  icon: "snowflake",
82589
83712
  args: { color: {
82590
83713
  mode: "mired",
82591
- mireds: 200
83714
+ colorTemperature: 200
82592
83715
  } }
82593
83716
  },
82594
83717
  {
@@ -83202,7 +84325,7 @@ var ACTUATOR_CAP_VOCABULARY = {
83202
84325
  label: t("Fan off", "Ventilatore spento"),
83203
84326
  phrase: t("Stop {device}", "Ferma {device}"),
83204
84327
  icon: "power-off",
83205
- args: { percentage: 0 }
84328
+ args: { speed: 0 }
83206
84329
  },
83207
84330
  {
83208
84331
  id: "fan.full",
@@ -83210,16 +84333,16 @@ var ACTUATOR_CAP_VOCABULARY = {
83210
84333
  label: t("Fan full", "Ventilatore al massimo"),
83211
84334
  phrase: t("Run {device} at full speed", "Porta {device} alla massima velocità"),
83212
84335
  icon: "fan",
83213
- args: { percentage: 100 }
84336
+ args: { speed: 100 }
83214
84337
  },
83215
84338
  {
83216
84339
  id: "fan.speed",
83217
84340
  method: "setPercentage",
83218
84341
  label: t("Set speed", "Imposta la velocità"),
83219
- phrase: t("Set the speed of {device} to {percentage}", "Imposta la velocità di {device} al {percentage}"),
84342
+ phrase: t("Set the speed of {device} to {speed}", "Imposta la velocità di {device} al {speed}"),
83220
84343
  icon: "fan",
83221
84344
  openArgs: [{
83222
- key: "percentage",
84345
+ key: "speed",
83223
84346
  label: t("Speed", "Velocità"),
83224
84347
  offer: {
83225
84348
  kind: "number",
@@ -83281,7 +84404,7 @@ var ACTUATOR_CAP_VOCABULARY = {
83281
84404
  ],
83282
84405
  state: [{
83283
84406
  kind: "numeric",
83284
- field: "percentage",
84407
+ field: "speed",
83285
84408
  quantity: t("the speed", "la velocità"),
83286
84409
  label: t("Speed", "Velocità"),
83287
84410
  unit: "%",
@@ -84079,7 +85202,7 @@ var APPLIANCE_CAP_VOCABULARY = {
84079
85202
  },
84080
85203
  {
84081
85204
  kind: "numeric",
84082
- field: "progressPercent",
85205
+ field: "progress",
84083
85206
  quantity: t("the cycle progress", "l’avanzamento del lavaggio"),
84084
85207
  label: t("Progress", "Avanzamento"),
84085
85208
  unit: "%",
@@ -84437,10 +85560,10 @@ var APPLIANCE_CAP_VOCABULARY = {
84437
85560
  id: "media.seek",
84438
85561
  method: "seek",
84439
85562
  label: t("Seek", "Vai al punto"),
84440
- phrase: t("Move {device} to {positionMs}", "Porta {device} al punto {positionMs}"),
85563
+ phrase: t("Move {device} to {position}", "Porta {device} al punto {position}"),
84441
85564
  icon: "fast-forward",
84442
85565
  openArgs: [{
84443
- key: "positionMs",
85566
+ key: "position",
84444
85567
  label: t("Position", "Posizione"),
84445
85568
  offer: {
84446
85569
  kind: "number",
@@ -84892,7 +86015,39 @@ var APPLIANCE_CAP_VOCABULARY = {
84892
86015
  phrase: t("When {device} finishes", "Quando {device} finisce"),
84893
86016
  icon: "square"
84894
86017
  }
84895
- }
86018
+ },
86019
+ overrides: { byType: {
86020
+ [DeviceType.Washer]: {
86021
+ state: { running: {
86022
+ whenTrue: t("When the washing machine starts", "Quando la lavatrice inizia"),
86023
+ whenFalse: t("When the washing machine has finished", "Quando la lavatrice ha finito")
86024
+ } },
86025
+ events: {
86026
+ onStarted: { phrase: t("When the washing machine starts", "Quando la lavatrice inizia") },
86027
+ onFinished: { phrase: t("When the washing machine has finished", "Quando la lavatrice ha finito") }
86028
+ }
86029
+ },
86030
+ [DeviceType.Dryer]: {
86031
+ state: { running: {
86032
+ whenTrue: t("When the dryer starts", "Quando l'asciugatrice inizia"),
86033
+ whenFalse: t("When the dryer has finished", "Quando l'asciugatrice ha finito")
86034
+ } },
86035
+ events: {
86036
+ onStarted: { phrase: t("When the dryer starts", "Quando l'asciugatrice inizia") },
86037
+ onFinished: { phrase: t("When the dryer has finished", "Quando l'asciugatrice ha finito") }
86038
+ }
86039
+ },
86040
+ [DeviceType.Dishwasher]: {
86041
+ state: { running: {
86042
+ whenTrue: t("When the dishwasher starts", "Quando la lavastoviglie inizia"),
86043
+ whenFalse: t("When the dishwasher has finished", "Quando la lavastoviglie ha finito")
86044
+ } },
86045
+ events: {
86046
+ onStarted: { phrase: t("When the dishwasher starts", "Quando la lavastoviglie inizia") },
86047
+ onFinished: { phrase: t("When the dishwasher has finished", "Quando la lavastoviglie ha finito") }
86048
+ }
86049
+ }
86050
+ } }
84896
86051
  },
84897
86052
  update: {
84898
86053
  scope: "device",
@@ -85457,7 +86612,7 @@ var SENSOR_CAP_VOCABULARY = {
85457
86612
  state: [
85458
86613
  {
85459
86614
  kind: "numeric",
85460
- field: "co2Ppm",
86615
+ field: "co2",
85461
86616
  quantity: t("the CO₂", "la CO₂"),
85462
86617
  label: t("CO₂", "CO₂"),
85463
86618
  unit: "ppm",
@@ -85465,7 +86620,7 @@ var SENSOR_CAP_VOCABULARY = {
85465
86620
  },
85466
86621
  {
85467
86622
  kind: "numeric",
85468
- field: "vocPpb",
86623
+ field: "voc",
85469
86624
  quantity: t("the VOC level", "il livello di COV"),
85470
86625
  label: t("VOC", "COV"),
85471
86626
  unit: "ppb",
@@ -85501,7 +86656,7 @@ var SENSOR_CAP_VOCABULARY = {
85501
86656
  noun: t("Light level", "Luminosità ambiente"),
85502
86657
  state: [{
85503
86658
  kind: "numeric",
85504
- field: "lux",
86659
+ field: "illuminance",
85505
86660
  quantity: t("the light level", "la luminosità"),
85506
86661
  label: t("Illuminance", "Illuminamento"),
85507
86662
  unit: "lx",
@@ -85664,6 +86819,10 @@ var SENSOR_CAP_VOCABULARY = {
85664
86819
  icon: "flame"
85665
86820
  }]
85666
86821
  },
86822
+ "group-active": {
86823
+ scope: "device",
86824
+ noun: t("Group state", "Stato del gruppo")
86825
+ },
85667
86826
  "group-commands": {
85668
86827
  scope: "device",
85669
86828
  noun: t("Group command", "Comando di gruppo")
@@ -85700,7 +86859,7 @@ var SENSOR_CAP_VOCABULARY = {
85700
86859
  noun: t("Humidity", "Umidità"),
85701
86860
  state: [{
85702
86861
  kind: "numeric",
85703
- field: "percent",
86862
+ field: "humidity",
85704
86863
  quantity: t("the humidity", "l’umidità"),
85705
86864
  label: t("Humidity", "Umidità"),
85706
86865
  unit: "%",
@@ -85720,6 +86879,17 @@ var SENSOR_CAP_VOCABULARY = {
85720
86879
  }],
85721
86880
  events: { onMotionChanged: { notOperatorFacing: "the `detected` state trigger phrases both edges, from the mirror that survives a dropped event (D49)" } }
85722
86881
  },
86882
+ meter: {
86883
+ scope: "device",
86884
+ noun: t("Meter", "Contatore"),
86885
+ state: [{
86886
+ kind: "numeric",
86887
+ field: "value",
86888
+ quantity: t("the total", "il totale"),
86889
+ label: t("Total", "Totale"),
86890
+ icon: "gauge"
86891
+ }]
86892
+ },
85723
86893
  "numeric-sensor": {
85724
86894
  scope: "device",
85725
86895
  noun: t("Sensor", "Sensore"),
@@ -85737,7 +86907,7 @@ var SENSOR_CAP_VOCABULARY = {
85737
86907
  state: [
85738
86908
  {
85739
86909
  kind: "numeric",
85740
- field: "watts",
86910
+ field: "power",
85741
86911
  quantity: t("the power draw", "il consumo"),
85742
86912
  label: t("Power", "Potenza"),
85743
86913
  unit: "W",
@@ -85745,7 +86915,7 @@ var SENSOR_CAP_VOCABULARY = {
85745
86915
  },
85746
86916
  {
85747
86917
  kind: "numeric",
85748
- field: "kwhTotal",
86918
+ field: "energy",
85749
86919
  quantity: t("the energy used", "l’energia consumata"),
85750
86920
  label: t("Energy", "Energia"),
85751
86921
  unit: "kWh",
@@ -85753,7 +86923,7 @@ var SENSOR_CAP_VOCABULARY = {
85753
86923
  },
85754
86924
  {
85755
86925
  kind: "numeric",
85756
- field: "volts",
86926
+ field: "voltage",
85757
86927
  quantity: t("the voltage", "la tensione"),
85758
86928
  label: t("Voltage", "Tensione"),
85759
86929
  unit: "V",
@@ -85761,7 +86931,7 @@ var SENSOR_CAP_VOCABULARY = {
85761
86931
  },
85762
86932
  {
85763
86933
  kind: "numeric",
85764
- field: "amps",
86934
+ field: "current",
85765
86935
  quantity: t("the current", "la corrente"),
85766
86936
  label: t("Current", "Corrente"),
85767
86937
  unit: "A",
@@ -85778,13 +86948,6 @@ var SENSOR_CAP_VOCABULARY = {
85778
86948
  label: t("Where", "Posizione"),
85779
86949
  phrase: t("When {device} is at {value}", "Quando {device} è in {value}"),
85780
86950
  icon: "map-pin"
85781
- }, {
85782
- kind: "numeric",
85783
- field: "batteryPercent",
85784
- quantity: t("the phone battery", "la batteria del telefono"),
85785
- label: t("Battery", "Batteria"),
85786
- unit: "%",
85787
- icon: "battery"
85788
86951
  }]
85789
86952
  },
85790
86953
  "pressure-sensor": {
@@ -85792,7 +86955,7 @@ var SENSOR_CAP_VOCABULARY = {
85792
86955
  noun: t("Pressure", "Pressione"),
85793
86956
  state: [{
85794
86957
  kind: "numeric",
85795
- field: "hpa",
86958
+ field: "pressure",
85796
86959
  quantity: t("the pressure", "la pressione"),
85797
86960
  label: t("Pressure", "Pressione"),
85798
86961
  unit: "hPa",
@@ -85828,7 +86991,7 @@ var SENSOR_CAP_VOCABULARY = {
85828
86991
  noun: t("Temperature", "Temperatura"),
85829
86992
  state: [{
85830
86993
  kind: "numeric",
85831
- field: "celsius",
86994
+ field: "temperature",
85832
86995
  quantity: t("the temperature", "la temperatura"),
85833
86996
  label: t("Temperature", "Temperatura"),
85834
86997
  unit: "°C",
@@ -85899,7 +87062,7 @@ var SENSOR_CAP_VOCABULARY = {
85899
87062
  state: [
85900
87063
  {
85901
87064
  kind: "numeric",
85902
- field: "percentage",
87065
+ field: "level",
85903
87066
  quantity: t("the battery level", "il livello della batteria"),
85904
87067
  label: t("Battery", "Batteria"),
85905
87068
  unit: "%",
@@ -85941,7 +87104,7 @@ var SENSOR_CAP_VOCABULARY = {
85941
87104
  icon: "battery-charging"
85942
87105
  }
85943
87106
  ],
85944
- events: { onStatusChanged: { notOperatorFacing: "the percentage / sleeping / charging state triggers each read one field of this change" } },
87107
+ events: { onStatusChanged: { notOperatorFacing: "the level / sleeping / charging state triggers each read one field of this change" } },
85945
87108
  extraEvents: [{
85946
87109
  category: EventCategory.DeviceAwake,
85947
87110
  label: t("Woke up", "Risvegliato"),
@@ -85959,7 +87122,7 @@ var SENSOR_CAP_VOCABULARY = {
85959
87122
  noun: t("Network link", "Collegamento di rete"),
85960
87123
  state: [{
85961
87124
  kind: "numeric",
85962
- field: "signalPercent",
87125
+ field: "signal",
85963
87126
  quantity: t("the signal strength", "l’intensità del segnale"),
85964
87127
  label: t("Signal", "Segnale"),
85965
87128
  unit: "%",
@@ -86052,6 +87215,8 @@ var ML = "model and training machinery — no device action";
86052
87215
  var INTERNAL = "internal plumbing between addons — never operator-facing";
86053
87216
  /** Every system-scoped cap, with why it is not a device's vocabulary. */
86054
87217
  var SYSTEM_CAP_VOCABULARY = {
87218
+ "action-source": system(INTERNAL),
87219
+ actions: system("declared actions — run from the Actions page and from the cameras that link them"),
86055
87220
  "addon-pages": system(UI_PLUMBING),
86056
87221
  "addon-pages-source": system(UI_PLUMBING),
86057
87222
  "addon-routes": system(UI_PLUMBING),
@@ -86192,8 +87357,47 @@ function projectAction(cap, action) {
86192
87357
  };
86193
87358
  }
86194
87359
  Object.entries(CAP_VOCABULARY_BY_NAME).flatMap(([cap, entry]) => entry.scope === "device" ? (entry.actions ?? []).map((a) => projectAction(cap, a)) : []);
86195
- 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;
87360
+ 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;
86196
87361
  DeviceFeature.BatteryOperated;
87362
+ DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
87363
+ 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.";
87364
+ 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.";
87365
+ var ALEXA_REASON = "Alexa has no laundry category in this export, and neither power nor running has an Alexa interface.";
87366
+ var GOOGLE_REASON = "Google WASHER, DRYER and DISHWASHER require RunCycle. A power threshold is not that trait, and this export does not publish RunCycle.";
87367
+ 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.";
87368
+ function withheld(reason) {
87369
+ return {
87370
+ [DeviceType.Washer]: {
87371
+ exported: false,
87372
+ reason
87373
+ },
87374
+ [DeviceType.Dryer]: {
87375
+ exported: false,
87376
+ reason
87377
+ },
87378
+ [DeviceType.Dishwasher]: {
87379
+ exported: false,
87380
+ reason
87381
+ }
87382
+ };
87383
+ }
87384
+ function offered(received) {
87385
+ return {
87386
+ [DeviceType.Washer]: {
87387
+ exported: true,
87388
+ as: received
87389
+ },
87390
+ [DeviceType.Dryer]: {
87391
+ exported: true,
87392
+ as: received
87393
+ },
87394
+ [DeviceType.Dishwasher]: {
87395
+ exported: true,
87396
+ as: received
87397
+ }
87398
+ };
87399
+ }
87400
+ offered(HA_AS), withheld(HOMEKIT_REASON), withheld(ALEXA_REASON), withheld(GOOGLE_REASON), withheld(MATTER_REASON);
86197
87401
  /** Reject after `ms`; always clears its own timer. */
86198
87402
  async function withTimeout$1(promise, ms, label) {
86199
87403
  let timer;
@@ -86427,6 +87631,31 @@ Object.freeze({
86427
87631
  form: "single",
86428
87632
  optional: false
86429
87633
  }],
87634
+ "actions.get": [{
87635
+ name: "deviceId",
87636
+ form: "single",
87637
+ optional: true
87638
+ }],
87639
+ "actions.getLinks": [{
87640
+ name: "deviceId",
87641
+ form: "single",
87642
+ optional: false
87643
+ }],
87644
+ "actions.listForCamera": [{
87645
+ name: "deviceId",
87646
+ form: "single",
87647
+ optional: false
87648
+ }],
87649
+ "actions.run": [{
87650
+ name: "deviceId",
87651
+ form: "single",
87652
+ optional: true
87653
+ }],
87654
+ "actions.setLinks": [{
87655
+ name: "deviceId",
87656
+ form: "single",
87657
+ optional: false
87658
+ }],
86430
87659
  "addonSettings.getDeviceSettings": [{
86431
87660
  name: "deviceId",
86432
87661
  form: "single",
@@ -87378,6 +88607,11 @@ Object.freeze({
87378
88607
  form: "single",
87379
88608
  optional: false
87380
88609
  }],
88610
+ "groupActive.getStatus": [{
88611
+ name: "deviceId",
88612
+ form: "single",
88613
+ optional: false
88614
+ }],
87381
88615
  "groupCommands.getStatus": [{
87382
88616
  name: "deviceId",
87383
88617
  form: "single",
@@ -87588,6 +88822,11 @@ Object.freeze({
87588
88822
  form: "single",
87589
88823
  optional: false
87590
88824
  }],
88825
+ "meter.getStatus": [{
88826
+ name: "deviceId",
88827
+ form: "single",
88828
+ optional: false
88829
+ }],
87591
88830
  "motion.getStatus": [{
87592
88831
  name: "deviceId",
87593
88832
  form: "single",
@@ -89195,7 +90434,6 @@ Object.freeze({
89195
90434
  "network-access": "ingress",
89196
90435
  "smtp-provider": "email"
89197
90436
  });
89198
- DeviceType.Camera;
89199
90437
  /**
89200
90438
  * A saved Customize assignment (D936). The schema is the type: callers use
89201
90439
  * `z.infer`, they do not restate the shape.
@@ -90550,6 +91788,7 @@ DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
90550
91788
  DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
90551
91789
  DEFAULT_NATIVE_LEASE_SETTINGS.sceneBudgetMb;
90552
91790
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
91791
+ String.raw`(?<=^|["'(\s>,\[{])`;
90553
91792
  var MB = 1024 * 1024;
90554
91793
  1024 * MB, 3072 * MB;
90555
91794
  /**
@@ -95299,7 +96538,7 @@ var HikvisionLightAccessory = class extends BaseDevice {
95299
96538
  }
95300
96539
  brightnessView() {
95301
96540
  return this.getCapSlice(brightnessCapability) ?? {
95302
- percentage: this.config.get("defaultBrightness") ?? 100,
96541
+ level: this.config.get("defaultBrightness") ?? 100,
95303
96542
  lastChangedAt: 0
95304
96543
  };
95305
96544
  }
@@ -95320,9 +96559,9 @@ var HikvisionLightAccessory = class extends BaseDevice {
95320
96559
  });
95321
96560
  if (typeof state.brightness === "number") {
95322
96561
  const previousBrightness = this.brightnessView();
95323
- const brightChangedAt = previousBrightness.percentage === state.brightness ? previousBrightness.lastChangedAt : ts;
96562
+ const brightChangedAt = previousBrightness.level === state.brightness ? previousBrightness.lastChangedAt : ts;
95324
96563
  this.setCapSlice(brightnessCapability, {
95325
- percentage: state.brightness,
96564
+ level: state.brightness,
95326
96565
  lastChangedAt: brightChangedAt
95327
96566
  });
95328
96567
  }
@@ -95343,7 +96582,7 @@ var HikvisionLightAccessory = class extends BaseDevice {
95343
96582
  lastChangedAt: ts
95344
96583
  });
95345
96584
  if (on) this.setCapSlice(brightnessCapability, {
95346
- percentage: brightness,
96585
+ level: brightness,
95347
96586
  lastChangedAt: ts
95348
96587
  });
95349
96588
  }
@@ -95364,7 +96603,7 @@ var HikvisionLightAccessory = class extends BaseDevice {
95364
96603
  getStatus: async () => this.switchView(),
95365
96604
  setState: async ({ deviceId, on }) => {
95366
96605
  if (deviceId !== this.id) return;
95367
- const brightness = this.brightnessView().percentage;
96606
+ const brightness = this.brightnessView().level;
95368
96607
  await this.applyOn(on, brightness);
95369
96608
  }
95370
96609
  });
@@ -95376,18 +96615,18 @@ var HikvisionLightAccessory = class extends BaseDevice {
95376
96615
  registerBrightnessCap() {
95377
96616
  this.ctx.registerNativeCap(brightnessCapability, {
95378
96617
  getStatus: async () => this.brightnessView(),
95379
- setBrightness: async ({ deviceId, percentage }) => {
96618
+ setBrightness: async ({ deviceId, level: percentage }) => {
95380
96619
  if (deviceId !== this.id) return;
95381
96620
  const value = Math.max(0, Math.min(100, percentage));
95382
96621
  if (this.switchView().on) await this.applyOn(true, value);
95383
96622
  else this.setCapSlice(brightnessCapability, {
95384
- percentage: value,
96623
+ level: value,
95385
96624
  lastChangedAt: Date.now()
95386
96625
  });
95387
96626
  }
95388
96627
  });
95389
96628
  this.setCapSlice(brightnessCapability, {
95390
- percentage: this.config.get("defaultBrightness") ?? 100,
96629
+ level: this.config.get("defaultBrightness") ?? 100,
95391
96630
  lastChangedAt: 0
95392
96631
  });
95393
96632
  }
@@ -95435,10 +96674,10 @@ var HikvisionLightAccessory = class extends BaseDevice {
95435
96674
  const typed = lightAccessorySchema.partial().parse(patch);
95436
96675
  await this.config.setAll(typed);
95437
96676
  if (typed.defaultBrightness !== void 0 && !this.switchView().on) this.setCapSlice(brightnessCapability, {
95438
- percentage: typed.defaultBrightness,
96677
+ level: typed.defaultBrightness,
95439
96678
  lastChangedAt: Date.now()
95440
96679
  });
95441
- if (typed.mode !== void 0 && this.switchView().on) await this.applyOn(true, this.brightnessView().percentage).catch((err) => {
96680
+ if (typed.mode !== void 0 && this.switchView().on) await this.applyOn(true, this.brightnessView().level).catch((err) => {
95442
96681
  this.ctx.logger.warn("hikvision light: live mode switch failed", { meta: { error: err instanceof Error ? err.message : String(err) } });
95443
96682
  });
95444
96683
  }