@deconz-community/ddf-validator 2.0.0 → 2.1.0
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/ddf-schema.json +1 -1
- package/dist/ddf-validator.cjs +1 -1
- package/dist/ddf-validator.d.ts +167 -10
- package/dist/ddf-validator.mjs +342 -284
- package/package.json +1 -1
package/dist/ddf-validator.d.ts
CHANGED
|
@@ -5,20 +5,29 @@ export type DDF = {
|
|
|
5
5
|
schema: "devcap1.schema.json";
|
|
6
6
|
"doc:path"?: string | undefined;
|
|
7
7
|
"doc:hdr"?: string | undefined;
|
|
8
|
+
/** Know issues for this device, markdown file. */
|
|
8
9
|
"md:known_issues"?: string[] | undefined;
|
|
9
|
-
|
|
10
|
+
/** Manufacturer name from Basic Cluster. */
|
|
11
|
+
manufacturername: ("$MF_BOSCH" | "$MF_IKEA" | "$MF_LUMI" | "$MF_LUTRON" | "$MF_PHILIPS" | "$MF_SAMJIN" | "$MF_SIGNIFY" | "$MF_TUYA" | "$MF_XIAOMI") | string | (("$MF_BOSCH" | "$MF_IKEA" | "$MF_LUMI" | "$MF_LUTRON" | "$MF_PHILIPS" | "$MF_SAMJIN" | "$MF_SIGNIFY" | "$MF_TUYA" | "$MF_XIAOMI") | string)[];
|
|
12
|
+
/** Model ID from Basic Cluster. */
|
|
10
13
|
modelid: string | string[];
|
|
14
|
+
/** Friendly name of the manufacturer. */
|
|
11
15
|
vendor?: string | undefined;
|
|
12
16
|
comment?: string | undefined;
|
|
17
|
+
/** Need to return true for the DDF be used. */
|
|
13
18
|
matchexpr?: string | undefined;
|
|
19
|
+
/** DDF path, useless, can be removed. */
|
|
14
20
|
path?: string | undefined;
|
|
21
|
+
/** Complements the model id to be shown in the UI. */
|
|
15
22
|
product?: string | undefined;
|
|
23
|
+
/** Sleeping devices can only receive when awake. */
|
|
16
24
|
sleeper?: boolean | undefined;
|
|
17
25
|
supportsMgmtBind?: boolean | undefined;
|
|
18
26
|
/** The code quality of the DDF file. */
|
|
19
27
|
status: "Draft" | "Bronze" | "Silver" | "Gold";
|
|
28
|
+
/** Devices section. */
|
|
20
29
|
subdevices: {
|
|
21
|
-
type: ("$TYPE_AIR_PURIFIER" | "$TYPE_AIR_QUALITY_SENSOR" | "$TYPE_ALARM_SENSOR" | "$TYPE_ANCILLARY_CONTROL" | "$TYPE_BATTERY_SENSOR" | "$TYPE_CARBON_MONOXIDE" | "$TYPE_COLOR_DIMMABLE_LIGHT" | "$TYPE_COLOR_LIGHT" | "$TYPE_COLOR_TEMPERATURE_LIGHT" | "$TYPE_CONSUMPTION_SENSOR" | "$TYPE_DIMMABLE_LIGHT" | "$TYPE_DIMMABLE_PLUGIN_UNIT" | "$TYPE_DIMMER_SWITCH" | "$TYPE_DOOR_LOCK_CONTROLLER" | "$TYPE_DOOR_LOCK" | "$TYPE_EXTENDED_COLOR_LIGHT" | "$TYPE_FIRE_SENSOR" | "$TYPE_HUMIDITY_SENSOR" | "$TYPE_LIGHT_LEVEL_SENSOR" | "$TYPE_ON_OFF_LIGHT" | "$TYPE_ON_OFF_OUTPUT" | "$TYPE_ON_OFF_PLUGIN_UNIT" | "$TYPE_OPEN_CLOSE_SENSOR" | "$TYPE_POWER_SENSOR" | "$TYPE_PRESENCE_SENSOR" | "$TYPE_PRESSURE_SENSOR" | "$TYPE_RANGE_EXTENDER" | "$TYPE_RELATIVE_ROTARY" | "$TYPE_SMART_PLUG" | "$TYPE_SPECTRAL_SENSOR" | "$TYPE_SWITCH" | "$TYPE_TEMPERATURE_SENSOR" | "$TYPE_THERMOSTAT" | "$TYPE_TIME" | "$TYPE_VIBRATION_SENSOR" | "$TYPE_WARNING_DEVICE" | "$TYPE_WATER_LEAK_SENSOR" | "$TYPE_WINDOW_COVERING_DEVICE" | "$TYPE_ZGP_SWITCH") |
|
|
30
|
+
type: ("$TYPE_AIR_PURIFIER" | "$TYPE_AIR_QUALITY_SENSOR" | "$TYPE_ALARM_SENSOR" | "$TYPE_ANCILLARY_CONTROL" | "$TYPE_BATTERY_SENSOR" | "$TYPE_CARBON_MONOXIDE" | "$TYPE_COLOR_DIMMABLE_LIGHT" | "$TYPE_COLOR_LIGHT" | "$TYPE_COLOR_TEMPERATURE_LIGHT" | "$TYPE_CONSUMPTION_SENSOR" | "$TYPE_DIMMABLE_LIGHT" | "$TYPE_DIMMABLE_PLUGIN_UNIT" | "$TYPE_DIMMER_SWITCH" | "$TYPE_DOOR_LOCK_CONTROLLER" | "$TYPE_DOOR_LOCK" | "$TYPE_EXTENDED_COLOR_LIGHT" | "$TYPE_FIRE_SENSOR" | "$TYPE_HUMIDITY_SENSOR" | "$TYPE_LIGHT_LEVEL_SENSOR" | "$TYPE_ON_OFF_LIGHT" | "$TYPE_ON_OFF_OUTPUT" | "$TYPE_ON_OFF_PLUGIN_UNIT" | "$TYPE_OPEN_CLOSE_SENSOR" | "$TYPE_POWER_SENSOR" | "$TYPE_PRESENCE_SENSOR" | "$TYPE_PRESSURE_SENSOR" | "$TYPE_RANGE_EXTENDER" | "$TYPE_RELATIVE_ROTARY" | "$TYPE_SMART_PLUG" | "$TYPE_SPECTRAL_SENSOR" | "$TYPE_SWITCH" | "$TYPE_TEMPERATURE_SENSOR" | "$TYPE_THERMOSTAT" | "$TYPE_TIME" | "$TYPE_VIBRATION_SENSOR" | "$TYPE_WARNING_DEVICE" | "$TYPE_WATER_LEAK_SENSOR" | "$TYPE_WINDOW_COVERING_DEVICE" | "$TYPE_ZGP_SWITCH") | string;
|
|
22
31
|
restapi: "/lights" | "/sensors";
|
|
23
32
|
uuid: [
|
|
24
33
|
"$address.ext",
|
|
@@ -42,121 +51,202 @@ export type DDF = {
|
|
|
42
51
|
buttons?: any | undefined;
|
|
43
52
|
buttonevents?: any | undefined;
|
|
44
53
|
items: {
|
|
54
|
+
/** Item name. */
|
|
45
55
|
name: "state/windowopen" | "state/water" | "state/voltage" | "state/vibrationstrength" | "state/vibration" | "state/valve" | "state/utc" | "state/tiltangle" | "state/tilt" | "state/test" | "state/temperature" | "state/tampered" | "state/speed" | "state/seconds_remaining" | "state/sat" | "state/rotaryevent" | "state/replacefilter" | "state/reachable" | "state/production" | "state/pressure" | "state/presenceevent" | "state/presence" | "state/power" | "state/pm2_5" | "state/panel" | "state/orientation_z" | "state/orientation_y" | "state/orientation_x" | "state/orientation" | "state/open" | "state/on" | "state/mountingmodeactive" | "state/lux" | "state/lowbattery" | "state/lockstate" | "state/localtime" | "state/lightlevel" | "state/lift" | "state/lastupdated" | "state/lastset" | "state/lastcheckin" | "state/humidity" | "state/hue" | "state/heating" | "state/gradient" | "state/gesture" | "state/fire" | "state/filterruntime" | "state/expectedrotation" | "state/expectedeventduration" | "state/eventduration" | "state/errorcode" | "state/effect" | "state/deviceruntime" | "state/daylight" | "state/dark" | "state/current" | "state/current_P3" | "state/current_P2" | "state/current_P1" | "state/ct" | "state/consumption" | "state/consumption_2" | "state/y" | "state/x" | "state/colormode" | "state/charging" | "state/carbonmonoxide" | "state/buttonevent" | "state/bri" | "state/battery" | "state/angle" | "state/alert" | "state/alarm" | "state/airqualityppb" | "state/airquality" | "state/action" | "config/windowopen_set" | "config/windowcoveringtype" | "config/usertest" | "config/unoccupiedheatsetpoint" | "config/triggerdistance" | "config/tholdoffset" | "config/tholddark" | "config/temperature" | "config/swingmode" | "config/sensitivitymax" | "config/sensitivity" | "config/selftest" | "config/schedule_on" | "config/schedule" | "config/resetpresence" | "config/reachable" | "config/pulseconfiguration" | "config/preset" | "config/pending" | "config/on/startup" | "config/on" | "config/offset" | "config/mountingmode" | "config/mode" | "config/locked" | "config/lock" | "config/ledindication" | "config/interfacemode" | "config/heatsetpoint" | "config/group" | "config/filterlifetime" | "config/fanmode" | "config/externalwindowopen" | "config/externalsensortemp" | "config/enrolled" | "config/duration" | "config/displayflipped" | "config/devicemode" | "config/delay" | "config/ctmin" | "config/ctmax" | "config/coolsetpoint" | "config/controlsequence" | "config/configured" | "config/colorcapabilities" | "config/color/xy/startup_y" | "config/color/xy/startup_x" | "config/color/gradient/reversed" | "config/color/execute_if_off" | "config/color/ct/startup" | "config/clickmode" | "config/checkin" | "config/bri/startup" | "config/bri/onoff_transitiontime" | "config/bri/on_level" | "config/bri/min" | "config/bri/max" | "config/bri/execute_if_off" | "config/battery" | "config/allowtouchlink" | "config/alert" | "cap/transition_block" | "cap/sleeper" | "cap/on/off_with_effect" | "cap/groups/not_supported" | "cap/color/xy/red_y" | "cap/color/xy/red_x" | "cap/color/xy/green_y" | "cap/color/xy/green_x" | "cap/color/xy/blue_y" | "cap/color/xy/blue_x" | "cap/color/gradient/styles" | "cap/color/gradient/pixel_length" | "cap/color/gradient/pixel_count" | "cap/color/gradient/max_segments" | "cap/color/gamut_type" | "cap/color/effects" | "cap/color/ct/min" | "cap/color/ct/max" | "cap/color/ct/computes_xy" | "cap/color/capabilities" | "cap/bri/move_with_onoff" | "cap/bri/min_dim_level" | "cap/alert/trigger_effect" | "attr/uniqueid" | "attr/type" | "attr/swversion" | "attr/swconfigid" | "attr/productname" | "attr/productid" | "attr/powerup" | "attr/poweronlevel" | "attr/poweronct" | "attr/name" | "attr/modelid" | "attr/mode" | "attr/manufacturername" | "attr/lastseen" | "attr/lastannounced" | "attr/id";
|
|
56
|
+
/** Item description, better to do not use it. */
|
|
46
57
|
description?: string | undefined;
|
|
47
58
|
comment?: string | undefined;
|
|
59
|
+
/** Item visible on the API. */
|
|
48
60
|
public?: boolean | undefined;
|
|
61
|
+
/** A static default value is fixed and can be not changed. */
|
|
49
62
|
static?: (string | number | boolean) | undefined;
|
|
63
|
+
/** Values range limit. */
|
|
50
64
|
range?: [
|
|
51
65
|
number,
|
|
52
66
|
number
|
|
53
67
|
] | undefined;
|
|
54
68
|
deprecated?: string | undefined;
|
|
69
|
+
/** Access mode for this item, some of them are not editable. */
|
|
55
70
|
access?: "R" | undefined;
|
|
71
|
+
/** Fonction used to read value. */
|
|
56
72
|
read?: ({
|
|
57
73
|
fn: "none";
|
|
58
74
|
} | {
|
|
75
|
+
/** Generic function to read ZCL attributes. */
|
|
59
76
|
fn?: undefined;
|
|
60
|
-
|
|
77
|
+
/** Attribute ID. */
|
|
78
|
+
at: string | string[];
|
|
79
|
+
/** Cluster ID. */
|
|
61
80
|
cl: string;
|
|
81
|
+
/** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
|
|
62
82
|
ep?: (string | number) | undefined;
|
|
83
|
+
/** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
|
|
63
84
|
mf?: string | undefined;
|
|
85
|
+
/** Javascript expression to transform the raw value. */
|
|
64
86
|
eval?: string | undefined;
|
|
65
87
|
} | {
|
|
88
|
+
/** Generic function to read ZCL attributes. */
|
|
66
89
|
fn: "zcl";
|
|
67
|
-
|
|
90
|
+
/** Attribute ID. */
|
|
91
|
+
at: string | string[];
|
|
92
|
+
/** Cluster ID. */
|
|
68
93
|
cl: string;
|
|
94
|
+
/** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
|
|
69
95
|
ep?: (string | number) | undefined;
|
|
96
|
+
/** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
|
|
70
97
|
mf?: string | undefined;
|
|
98
|
+
/** Javascript expression to transform the raw value. */
|
|
71
99
|
eval?: string | undefined;
|
|
72
100
|
} | {
|
|
101
|
+
/** Generic function to read all Tuya datapoints. It has no parameters. */
|
|
73
102
|
fn: "tuya";
|
|
74
103
|
}) | undefined;
|
|
104
|
+
/** Fonction used to parse incoming values. */
|
|
75
105
|
parse?: ({
|
|
106
|
+
/** Generic function to parse ZCL attributes and commands. */
|
|
76
107
|
fn?: undefined;
|
|
108
|
+
/** Attribute ID. */
|
|
77
109
|
at?: string | undefined;
|
|
110
|
+
/** Cluster ID. */
|
|
78
111
|
cl: string;
|
|
79
112
|
cppsrc?: string | undefined;
|
|
113
|
+
/** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
|
|
80
114
|
ep?: (string | number) | undefined;
|
|
115
|
+
/** Zigbee command. */
|
|
81
116
|
cmd?: string | undefined;
|
|
117
|
+
/** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
|
|
82
118
|
mf?: string | undefined;
|
|
119
|
+
/** Javascript expression to transform the raw value. */
|
|
83
120
|
eval?: string | undefined;
|
|
121
|
+
/** Relative path of a Javascript .js file. */
|
|
84
122
|
script?: string | undefined;
|
|
85
123
|
} | {
|
|
124
|
+
/** Generic function to parse ZCL attributes and commands. */
|
|
86
125
|
fn: "zcl";
|
|
126
|
+
/** Attribute ID. */
|
|
87
127
|
at?: string | undefined;
|
|
128
|
+
/** Cluster ID. */
|
|
88
129
|
cl: string;
|
|
89
130
|
cppsrc?: string | undefined;
|
|
131
|
+
/** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
|
|
90
132
|
ep?: (string | number) | undefined;
|
|
133
|
+
/** Zigbee command. */
|
|
91
134
|
cmd?: string | undefined;
|
|
135
|
+
/** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
|
|
92
136
|
mf?: string | undefined;
|
|
137
|
+
/** Javascript expression to transform the raw value. */
|
|
93
138
|
eval?: string | undefined;
|
|
139
|
+
/** Relative path of a Javascript .js file. */
|
|
94
140
|
script?: string | undefined;
|
|
95
141
|
} | {
|
|
142
|
+
/** Generic function to parse IAS ZONE status change notifications or zone status from read/report command. */
|
|
96
143
|
fn: "ias:zonestatus";
|
|
144
|
+
/** Sets the bitmask for Alert1 and Alert2 item of the IAS Zone status. */
|
|
97
145
|
mask?: (("alarm1" | "alarm2") | "alarm1,alarm2") | undefined;
|
|
98
146
|
} | {
|
|
147
|
+
/** Generic function to to convert number to string. */
|
|
99
148
|
fn: "numtostr";
|
|
149
|
+
/** The source item holding the number. */
|
|
100
150
|
srcitem: "state/airqualityppb" | "state/pm2_5";
|
|
101
|
-
|
|
151
|
+
/** Comparison operator (lt | le | eq | gt | ge) */
|
|
152
|
+
op: "lt" | "le" | "eq" | "gt" | "ge";
|
|
153
|
+
/** Array of (num, string) mappings */
|
|
102
154
|
to: any;
|
|
103
155
|
} | {
|
|
156
|
+
/** Specialized function to parse time, local and last set time from read/report commands of the time cluster and auto-sync time if needed. */
|
|
104
157
|
fn: "time";
|
|
105
158
|
} | {
|
|
159
|
+
/** Generic function to parse custom Xiaomi attributes and commands. */
|
|
106
160
|
fn: "xiaomi:special";
|
|
161
|
+
/** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
|
|
107
162
|
ep?: (string | number) | undefined;
|
|
163
|
+
/** Attribute ID. The attribute to parse, shall be 0xff01, 0xff02 or 0x00f7 */
|
|
108
164
|
at?: string | undefined;
|
|
165
|
+
/** A 8-bit string hex value. */
|
|
109
166
|
idx: string;
|
|
167
|
+
/** Javascript expression to transform the raw value. */
|
|
110
168
|
eval?: string | undefined;
|
|
169
|
+
/** Relative path of a Javascript .js file. */
|
|
111
170
|
script?: string | undefined;
|
|
112
171
|
} | {
|
|
172
|
+
/** Generic function to parse Tuya data. */
|
|
113
173
|
fn: "tuya";
|
|
174
|
+
/** Data point ID. 1-255 the datapoint ID. */
|
|
114
175
|
dpid: number;
|
|
176
|
+
/** Javascript expression to transform the raw value. */
|
|
115
177
|
eval?: string | undefined;
|
|
178
|
+
/** Relative path of a Javascript .js file. */
|
|
116
179
|
script?: string | undefined;
|
|
117
180
|
}) | undefined;
|
|
181
|
+
/** Fonction used to write value. */
|
|
118
182
|
write?: ({
|
|
119
183
|
fn: "none";
|
|
120
184
|
} | {
|
|
121
185
|
fn?: undefined;
|
|
186
|
+
/** Attribute ID. */
|
|
122
187
|
at?: (string | string[]) | undefined;
|
|
123
188
|
"state.timeout"?: number | undefined;
|
|
124
189
|
"change.timeout"?: number | undefined;
|
|
190
|
+
/** Cluster ID. */
|
|
125
191
|
cl: string;
|
|
192
|
+
/** Data type. */
|
|
126
193
|
dt: string;
|
|
194
|
+
/** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
|
|
127
195
|
ep?: (string | number) | undefined;
|
|
196
|
+
/** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
|
|
128
197
|
mf?: string | undefined;
|
|
198
|
+
/** Javascript expression to transform the raw value. */
|
|
129
199
|
eval?: string | undefined;
|
|
200
|
+
/** Relative path of a Javascript .js file. */
|
|
130
201
|
script?: string | undefined;
|
|
131
202
|
} | {
|
|
132
203
|
fn: "zcl";
|
|
204
|
+
/** Attribute ID. */
|
|
133
205
|
at?: (string | string[]) | undefined;
|
|
134
206
|
"state.timeout"?: number | undefined;
|
|
135
207
|
"change.timeout"?: number | undefined;
|
|
208
|
+
/** Cluster ID. */
|
|
136
209
|
cl: string;
|
|
210
|
+
/** Data type. */
|
|
137
211
|
dt: string;
|
|
212
|
+
/** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
|
|
138
213
|
ep?: (string | number) | undefined;
|
|
214
|
+
/** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
|
|
139
215
|
mf?: string | undefined;
|
|
216
|
+
/** Javascript expression to transform the raw value. */
|
|
140
217
|
eval?: string | undefined;
|
|
218
|
+
/** Relative path of a Javascript .js file. */
|
|
141
219
|
script?: string | undefined;
|
|
142
220
|
} | {
|
|
221
|
+
/** Generic function to write Tuya data. */
|
|
143
222
|
fn: "tuya";
|
|
223
|
+
/** Data point ID. 1-255 the datapoint ID. */
|
|
144
224
|
dpid: number;
|
|
225
|
+
/** Data type. */
|
|
145
226
|
dt: string;
|
|
227
|
+
/** Javascript expression to transform the raw value. */
|
|
146
228
|
eval?: string | undefined;
|
|
229
|
+
/** Relative path of a Javascript .js file. */
|
|
147
230
|
script?: string | undefined;
|
|
148
231
|
}) | undefined;
|
|
232
|
+
/** The device is considered awake when this item is set due a incoming command. */
|
|
149
233
|
awake?: boolean | undefined;
|
|
234
|
+
/** Defaut value. */
|
|
150
235
|
default?: unknown | undefined;
|
|
151
236
|
values?: unknown | undefined;
|
|
237
|
+
/** Refresh interval used for read fonction, NEED to be superior at value used in binding part. */
|
|
152
238
|
"refresh.interval"?: number | undefined;
|
|
153
239
|
}[];
|
|
154
240
|
example?: unknown | undefined;
|
|
155
241
|
}[];
|
|
242
|
+
/** Bindings section. */
|
|
156
243
|
bindings?: ({
|
|
157
244
|
bind: "unicast";
|
|
245
|
+
/** Source endpoint. */
|
|
158
246
|
"src.ep": string | number;
|
|
247
|
+
/** Destination endpoint, generaly 0x01. */
|
|
159
248
|
"dst.ep"?: (string | number) | undefined;
|
|
249
|
+
/** Cluster. */
|
|
160
250
|
cl: string;
|
|
161
251
|
report?: {
|
|
162
252
|
at: string;
|
|
@@ -168,7 +258,9 @@ export type DDF = {
|
|
|
168
258
|
}[] | undefined;
|
|
169
259
|
} | {
|
|
170
260
|
bind: "groupcast";
|
|
261
|
+
/** Source endpoint. */
|
|
171
262
|
"src.ep": string | number;
|
|
263
|
+
/** Cluster. */
|
|
172
264
|
cl: string;
|
|
173
265
|
"config.group": number;
|
|
174
266
|
})[] | undefined;
|
|
@@ -195,96 +287,161 @@ export type DDF = {
|
|
|
195
287
|
static?: boolean | undefined;
|
|
196
288
|
virtual?: boolean | undefined;
|
|
197
289
|
parse?: ({
|
|
290
|
+
/** Generic function to parse ZCL attributes and commands. */
|
|
198
291
|
fn?: undefined;
|
|
292
|
+
/** Attribute ID. */
|
|
199
293
|
at?: string | undefined;
|
|
294
|
+
/** Cluster ID. */
|
|
200
295
|
cl: string;
|
|
201
296
|
cppsrc?: string | undefined;
|
|
297
|
+
/** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
|
|
202
298
|
ep?: (string | number) | undefined;
|
|
299
|
+
/** Zigbee command. */
|
|
203
300
|
cmd?: string | undefined;
|
|
301
|
+
/** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
|
|
204
302
|
mf?: string | undefined;
|
|
303
|
+
/** Javascript expression to transform the raw value. */
|
|
205
304
|
eval?: string | undefined;
|
|
305
|
+
/** Relative path of a Javascript .js file. */
|
|
206
306
|
script?: string | undefined;
|
|
207
307
|
} | {
|
|
308
|
+
/** Generic function to parse ZCL attributes and commands. */
|
|
208
309
|
fn: "zcl";
|
|
310
|
+
/** Attribute ID. */
|
|
209
311
|
at?: string | undefined;
|
|
312
|
+
/** Cluster ID. */
|
|
210
313
|
cl: string;
|
|
211
314
|
cppsrc?: string | undefined;
|
|
315
|
+
/** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
|
|
212
316
|
ep?: (string | number) | undefined;
|
|
317
|
+
/** Zigbee command. */
|
|
213
318
|
cmd?: string | undefined;
|
|
319
|
+
/** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
|
|
214
320
|
mf?: string | undefined;
|
|
321
|
+
/** Javascript expression to transform the raw value. */
|
|
215
322
|
eval?: string | undefined;
|
|
323
|
+
/** Relative path of a Javascript .js file. */
|
|
216
324
|
script?: string | undefined;
|
|
217
325
|
} | {
|
|
326
|
+
/** Generic function to parse IAS ZONE status change notifications or zone status from read/report command. */
|
|
218
327
|
fn: "ias:zonestatus";
|
|
328
|
+
/** Sets the bitmask for Alert1 and Alert2 item of the IAS Zone status. */
|
|
219
329
|
mask?: (("alarm1" | "alarm2") | "alarm1,alarm2") | undefined;
|
|
220
330
|
} | {
|
|
331
|
+
/** Generic function to to convert number to string. */
|
|
221
332
|
fn: "numtostr";
|
|
333
|
+
/** The source item holding the number. */
|
|
222
334
|
srcitem: "state/airqualityppb" | "state/pm2_5";
|
|
223
|
-
|
|
335
|
+
/** Comparison operator (lt | le | eq | gt | ge) */
|
|
336
|
+
op: "lt" | "le" | "eq" | "gt" | "ge";
|
|
337
|
+
/** Array of (num, string) mappings */
|
|
224
338
|
to: any;
|
|
225
339
|
} | {
|
|
340
|
+
/** Specialized function to parse time, local and last set time from read/report commands of the time cluster and auto-sync time if needed. */
|
|
226
341
|
fn: "time";
|
|
227
342
|
} | {
|
|
343
|
+
/** Generic function to parse custom Xiaomi attributes and commands. */
|
|
228
344
|
fn: "xiaomi:special";
|
|
345
|
+
/** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
|
|
229
346
|
ep?: (string | number) | undefined;
|
|
347
|
+
/** Attribute ID. The attribute to parse, shall be 0xff01, 0xff02 or 0x00f7 */
|
|
230
348
|
at?: string | undefined;
|
|
349
|
+
/** A 8-bit string hex value. */
|
|
231
350
|
idx: string;
|
|
351
|
+
/** Javascript expression to transform the raw value. */
|
|
232
352
|
eval?: string | undefined;
|
|
353
|
+
/** Relative path of a Javascript .js file. */
|
|
233
354
|
script?: string | undefined;
|
|
234
355
|
} | {
|
|
356
|
+
/** Generic function to parse Tuya data. */
|
|
235
357
|
fn: "tuya";
|
|
358
|
+
/** Data point ID. 1-255 the datapoint ID. */
|
|
236
359
|
dpid: number;
|
|
360
|
+
/** Javascript expression to transform the raw value. */
|
|
237
361
|
eval?: string | undefined;
|
|
362
|
+
/** Relative path of a Javascript .js file. */
|
|
238
363
|
script?: string | undefined;
|
|
239
364
|
}) | undefined;
|
|
240
365
|
read?: ({
|
|
241
366
|
fn: "none";
|
|
242
367
|
} | {
|
|
368
|
+
/** Generic function to read ZCL attributes. */
|
|
243
369
|
fn?: undefined;
|
|
244
|
-
|
|
370
|
+
/** Attribute ID. */
|
|
371
|
+
at: string | string[];
|
|
372
|
+
/** Cluster ID. */
|
|
245
373
|
cl: string;
|
|
374
|
+
/** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
|
|
246
375
|
ep?: (string | number) | undefined;
|
|
376
|
+
/** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
|
|
247
377
|
mf?: string | undefined;
|
|
378
|
+
/** Javascript expression to transform the raw value. */
|
|
248
379
|
eval?: string | undefined;
|
|
249
380
|
} | {
|
|
381
|
+
/** Generic function to read ZCL attributes. */
|
|
250
382
|
fn: "zcl";
|
|
251
|
-
|
|
383
|
+
/** Attribute ID. */
|
|
384
|
+
at: string | string[];
|
|
385
|
+
/** Cluster ID. */
|
|
252
386
|
cl: string;
|
|
387
|
+
/** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
|
|
253
388
|
ep?: (string | number) | undefined;
|
|
389
|
+
/** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
|
|
254
390
|
mf?: string | undefined;
|
|
391
|
+
/** Javascript expression to transform the raw value. */
|
|
255
392
|
eval?: string | undefined;
|
|
256
393
|
} | {
|
|
394
|
+
/** Generic function to read all Tuya datapoints. It has no parameters. */
|
|
257
395
|
fn: "tuya";
|
|
258
396
|
}) | undefined;
|
|
259
397
|
write?: ({
|
|
260
398
|
fn: "none";
|
|
261
399
|
} | {
|
|
262
400
|
fn?: undefined;
|
|
401
|
+
/** Attribute ID. */
|
|
263
402
|
at?: (string | string[]) | undefined;
|
|
264
403
|
"state.timeout"?: number | undefined;
|
|
265
404
|
"change.timeout"?: number | undefined;
|
|
405
|
+
/** Cluster ID. */
|
|
266
406
|
cl: string;
|
|
407
|
+
/** Data type. */
|
|
267
408
|
dt: string;
|
|
409
|
+
/** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
|
|
268
410
|
ep?: (string | number) | undefined;
|
|
411
|
+
/** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
|
|
269
412
|
mf?: string | undefined;
|
|
413
|
+
/** Javascript expression to transform the raw value. */
|
|
270
414
|
eval?: string | undefined;
|
|
415
|
+
/** Relative path of a Javascript .js file. */
|
|
271
416
|
script?: string | undefined;
|
|
272
417
|
} | {
|
|
273
418
|
fn: "zcl";
|
|
419
|
+
/** Attribute ID. */
|
|
274
420
|
at?: (string | string[]) | undefined;
|
|
275
421
|
"state.timeout"?: number | undefined;
|
|
276
422
|
"change.timeout"?: number | undefined;
|
|
423
|
+
/** Cluster ID. */
|
|
277
424
|
cl: string;
|
|
425
|
+
/** Data type. */
|
|
278
426
|
dt: string;
|
|
427
|
+
/** Endpoint, 255 means any endpoint, 0 means auto selected from subdevice. */
|
|
279
428
|
ep?: (string | number) | undefined;
|
|
429
|
+
/** Manufacturer code, must be set to 0x0000 for non manufacturer specific commands. */
|
|
280
430
|
mf?: string | undefined;
|
|
431
|
+
/** Javascript expression to transform the raw value. */
|
|
281
432
|
eval?: string | undefined;
|
|
433
|
+
/** Relative path of a Javascript .js file. */
|
|
282
434
|
script?: string | undefined;
|
|
283
435
|
} | {
|
|
436
|
+
/** Generic function to write Tuya data. */
|
|
284
437
|
fn: "tuya";
|
|
438
|
+
/** Data point ID. 1-255 the datapoint ID. */
|
|
285
439
|
dpid: number;
|
|
440
|
+
/** Data type. */
|
|
286
441
|
dt: string;
|
|
442
|
+
/** Javascript expression to transform the raw value. */
|
|
287
443
|
eval?: string | undefined;
|
|
444
|
+
/** Relative path of a Javascript .js file. */
|
|
288
445
|
script?: string | undefined;
|
|
289
446
|
}) | undefined;
|
|
290
447
|
"refresh.interval"?: number | undefined;
|
|
@@ -297,8 +454,8 @@ export type DDF = {
|
|
|
297
454
|
} | {
|
|
298
455
|
$schema?: string | undefined;
|
|
299
456
|
schema: "subdevice1.schema.json";
|
|
300
|
-
type: "$TYPE_AIR_PURIFIER" | "$TYPE_AIR_QUALITY_SENSOR" | "$TYPE_ALARM_SENSOR" | "$TYPE_ANCILLARY_CONTROL" | "$TYPE_BATTERY_SENSOR" | "$TYPE_CARBON_MONOXIDE" | "$TYPE_COLOR_DIMMABLE_LIGHT" | "$TYPE_COLOR_LIGHT" | "$TYPE_COLOR_TEMPERATURE_LIGHT" | "$TYPE_CONSUMPTION_SENSOR" | "$TYPE_DIMMABLE_LIGHT" | "$TYPE_DIMMABLE_PLUGIN_UNIT" | "$TYPE_DIMMER_SWITCH" | "$TYPE_DOOR_LOCK_CONTROLLER" | "$TYPE_DOOR_LOCK" | "$TYPE_EXTENDED_COLOR_LIGHT" | "$TYPE_FIRE_SENSOR" | "$TYPE_HUMIDITY_SENSOR" | "$TYPE_LIGHT_LEVEL_SENSOR" | "$TYPE_ON_OFF_LIGHT" | "$TYPE_ON_OFF_OUTPUT" | "$TYPE_ON_OFF_PLUGIN_UNIT" | "$TYPE_OPEN_CLOSE_SENSOR" | "$TYPE_POWER_SENSOR" | "$TYPE_PRESENCE_SENSOR" | "$TYPE_PRESSURE_SENSOR" | "$TYPE_RANGE_EXTENDER" | "$TYPE_RELATIVE_ROTARY" | "$TYPE_SMART_PLUG" | "$TYPE_SPECTRAL_SENSOR" | "$TYPE_SWITCH" | "$TYPE_TEMPERATURE_SENSOR" | "$TYPE_THERMOSTAT" | "$TYPE_TIME" | "$TYPE_VIBRATION_SENSOR" | "$TYPE_WARNING_DEVICE" | "$TYPE_WATER_LEAK_SENSOR" | "$TYPE_WINDOW_COVERING_DEVICE" | "$TYPE_ZGP_SWITCH";
|
|
301
|
-
name:
|
|
457
|
+
type: ("$TYPE_AIR_PURIFIER" | "$TYPE_AIR_QUALITY_SENSOR" | "$TYPE_ALARM_SENSOR" | "$TYPE_ANCILLARY_CONTROL" | "$TYPE_BATTERY_SENSOR" | "$TYPE_CARBON_MONOXIDE" | "$TYPE_COLOR_DIMMABLE_LIGHT" | "$TYPE_COLOR_LIGHT" | "$TYPE_COLOR_TEMPERATURE_LIGHT" | "$TYPE_CONSUMPTION_SENSOR" | "$TYPE_DIMMABLE_LIGHT" | "$TYPE_DIMMABLE_PLUGIN_UNIT" | "$TYPE_DIMMER_SWITCH" | "$TYPE_DOOR_LOCK_CONTROLLER" | "$TYPE_DOOR_LOCK" | "$TYPE_EXTENDED_COLOR_LIGHT" | "$TYPE_FIRE_SENSOR" | "$TYPE_HUMIDITY_SENSOR" | "$TYPE_LIGHT_LEVEL_SENSOR" | "$TYPE_ON_OFF_LIGHT" | "$TYPE_ON_OFF_OUTPUT" | "$TYPE_ON_OFF_PLUGIN_UNIT" | "$TYPE_OPEN_CLOSE_SENSOR" | "$TYPE_POWER_SENSOR" | "$TYPE_PRESENCE_SENSOR" | "$TYPE_PRESSURE_SENSOR" | "$TYPE_RANGE_EXTENDER" | "$TYPE_RELATIVE_ROTARY" | "$TYPE_SMART_PLUG" | "$TYPE_SPECTRAL_SENSOR" | "$TYPE_SWITCH" | "$TYPE_TEMPERATURE_SENSOR" | "$TYPE_THERMOSTAT" | "$TYPE_TIME" | "$TYPE_VIBRATION_SENSOR" | "$TYPE_WARNING_DEVICE" | "$TYPE_WATER_LEAK_SENSOR" | "$TYPE_WINDOW_COVERING_DEVICE" | "$TYPE_ZGP_SWITCH") | string;
|
|
458
|
+
name: string;
|
|
302
459
|
restapi: "/lights" | "/sensors";
|
|
303
460
|
order: number;
|
|
304
461
|
uuid: [
|