iobroker.sonoff 4.2.0 → 5.0.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.
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.legacyRoles = exports.autoLegacyRoles = exports.autoRoles = void 0;
3
4
  const datapoints = {
4
5
  'Approx. Altitude': { type: 'number', role: 'value.altitude', read: true, write: false, unit: 'm' },
5
6
  'PM2.5': { type: 'number', role: 'value', read: true, write: false, unit: 'ug/m3' },
@@ -9,38 +10,38 @@ const datapoints = {
9
10
  A3: { type: 'number', role: 'value', read: true, write: false },
10
11
  Ap: { type: 'number', role: 'value', read: true, write: false },
11
12
  APMac: { type: 'number', role: 'state', read: true, write: false },
12
- Action: { type: 'string', role: 'value', read: true, write: true },
13
+ Action: { type: 'string', role: 'state', read: true, write: true },
13
14
  AirQuality: { type: 'number', role: 'value', read: true, write: false, unit: '%' },
14
15
  ANALOG: { type: 'object', role: 'state', read: true, write: false },
15
16
  Analog0: { type: 'number', role: 'value', read: true, write: false },
16
17
  Analog1: { type: 'number', role: 'value', read: true, write: false },
17
18
  Analog2: { type: 'number', role: 'value', read: true, write: false },
18
19
  Analog3: { type: 'number', role: 'value', read: true, write: false },
19
- ApparentPower: { type: 'number', role: 'value.power.consumption', read: true, write: false, unit: 'VA' },
20
+ ApparentPower: { type: 'number', role: 'value.power.apparent', read: true, write: false, unit: 'VA' },
20
21
  Arm: { type: 'number', role: 'value', read: true, write: true },
21
- BSSId: { type: 'string', role: 'state', read: true, write: false },
22
+ BSSId: { type: 'string', role: 'text', read: true, write: false },
22
23
  BatteryPercentage: { type: 'number', role: 'value', read: true, write: false, unit: '%' },
23
24
  BatteryVoltage: { type: 'number', role: 'value.voltage', read: true, write: false, unit: 'V' },
24
25
  Bits: { type: 'number', role: 'value', read: true, write: false },
25
- BuildDateTime: { type: 'string', role: 'state', read: true, write: false },
26
+ BuildDateTime: { type: 'string', role: 'date', read: true, write: false },
26
27
  Blue: { type: 'number', role: 'level.color.blue', read: true, write: true, min: 0, max: 100 },
27
28
  Boiler: { type: 'number', role: 'value.temperature', read: true, write: false, unit: '°C' },
28
29
  Burner: { type: 'number', role: 'value', read: true, write: false },
29
- Button1: { type: 'boolean', role: 'button', read: true, write: false },
30
- Button2: { type: 'boolean', role: 'button', read: true, write: false },
31
- Button3: { type: 'boolean', role: 'button', read: true, write: false },
32
- Button4: { type: 'boolean', role: 'button', read: true, write: false },
33
- Button5: { type: 'boolean', role: 'button', read: true, write: false },
34
- Button6: { type: 'boolean', role: 'button', read: true, write: false },
35
- Button7: { type: 'boolean', role: 'button', read: true, write: false },
36
- Button8: { type: 'boolean', role: 'button', read: true, write: false },
30
+ Button1: { type: 'boolean', role: 'button.press', read: true, write: false },
31
+ Button2: { type: 'boolean', role: 'button.press', read: true, write: false },
32
+ Button3: { type: 'boolean', role: 'button.press', read: true, write: false },
33
+ Button4: { type: 'boolean', role: 'button.press', read: true, write: false },
34
+ Button5: { type: 'boolean', role: 'button.press', read: true, write: false },
35
+ Button6: { type: 'boolean', role: 'button.press', read: true, write: false },
36
+ Button7: { type: 'boolean', role: 'button.press', read: true, write: false },
37
+ Button8: { type: 'boolean', role: 'button.press', read: true, write: false },
37
38
  C1: { type: 'number', role: 'value', read: true, write: false },
38
39
  C2: { type: 'number', role: 'value', read: true, write: false },
39
40
  C3: { type: 'number', role: 'value', read: true, write: false },
40
41
  C4: { type: 'number', role: 'value', read: true, write: false },
41
- CT: { type: 'number', role: 'level.color.temp', read: true, write: true, min: 153, max: 500 },
42
+ CT: { type: 'number', role: 'level.color.temperature', read: true, write: true, min: 153, max: 500, unit: 'mired' },
42
43
  CW: { type: 'number', role: 'level.color.coldwhite', read: true, write: true },
43
- CW_POWER: { type: 'boolean', role: 'switch.light', read: true, write: true, storeMap: true },
44
+ CW_POWER: { type: 'boolean', role: 'switch.mode.coldwhite', read: true, write: true, storeMap: true },
44
45
  CarbonDioxide: { type: 'number', role: 'value.CO2', read: true, write: false, unit: 'ppm' },
45
46
  Channel: { type: 'number', role: 'level', read: true, write: true },
46
47
  Collector: { type: 'number', role: 'value.temperature', read: true, write: false, unit: '°C' },
@@ -49,38 +50,38 @@ const datapoints = {
49
50
  Counter2: { type: 'number', role: 'value', read: true, write: false },
50
51
  Counter3: { type: 'number', role: 'value', read: true, write: false },
51
52
  Counter4: { type: 'number', role: 'value', read: true, write: false },
52
- Core: { type: 'string', role: 'state', read: true, write: false },
53
- CpuFrequency: { type: 'number', role: 'value', read: true, write: false, unit: 'MHz' },
53
+ Core: { type: 'string', role: 'info.firmware', read: true, write: false },
54
+ CpuFrequency: { type: 'number', role: 'info.status', read: true, write: false, unit: 'MHz' },
54
55
  Current: { type: 'number', role: 'value.current', read: true, write: false, unit: 'A' },
55
56
  CurrentNeutral: { type: 'number', role: 'value.current', read: true, write: false, unit: 'A' },
56
57
  Data: { type: 'string', role: 'state', read: true, write: true },
57
58
  Days: { type: 'string', role: 'state', read: true, write: true },
58
- DewPoint: { type: 'number', role: 'value.temperature', read: true, write: false, unit: '°C' },
59
- DNSServer1: { type: 'string', role: 'state', read: true, write: false },
60
- DNSServer2: { type: 'string', role: 'state', read: true, write: false },
59
+ DewPoint: { type: 'number', role: 'value.temperature.dewpoint', read: true, write: false, unit: '°C' },
60
+ DNSServer1: { type: 'string', role: 'info.ip', read: true, write: false },
61
+ DNSServer2: { type: 'string', role: 'info.ip', read: true, write: false },
61
62
  Dimmer: { type: 'number', role: 'level.dimmer', read: true, write: true, min: 0, max: 100 },
62
63
  Distance: { type: 'number', role: 'value', read: true, write: false, unit: 'cm' },
63
64
  Downtime: { type: 'string', role: 'state', read: true, write: false },
64
65
  Druck: { type: 'number', role: 'value.pressure', read: true, write: false, unit: 'hPa' },
65
66
  ExportActive: { type: 'number', role: 'value.power.produced', read: true, write: false, unit: 'kWh' },
66
67
  Factor: { type: 'number', role: 'value', read: true, write: false },
67
- Fade: { type: 'boolean', role: 'switch', read: true, write: true },
68
+ Fade: { type: 'boolean', role: 'switch.setting', read: true, write: true },
68
69
  Faktor: { type: 'number', role: 'value', read: true, write: false },
69
70
  Feuchtigkeit: { type: 'number', role: 'value.humidity', read: true, write: false, unit: '%' },
70
71
  Frequenz: { type: 'number', role: 'value.frequency', read: true, write: false, unit: 'Hz' },
71
72
  Frequency: { type: 'number', role: 'value.frequency', read: true, write: false, unit: 'Hz' },
72
- Gateway: { type: 'string', role: 'state', read: true, write: false },
73
+ Gateway: { type: 'string', role: 'info.ip', read: true, write: false },
73
74
  Green: { type: 'number', role: 'level.color.green', read: true, write: true, min: 0, max: 100 },
74
- HTTP_API: { type: 'number', role: 'state', read: true, write: false },
75
- Hardware: { type: 'string', role: 'state', read: true, write: false },
75
+ HTTP_API: { type: 'number', role: 'info.status', read: true, write: false },
76
+ Hardware: { type: 'string', role: 'info.hardware', read: true, write: false },
76
77
  HSBColor: { type: 'string', role: 'value.hsb', read: true, write: true },
77
- Hostname: { type: 'string', role: 'state', read: true, write: false },
78
+ Hostname: { type: 'string', role: 'info.name', read: true, write: false },
78
79
  Hue: { type: 'number', role: 'level.color.hue', read: true, write: true, min: 0, max: 360 },
79
80
  Humidity: { type: 'number', role: 'value.humidity', read: true, write: false, unit: '%' },
80
- IPAddress: { type: 'string', role: 'state', read: true, write: false },
81
- IPaddress: { type: 'string', role: 'state', read: true, write: false },
82
- IP6Global: { type: 'string', role: 'state', read: true, write: false },
83
- IP6Local: { type: 'string', role: 'state', read: true, write: false },
81
+ IPAddress: { type: 'string', role: 'info.ip', read: true, write: false },
82
+ IPaddress: { type: 'string', role: 'info.ip', read: true, write: false },
83
+ IP6Global: { type: 'string', role: 'info.ip', read: true, write: false },
84
+ IP6Local: { type: 'string', role: 'info.ip', read: true, write: false },
84
85
  IRSend: { type: 'string', role: 'state', read: true, write: true },
85
86
  Illuminance: { type: 'number', role: 'value.illuminance', read: true, write: false, unit: 'lx' },
86
87
  IrReceived: { type: 'object', role: 'state', read: true, write: false },
@@ -113,12 +114,12 @@ const datapoints = {
113
114
  Laufzeit: { type: 'number', role: 'value.duration', read: true, write: false, unit: 'hours' }, /// ?
114
115
  LedBar: { type: 'number', role: 'value', read: true, write: true },
115
116
  LedTable: { type: 'string', role: 'state', read: true, write: false },
116
- Leistung: { type: 'number', role: 'value.power.consumption', read: true, write: false, unit: 'W' },
117
+ Leistung: { type: 'number', role: 'value.power', read: true, write: false, unit: 'W' },
117
118
  Light: { type: 'number', role: 'value', read: true, write: false, unit: 'lx' },
118
119
  Longitude: { type: 'number', role: 'value.gps.longitude', read: true, write: false, unit: '°' },
119
120
  Mac: { type: 'string', role: 'info.mac', read: true, write: false },
120
121
  Mode: { type: 'string', role: 'state', read: true, write: true },
121
- Module: { type: 'string', role: 'state', read: true, write: false },
122
+ Module: { type: 'string', role: 'info.model', read: true, write: false },
122
123
  Noise: { type: 'number', role: 'value', read: true, write: false, unit: 'dB' },
123
124
  Output: { type: 'number', role: 'value', read: true, write: true },
124
125
  Outsidetemp: { type: 'number', role: 'value.temperature', read: true, write: false, unit: '°C' },
@@ -186,7 +187,7 @@ const datapoints = {
186
187
  POWER9: { type: 'boolean', role: 'switch', read: true, write: true, storeMap: true },
187
188
  POWER: { type: 'boolean', role: 'switch', read: true, write: true, storeMap: true },
188
189
  Power: { type: 'number', role: 'value.power', read: true, write: false, unit: 'W' },
189
- Power_curr: { type: 'number', role: 'value.power.consumption', read: true, write: false, unit: 'W' },
190
+ Power_curr: { type: 'number', role: 'value.power', read: true, write: false, unit: 'W' },
190
191
  // Zigbee device controls - special handling for ZbSend commands
191
192
  ZbPower: { type: 'boolean', role: 'switch', read: true, write: true, zbDevice: true },
192
193
  PowerDelta: { type: 'number', role: 'value', read: true, write: false, unit: 'W' },
@@ -196,38 +197,38 @@ const datapoints = {
196
197
  PressureScaledValue: { type: 'number', role: 'value.pressure', read: true, write: false, unit: 'Pa' },
197
198
  Protocol: { type: 'string', role: 'state', read: true, write: true },
198
199
  Punkt: { type: 'number', role: 'value', read: true, write: false, unit: '?' }, /// ?
199
- RGB_POWER: { type: 'boolean', role: 'switch.light', read: true, write: true, storeMap: true },
200
+ RGB_POWER: { type: 'boolean', role: 'switch.mode.color', read: true, write: true, storeMap: true },
200
201
  RSSI: { type: 'number', role: 'value.rssi', read: true, write: false },
201
- ReactivePower: { type: 'number', role: 'value.power.consumption', read: true, write: false, unit: 'var' },
202
+ ReactivePower: { type: 'number', role: 'value.power.reactive', read: true, write: false, unit: 'var' },
202
203
  Period: { type: 'number', role: 'value', read: true, write: false },
203
204
  Red: { type: 'number', role: 'level.color.red', read: true, write: true, min: 0, max: 100 },
204
205
  Repeat: { type: 'number', role: 'value', read: true, write: true },
205
- RestartReason: { type: 'string', role: 'state', read: true, write: false },
206
+ RestartReason: { type: 'string', role: 'info.status', read: true, write: false },
206
207
  Returns: { type: 'number', role: 'value.temperature', read: true, write: false, unit: '°C' },
207
208
  Roomtemp: { type: 'number', role: 'value.temperature', read: true, write: false, unit: '°C' },
208
- SHUTTER1: { type: 'number', role: 'state', read: true, write: false },
209
- SHUTTER2: { type: 'number', role: 'state', read: true, write: false },
210
- SHUTTER3: { type: 'number', role: 'state', read: true, write: false },
211
- SHUTTER4: { type: 'number', role: 'state', read: true, write: false },
212
- SHUTTER5: { type: 'number', role: 'state', read: true, write: false },
213
- SHUTTER6: { type: 'number', role: 'state', read: true, write: false },
214
- SHUTTER7: { type: 'number', role: 'state', read: true, write: false },
215
- SHUTTER8: { type: 'number', role: 'state', read: true, write: false },
216
- SHUTTER9: { type: 'number', role: 'state', read: true, write: false },
217
- SHUTTER10: { type: 'number', role: 'state', read: true, write: false },
218
- SHUTTER11: { type: 'number', role: 'state', read: true, write: false },
219
- SHUTTER12: { type: 'number', role: 'state', read: true, write: false },
220
- SHUTTER13: { type: 'number', role: 'state', read: true, write: false },
221
- SHUTTER14: { type: 'number', role: 'state', read: true, write: false },
222
- SHUTTER15: { type: 'number', role: 'state', read: true, write: false },
223
- SHUTTER16: { type: 'number', role: 'state', read: true, write: false },
224
- SSId: { type: 'string', role: 'state', read: true, write: false },
225
- Saturation: { type: 'number', role: 'level.color.saturation', read: true, write: true, min: 0, max: 255 },
226
- SDK: { type: 'string', role: 'state', read: true, write: false },
227
- Subnetmask: { type: 'string', role: 'state', read: true, write: false },
209
+ SHUTTER1: { type: 'number', role: 'value.blind', read: true, write: false, min: 0, max: 100, unit: '%' },
210
+ SHUTTER2: { type: 'number', role: 'value.blind', read: true, write: false, min: 0, max: 100, unit: '%' },
211
+ SHUTTER3: { type: 'number', role: 'value.blind', read: true, write: false, min: 0, max: 100, unit: '%' },
212
+ SHUTTER4: { type: 'number', role: 'value.blind', read: true, write: false, min: 0, max: 100, unit: '%' },
213
+ SHUTTER5: { type: 'number', role: 'value.blind', read: true, write: false, min: 0, max: 100, unit: '%' },
214
+ SHUTTER6: { type: 'number', role: 'value.blind', read: true, write: false, min: 0, max: 100, unit: '%' },
215
+ SHUTTER7: { type: 'number', role: 'value.blind', read: true, write: false, min: 0, max: 100, unit: '%' },
216
+ SHUTTER8: { type: 'number', role: 'value.blind', read: true, write: false, min: 0, max: 100, unit: '%' },
217
+ SHUTTER9: { type: 'number', role: 'value.blind', read: true, write: false, min: 0, max: 100, unit: '%' },
218
+ SHUTTER10: { type: 'number', role: 'value.blind', read: true, write: false, min: 0, max: 100, unit: '%' },
219
+ SHUTTER11: { type: 'number', role: 'value.blind', read: true, write: false, min: 0, max: 100, unit: '%' },
220
+ SHUTTER12: { type: 'number', role: 'value.blind', read: true, write: false, min: 0, max: 100, unit: '%' },
221
+ SHUTTER13: { type: 'number', role: 'value.blind', read: true, write: false, min: 0, max: 100, unit: '%' },
222
+ SHUTTER14: { type: 'number', role: 'value.blind', read: true, write: false, min: 0, max: 100, unit: '%' },
223
+ SHUTTER15: { type: 'number', role: 'value.blind', read: true, write: false, min: 0, max: 100, unit: '%' },
224
+ SHUTTER16: { type: 'number', role: 'value.blind', read: true, write: false, min: 0, max: 100, unit: '%' },
225
+ SSId: { type: 'string', role: 'text', read: true, write: false },
226
+ Saturation: { type: 'number', role: 'level.color.saturation', read: true, write: true, min: 0, max: 100 },
227
+ SDK: { type: 'string', role: 'info.firmware', read: true, write: false },
228
+ Subnetmask: { type: 'string', role: 'info.address', read: true, write: false },
228
229
  Scheme: {
229
230
  type: 'number',
230
- role: 'value',
231
+ role: 'level.effect',
231
232
  read: true,
232
233
  write: true,
233
234
  min: 0,
@@ -235,41 +236,41 @@ const datapoints = {
235
236
  states: { 0: 'Single color', 1: 'Wakeup', 2: 'Cycle UP', 3: 'Cycle DOWN', 4: 'Random cycle' },
236
237
  },
237
238
  SeaPressure: { type: 'number', role: 'value.pressure', read: true, write: false, unit: 'hPa' },
238
- SleepMode: { type: 'string', role: 'state', read: true, write: false },
239
+ SleepMode: { type: 'string', role: 'text', read: true, write: false },
239
240
  Solarpump: { type: 'number', role: 'value', read: true, write: false },
240
241
  Solarstorage: { type: 'number', role: 'value.temperature', read: true, write: false, unit: '°C' },
241
242
  Spannung: { type: 'number', role: 'value.voltage', read: true, write: false, unit: 'V' },
242
243
  Speed: { type: 'number', role: 'value', read: true, write: true },
243
244
  Status: { type: 'number', role: 'value', read: true, write: false },
244
245
  Strom: { type: 'number', role: 'value.current', read: true, write: false, unit: 'A' },
245
- Switch1: { type: 'boolean', role: 'switch', read: true, write: true },
246
- Switch2: { type: 'boolean', role: 'switch', read: true, write: true },
247
- Switch3: { type: 'boolean', role: 'switch', read: true, write: true },
248
- Switch4: { type: 'boolean', role: 'switch', read: true, write: true },
249
- Switch5: { type: 'boolean', role: 'switch', read: true, write: true },
250
- Switch6: { type: 'boolean', role: 'switch', read: true, write: true },
251
- Switch7: { type: 'boolean', role: 'switch', read: true, write: true },
252
- Switch8: { type: 'boolean', role: 'switch', read: true, write: true },
253
- Switch9: { type: 'boolean', role: 'switch', read: true, write: true },
254
- Switch10: { type: 'boolean', role: 'switch', read: true, write: true },
255
- Switch11: { type: 'boolean', role: 'switch', read: true, write: true },
256
- Switch12: { type: 'boolean', role: 'switch', read: true, write: true },
257
- Switch13: { type: 'boolean', role: 'switch', read: true, write: true },
258
- Switch14: { type: 'boolean', role: 'switch', read: true, write: true },
259
- Switch15: { type: 'boolean', role: 'switch', read: true, write: true },
260
- Switch16: { type: 'boolean', role: 'switch', read: true, write: true },
261
- Switch17: { type: 'boolean', role: 'switch', read: true, write: true },
262
- Switch18: { type: 'boolean', role: 'switch', read: true, write: true },
263
- Switch19: { type: 'boolean', role: 'switch', read: true, write: true },
264
- Switch20: { type: 'boolean', role: 'switch', read: true, write: true },
265
- Switch21: { type: 'boolean', role: 'switch', read: true, write: true },
266
- Switch22: { type: 'boolean', role: 'switch', read: true, write: true },
267
- Switch23: { type: 'boolean', role: 'switch', read: true, write: true },
268
- Switch24: { type: 'boolean', role: 'switch', read: true, write: true },
269
- Switch25: { type: 'boolean', role: 'switch', read: true, write: true },
270
- Switch26: { type: 'boolean', role: 'switch', read: true, write: true },
271
- Switch27: { type: 'boolean', role: 'switch', read: true, write: true },
272
- Switch28: { type: 'boolean', role: 'switch', read: true, write: true },
246
+ Switch1: { type: 'boolean', role: 'sensor', read: true, write: false },
247
+ Switch2: { type: 'boolean', role: 'sensor', read: true, write: false },
248
+ Switch3: { type: 'boolean', role: 'sensor', read: true, write: false },
249
+ Switch4: { type: 'boolean', role: 'sensor', read: true, write: false },
250
+ Switch5: { type: 'boolean', role: 'sensor', read: true, write: false },
251
+ Switch6: { type: 'boolean', role: 'sensor', read: true, write: false },
252
+ Switch7: { type: 'boolean', role: 'sensor', read: true, write: false },
253
+ Switch8: { type: 'boolean', role: 'sensor', read: true, write: false },
254
+ Switch9: { type: 'boolean', role: 'sensor', read: true, write: false },
255
+ Switch10: { type: 'boolean', role: 'sensor', read: true, write: false },
256
+ Switch11: { type: 'boolean', role: 'sensor', read: true, write: false },
257
+ Switch12: { type: 'boolean', role: 'sensor', read: true, write: false },
258
+ Switch13: { type: 'boolean', role: 'sensor', read: true, write: false },
259
+ Switch14: { type: 'boolean', role: 'sensor', read: true, write: false },
260
+ Switch15: { type: 'boolean', role: 'sensor', read: true, write: false },
261
+ Switch16: { type: 'boolean', role: 'sensor', read: true, write: false },
262
+ Switch17: { type: 'boolean', role: 'sensor', read: true, write: false },
263
+ Switch18: { type: 'boolean', role: 'sensor', read: true, write: false },
264
+ Switch19: { type: 'boolean', role: 'sensor', read: true, write: false },
265
+ Switch20: { type: 'boolean', role: 'sensor', read: true, write: false },
266
+ Switch21: { type: 'boolean', role: 'sensor', read: true, write: false },
267
+ Switch22: { type: 'boolean', role: 'sensor', read: true, write: false },
268
+ Switch23: { type: 'boolean', role: 'sensor', read: true, write: false },
269
+ Switch24: { type: 'boolean', role: 'sensor', read: true, write: false },
270
+ Switch25: { type: 'boolean', role: 'sensor', read: true, write: false },
271
+ Switch26: { type: 'boolean', role: 'sensor', read: true, write: false },
272
+ Switch27: { type: 'boolean', role: 'sensor', read: true, write: false },
273
+ Switch28: { type: 'boolean', role: 'sensor', read: true, write: false },
273
274
  TVOC: { type: 'number', role: 'value.tvoc', read: true, write: false, unit: 'ppb' },
274
275
  Temperatur: { type: 'number', role: 'value.temperature', read: true, write: false, unit: '°C' },
275
276
  Temperature: { type: 'number', role: 'value.temperature', read: true, write: false, unit: '°C' },
@@ -290,9 +291,9 @@ const datapoints = {
290
291
  Timer7: { type: 'object', role: 'state', read: true, write: true },
291
292
  Timer8: { type: 'object', role: 'state', read: true, write: true },
292
293
  Timer9: { type: 'object', role: 'state', read: true, write: true },
293
- Today: { type: 'number', role: 'value.power.consumption', read: true, write: false, unit: 'kWh' },
294
+ Today: { type: 'number', role: 'value.energy.consumed', read: true, write: false, unit: 'kWh' },
294
295
  TodaySumExport: { type: 'number', role: 'value.power.produced', read: true, write: false, unit: 'kWh' },
295
- TodaySumImport: { type: 'number', role: 'value.power.consumption', read: true, write: false, unit: 'kWh' },
296
+ TodaySumImport: { type: 'number', role: 'value.energy.consumed', read: true, write: false, unit: 'kWh' },
296
297
  Total: { type: 'number', role: 'value.power.consumption', read: true, write: false, unit: 'kWh' },
297
298
  Total_in: { type: 'number', role: 'value.power.consumption', read: true, write: false, unit: 'kWh' },
298
299
  Total_out: { type: 'number', role: 'value.power.produced', read: true, write: false, unit: 'kWh' },
@@ -304,25 +305,28 @@ const datapoints = {
304
305
  UvPower: { type: 'number', role: 'value', read: true, write: false, unit: 'W/m²' },
305
306
  UvaIntensity: { type: 'number', role: 'value', read: true, write: false },
306
307
  UvbIntensity: { type: 'number', role: 'value', read: true, write: false },
307
- VCC: { type: 'number', role: 'value.voltage', read: true, write: false, unit: 'V' },
308
- Vcc: { type: 'number', role: 'value.voltage', read: true, write: false, unit: 'V' },
309
- Version: { type: 'string', role: 'state', read: true, write: false },
308
+ VCC: { type: 'number', role: 'value.voltage.vcc', read: true, write: false, unit: 'V' },
309
+ Vcc: { type: 'number', role: 'value.voltage.vcc', read: true, write: false, unit: 'V' },
310
+ Version: { type: 'string', role: 'info.firmware', read: true, write: false },
310
311
  Voltage: { type: 'number', role: 'value.voltage', read: true, write: false, unit: 'V' },
311
312
  WW: { type: 'number', role: 'level.color.white', read: true, write: true },
312
- WW_POWER: { type: 'boolean', role: 'switch.light', read: true, write: true, storeMap: true },
313
+ WW_POWER: { type: 'boolean', role: 'switch.mode.white', read: true, write: true, storeMap: true },
313
314
  Wakeup: { type: 'string', role: 'state', read: true, write: true },
314
- Webserver: { type: 'number', role: 'state', read: true, write: false },
315
- WifiConfig: { type: 'number', role: 'state', read: true, write: false },
316
- WifiPower: { type: 'number', role: 'value', read: true, write: false, unit: 'dBm' },
315
+ Webserver: { type: 'number', role: 'info.status', read: true, write: false },
316
+ WifiConfig: { type: 'number', role: 'info.status', read: true, write: false },
317
+ WifiPower: { type: 'number', role: 'info.status', read: true, write: false, unit: 'dBm' },
318
+ // Without it "Wifi.Channel" falls back to "Channel" and becomes a writable level, which the type-detector
319
+ // takes for a dimmer or a blind
320
+ Wifi_Channel: { type: 'number', role: 'info.status', read: true, write: false },
317
321
  Warmwater: { type: 'number', role: 'value.temperature', read: true, write: false, unit: '°C' },
318
322
  Window: { type: 'number', role: 'value', read: true, write: true },
319
- Yesterday: { type: 'number', role: 'value.power.consumption', read: true, write: false, unit: 'kWh' },
323
+ Yesterday: { type: 'number', role: 'value.energy.consumed', read: true, write: false, unit: 'kWh' },
320
324
  eCO2: { type: 'number', role: 'value.eco2', read: true, write: false, unit: 'ppm' },
321
- gestern: { type: 'number', role: 'value.power.consumption', read: true, write: false, unit: 'kWh' },
322
- heute: { type: 'number', role: 'value.power.consumption', read: true, write: false, unit: 'kWh' },
325
+ gestern: { type: 'number', role: 'value.energy.consumed', read: true, write: false, unit: 'kWh' },
326
+ heute: { type: 'number', role: 'value.energy.consumed', read: true, write: false, unit: 'kWh' },
323
327
  modeLedExor: {
324
328
  type: 'boolean',
325
- role: 'switch',
329
+ role: 'switch.setting',
326
330
  read: true,
327
331
  write: true,
328
332
  def: false,
@@ -330,7 +334,7 @@ const datapoints = {
330
334
  },
331
335
  modeReadColors: {
332
336
  type: 'boolean',
333
- role: 'switch',
337
+ role: 'switch.setting',
334
338
  read: true,
335
339
  write: true,
336
340
  def: true,
@@ -362,69 +366,164 @@ const datapoints = {
362
366
  IrReceived_IRHVAC_Celsius: { type: 'string', role: 'state', read: true, write: false },
363
367
  // Shutter control datapoints (Position, Direction, Target, Tilt for shutters 1-16)
364
368
  Shutter1_Position: { type: 'number', role: 'level.blind', read: true, write: true, min: 0, max: 100, unit: '%' },
365
- Shutter1_Direction: { type: 'number', role: 'value', read: true, write: false },
369
+ Shutter1_Direction: { type: 'number', role: 'value.direction', read: true, write: false },
366
370
  Shutter1_Target: { type: 'number', role: 'value', read: true, write: false, min: 0, max: 100, unit: '%' },
367
371
  Shutter1_Tilt: { type: 'number', role: 'level.tilt', read: true, write: true, min: 0, max: 100, unit: '%' },
368
372
  Shutter2_Position: { type: 'number', role: 'level.blind', read: true, write: true, min: 0, max: 100, unit: '%' },
369
- Shutter2_Direction: { type: 'number', role: 'value', read: true, write: false },
373
+ Shutter2_Direction: { type: 'number', role: 'value.direction', read: true, write: false },
370
374
  Shutter2_Target: { type: 'number', role: 'value', read: true, write: false, min: 0, max: 100, unit: '%' },
371
375
  Shutter2_Tilt: { type: 'number', role: 'level.tilt', read: true, write: true, min: 0, max: 100, unit: '%' },
372
376
  Shutter3_Position: { type: 'number', role: 'level.blind', read: true, write: true, min: 0, max: 100, unit: '%' },
373
- Shutter3_Direction: { type: 'number', role: 'value', read: true, write: false },
377
+ Shutter3_Direction: { type: 'number', role: 'value.direction', read: true, write: false },
374
378
  Shutter3_Target: { type: 'number', role: 'value', read: true, write: false, min: 0, max: 100, unit: '%' },
375
379
  Shutter3_Tilt: { type: 'number', role: 'level.tilt', read: true, write: true, min: 0, max: 100, unit: '%' },
376
380
  Shutter4_Position: { type: 'number', role: 'level.blind', read: true, write: true, min: 0, max: 100, unit: '%' },
377
- Shutter4_Direction: { type: 'number', role: 'value', read: true, write: false },
381
+ Shutter4_Direction: { type: 'number', role: 'value.direction', read: true, write: false },
378
382
  Shutter4_Target: { type: 'number', role: 'value', read: true, write: false, min: 0, max: 100, unit: '%' },
379
383
  Shutter4_Tilt: { type: 'number', role: 'level.tilt', read: true, write: true, min: 0, max: 100, unit: '%' },
380
384
  Shutter5_Position: { type: 'number', role: 'level.blind', read: true, write: true, min: 0, max: 100, unit: '%' },
381
- Shutter5_Direction: { type: 'number', role: 'value', read: true, write: false },
385
+ Shutter5_Direction: { type: 'number', role: 'value.direction', read: true, write: false },
382
386
  Shutter5_Target: { type: 'number', role: 'value', read: true, write: false, min: 0, max: 100, unit: '%' },
383
387
  Shutter5_Tilt: { type: 'number', role: 'level.tilt', read: true, write: true, min: 0, max: 100, unit: '%' },
384
388
  Shutter6_Position: { type: 'number', role: 'level.blind', read: true, write: true, min: 0, max: 100, unit: '%' },
385
- Shutter6_Direction: { type: 'number', role: 'value', read: true, write: false },
389
+ Shutter6_Direction: { type: 'number', role: 'value.direction', read: true, write: false },
386
390
  Shutter6_Target: { type: 'number', role: 'value', read: true, write: false, min: 0, max: 100, unit: '%' },
387
391
  Shutter6_Tilt: { type: 'number', role: 'level.tilt', read: true, write: true, min: 0, max: 100, unit: '%' },
388
392
  Shutter7_Position: { type: 'number', role: 'level.blind', read: true, write: true, min: 0, max: 100, unit: '%' },
389
- Shutter7_Direction: { type: 'number', role: 'value', read: true, write: false },
393
+ Shutter7_Direction: { type: 'number', role: 'value.direction', read: true, write: false },
390
394
  Shutter7_Target: { type: 'number', role: 'value', read: true, write: false, min: 0, max: 100, unit: '%' },
391
395
  Shutter7_Tilt: { type: 'number', role: 'level.tilt', read: true, write: true, min: 0, max: 100, unit: '%' },
392
396
  Shutter8_Position: { type: 'number', role: 'level.blind', read: true, write: true, min: 0, max: 100, unit: '%' },
393
- Shutter8_Direction: { type: 'number', role: 'value', read: true, write: false },
397
+ Shutter8_Direction: { type: 'number', role: 'value.direction', read: true, write: false },
394
398
  Shutter8_Target: { type: 'number', role: 'value', read: true, write: false, min: 0, max: 100, unit: '%' },
395
399
  Shutter8_Tilt: { type: 'number', role: 'level.tilt', read: true, write: true, min: 0, max: 100, unit: '%' },
396
400
  Shutter9_Position: { type: 'number', role: 'level.blind', read: true, write: true, min: 0, max: 100, unit: '%' },
397
- Shutter9_Direction: { type: 'number', role: 'value', read: true, write: false },
401
+ Shutter9_Direction: { type: 'number', role: 'value.direction', read: true, write: false },
398
402
  Shutter9_Target: { type: 'number', role: 'value', read: true, write: false, min: 0, max: 100, unit: '%' },
399
403
  Shutter9_Tilt: { type: 'number', role: 'level.tilt', read: true, write: true, min: 0, max: 100, unit: '%' },
400
404
  Shutter10_Position: { type: 'number', role: 'level.blind', read: true, write: true, min: 0, max: 100, unit: '%' },
401
- Shutter10_Direction: { type: 'number', role: 'value', read: true, write: false },
405
+ Shutter10_Direction: { type: 'number', role: 'value.direction', read: true, write: false },
402
406
  Shutter10_Target: { type: 'number', role: 'value', read: true, write: false, min: 0, max: 100, unit: '%' },
403
407
  Shutter10_Tilt: { type: 'number', role: 'level.tilt', read: true, write: true, min: 0, max: 100, unit: '%' },
404
408
  Shutter11_Position: { type: 'number', role: 'level.blind', read: true, write: true, min: 0, max: 100, unit: '%' },
405
- Shutter11_Direction: { type: 'number', role: 'value', read: true, write: false },
409
+ Shutter11_Direction: { type: 'number', role: 'value.direction', read: true, write: false },
406
410
  Shutter11_Target: { type: 'number', role: 'value', read: true, write: false, min: 0, max: 100, unit: '%' },
407
411
  Shutter11_Tilt: { type: 'number', role: 'level.tilt', read: true, write: true, min: 0, max: 100, unit: '%' },
408
412
  Shutter12_Position: { type: 'number', role: 'level.blind', read: true, write: true, min: 0, max: 100, unit: '%' },
409
- Shutter12_Direction: { type: 'number', role: 'value', read: true, write: false },
413
+ Shutter12_Direction: { type: 'number', role: 'value.direction', read: true, write: false },
410
414
  Shutter12_Target: { type: 'number', role: 'value', read: true, write: false, min: 0, max: 100, unit: '%' },
411
415
  Shutter12_Tilt: { type: 'number', role: 'level.tilt', read: true, write: true, min: 0, max: 100, unit: '%' },
412
416
  Shutter13_Position: { type: 'number', role: 'level.blind', read: true, write: true, min: 0, max: 100, unit: '%' },
413
- Shutter13_Direction: { type: 'number', role: 'value', read: true, write: false },
417
+ Shutter13_Direction: { type: 'number', role: 'value.direction', read: true, write: false },
414
418
  Shutter13_Target: { type: 'number', role: 'value', read: true, write: false, min: 0, max: 100, unit: '%' },
415
419
  Shutter13_Tilt: { type: 'number', role: 'level.tilt', read: true, write: true, min: 0, max: 100, unit: '%' },
416
420
  Shutter14_Position: { type: 'number', role: 'level.blind', read: true, write: true, min: 0, max: 100, unit: '%' },
417
- Shutter14_Direction: { type: 'number', role: 'value', read: true, write: false },
421
+ Shutter14_Direction: { type: 'number', role: 'value.direction', read: true, write: false },
418
422
  Shutter14_Target: { type: 'number', role: 'value', read: true, write: false, min: 0, max: 100, unit: '%' },
419
423
  Shutter14_Tilt: { type: 'number', role: 'level.tilt', read: true, write: true, min: 0, max: 100, unit: '%' },
420
424
  Shutter15_Position: { type: 'number', role: 'level.blind', read: true, write: true, min: 0, max: 100, unit: '%' },
421
- Shutter15_Direction: { type: 'number', role: 'value', read: true, write: false },
425
+ Shutter15_Direction: { type: 'number', role: 'value.direction', read: true, write: false },
422
426
  Shutter15_Target: { type: 'number', role: 'value', read: true, write: false, min: 0, max: 100, unit: '%' },
423
427
  Shutter15_Tilt: { type: 'number', role: 'level.tilt', read: true, write: true, min: 0, max: 100, unit: '%' },
424
428
  Shutter16_Position: { type: 'number', role: 'level.blind', read: true, write: true, min: 0, max: 100, unit: '%' },
425
- Shutter16_Direction: { type: 'number', role: 'value', read: true, write: false },
429
+ Shutter16_Direction: { type: 'number', role: 'value.direction', read: true, write: false },
426
430
  Shutter16_Target: { type: 'number', role: 'value', read: true, write: false, min: 0, max: 100, unit: '%' },
427
431
  Shutter16_Tilt: { type: 'number', role: 'level.tilt', read: true, write: true, min: 0, max: 100, unit: '%' },
428
432
  };
433
+ /**
434
+ * Roles of the states which are not described above and so created automatically. They are only used to
435
+ * give the well-known diagnostic values of Tasmota a role, which the type-detector does not take for a
436
+ * part of a device: a plain "value" would become the actual value of a dimmer or a blind.
437
+ * The key is the name of the state ("Heap") or the path with the name ("Wifi_Signal").
438
+ */
439
+ exports.autoRoles = {
440
+ Heap: { role: 'info.status', unit: 'kB' },
441
+ LoadAvg: { role: 'info.status' },
442
+ MqttCount: { role: 'info.status' },
443
+ MqttPort: { role: 'info.port' },
444
+ Sleep: { role: 'value.interval', unit: 'ms' },
445
+ UptimeSec: { role: 'value.interval', unit: 's' },
446
+ Wifi_AP: { role: 'info.status' },
447
+ Wifi_LinkCount: { role: 'info.status' },
448
+ Wifi_Signal: { role: 'value.rssi', unit: 'dBm' },
449
+ };
450
+ /** Roles which the older versions of the adapter gave the automatically created states */
451
+ exports.autoLegacyRoles = ['value', 'level'];
452
+ const legacyRoleGroups = [
453
+ ['value', ['Action', 'CpuFrequency', 'Scheme', 'WifiPower']],
454
+ [
455
+ 'value.power.consumption',
456
+ [
457
+ 'ApparentPower',
458
+ 'Leistung',
459
+ 'Power_curr',
460
+ 'ReactivePower',
461
+ 'Today',
462
+ 'TodaySumImport',
463
+ 'Yesterday',
464
+ 'gestern',
465
+ 'heute',
466
+ ],
467
+ ],
468
+ [
469
+ 'state',
470
+ [
471
+ 'BSSId',
472
+ 'BuildDateTime',
473
+ 'Core',
474
+ 'DNSServer1',
475
+ 'DNSServer2',
476
+ 'Gateway',
477
+ 'HTTP_API',
478
+ 'Hardware',
479
+ 'Hostname',
480
+ 'IPAddress',
481
+ 'IPaddress',
482
+ 'IP6Global',
483
+ 'IP6Local',
484
+ 'Module',
485
+ 'RestartReason',
486
+ 'SSId',
487
+ 'SDK',
488
+ 'Subnetmask',
489
+ 'SleepMode',
490
+ 'Version',
491
+ 'Webserver',
492
+ 'WifiConfig',
493
+ ],
494
+ ],
495
+ ['level', ['Wifi_Channel']],
496
+ ['level.color.temp', ['CT']],
497
+ ['switch.light', ['CW_POWER', 'RGB_POWER', 'WW_POWER']],
498
+ ['value.temperature', ['DewPoint']],
499
+ ['switch', ['Fade', 'modeLedExor', 'modeReadColors']],
500
+ ['value.voltage', ['VCC', 'Vcc']],
501
+ ];
502
+ for (let i = 1; i <= 8; i++) {
503
+ legacyRoleGroups.push(['button', [`Button${i}`]]);
504
+ }
505
+ // A relay with "switch.power" is neither detected as light nor as socket by the type-detector
506
+ legacyRoleGroups.push(['switch.power', ['POWER']]);
507
+ for (let i = 1; i <= 29; i++) {
508
+ legacyRoleGroups.push(['switch.power', [`POWER${i}`]]);
509
+ }
510
+ for (let i = 1; i <= 16; i++) {
511
+ legacyRoleGroups.push(['state', [`SHUTTER${i}`]]);
512
+ legacyRoleGroups.push(['value', [`Shutter${i}_Direction`]]);
513
+ }
514
+ for (let i = 1; i <= 28; i++) {
515
+ legacyRoleGroups.push(['switch', [`Switch${i}`]]);
516
+ }
517
+ /**
518
+ * Roles which the older versions of the adapter gave the data points above. An existing object which still
519
+ * has such a role gets the current one, a role the user changed is kept.
520
+ */
521
+ exports.legacyRoles = {};
522
+ for (const [role, keys] of legacyRoleGroups) {
523
+ for (const key of keys) {
524
+ exports.legacyRoles[key] ||= [];
525
+ exports.legacyRoles[key].push(role);
526
+ }
527
+ }
429
528
  exports.default = datapoints;
430
529
  //# sourceMappingURL=datapoints.js.map