zigbee-herdsman-converters 14.0.570 → 14.0.573
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/converters/fromZigbee.js +139 -144
- package/devices/aurora_lighting.js +3 -3
- package/devices/danalock.js +1 -1
- package/devices/datek.js +1 -1
- package/devices/gledopto.js +8 -0
- package/devices/ikea.js +4 -4
- package/devices/iluminize.js +1 -1
- package/devices/inovelli.js +2 -2
- package/devices/jethome.js +1 -1
- package/devices/kwikset.js +7 -7
- package/devices/legrand.js +1 -1
- package/devices/lonsonho.js +1 -1
- package/devices/onesti.js +1 -1
- package/devices/perenio.js +1 -1
- package/devices/philips.js +7 -0
- package/devices/rgb_genie.js +2 -2
- package/devices/schlage.js +1 -1
- package/devices/shinasystem.js +1 -1
- package/devices/sunricher.js +2 -1
- package/devices/terncy.js +8 -0
- package/devices/tuya.js +12 -5
- package/devices/weiser.js +2 -2
- package/devices/xiaomi.js +1 -0
- package/devices/yale.js +1 -2
- package/lib/exposes.js +0 -1
- package/lib/legacy.js +22 -20
- package/lib/utils.js +2 -2
- package/lib/xiaomi.js +1 -1
- package/package.json +2 -2
package/converters/fromZigbee.js
CHANGED
|
@@ -38,106 +38,109 @@ const converters = {
|
|
|
38
38
|
convert: (model, msg, publish, options, meta) => {
|
|
39
39
|
const result = {};
|
|
40
40
|
if (msg.data.hasOwnProperty('localTemp')) {
|
|
41
|
-
result[postfixWithEndpointName('local_temperature', msg, model)] = precisionRound(msg.data['localTemp'], 2) / 100;
|
|
41
|
+
result[postfixWithEndpointName('local_temperature', msg, model, meta)] = precisionRound(msg.data['localTemp'], 2) / 100;
|
|
42
42
|
}
|
|
43
43
|
if (msg.data.hasOwnProperty('localTemperatureCalibration')) {
|
|
44
|
-
result[postfixWithEndpointName('local_temperature_calibration', msg, model)] =
|
|
44
|
+
result[postfixWithEndpointName('local_temperature_calibration', msg, model, meta)] =
|
|
45
45
|
precisionRound(msg.data['localTemperatureCalibration'], 2) / 10;
|
|
46
46
|
}
|
|
47
47
|
if (msg.data.hasOwnProperty('outdoorTemp')) {
|
|
48
|
-
result[postfixWithEndpointName('outdoor_temperature', msg, model)] = precisionRound(msg.data['outdoorTemp'], 2) / 100;
|
|
48
|
+
result[postfixWithEndpointName('outdoor_temperature', msg, model, meta)] = precisionRound(msg.data['outdoorTemp'], 2) / 100;
|
|
49
49
|
}
|
|
50
50
|
if (msg.data.hasOwnProperty('occupancy')) {
|
|
51
|
-
result[postfixWithEndpointName('occupancy', msg, model)] = (msg.data.occupancy % 2) > 0;
|
|
51
|
+
result[postfixWithEndpointName('occupancy', msg, model, meta)] = (msg.data.occupancy % 2) > 0;
|
|
52
52
|
}
|
|
53
53
|
if (msg.data.hasOwnProperty('occupiedHeatingSetpoint')) {
|
|
54
54
|
let value = precisionRound(msg.data['occupiedHeatingSetpoint'], 2) / 100;
|
|
55
55
|
// Stelpro will return -325.65 when set to off, value is not realistic anyway
|
|
56
56
|
value = value < -250 ? 0 : value;
|
|
57
|
-
result[postfixWithEndpointName('occupied_heating_setpoint', msg, model)] = value;
|
|
57
|
+
result[postfixWithEndpointName('occupied_heating_setpoint', msg, model, meta)] = value;
|
|
58
58
|
}
|
|
59
59
|
if (msg.data.hasOwnProperty('unoccupiedHeatingSetpoint')) {
|
|
60
|
-
result[postfixWithEndpointName('unoccupied_heating_setpoint', msg, model)] =
|
|
60
|
+
result[postfixWithEndpointName('unoccupied_heating_setpoint', msg, model, meta)] =
|
|
61
61
|
precisionRound(msg.data['unoccupiedHeatingSetpoint'], 2) / 100;
|
|
62
62
|
}
|
|
63
63
|
if (msg.data.hasOwnProperty('occupiedCoolingSetpoint')) {
|
|
64
|
-
result[postfixWithEndpointName('occupied_cooling_setpoint', msg, model)] =
|
|
64
|
+
result[postfixWithEndpointName('occupied_cooling_setpoint', msg, model, meta)] =
|
|
65
65
|
precisionRound(msg.data['occupiedCoolingSetpoint'], 2) / 100;
|
|
66
66
|
}
|
|
67
67
|
if (msg.data.hasOwnProperty('unoccupiedCoolingSetpoint')) {
|
|
68
|
-
result[postfixWithEndpointName('unoccupied_cooling_setpoint', msg, model)] =
|
|
68
|
+
result[postfixWithEndpointName('unoccupied_cooling_setpoint', msg, model, meta)] =
|
|
69
69
|
precisionRound(msg.data['unoccupiedCoolingSetpoint'], 2) / 100;
|
|
70
70
|
}
|
|
71
71
|
if (msg.data.hasOwnProperty('setpointChangeAmount')) {
|
|
72
|
-
result[postfixWithEndpointName('setpoint_change_amount', msg, model)] = msg.data['setpointChangeAmount'] / 100;
|
|
72
|
+
result[postfixWithEndpointName('setpoint_change_amount', msg, model, meta)] = msg.data['setpointChangeAmount'] / 100;
|
|
73
73
|
}
|
|
74
74
|
if (msg.data.hasOwnProperty('setpointChangeSource')) {
|
|
75
75
|
const lookup = {0: 'manual', 1: 'schedule', 2: 'externally'};
|
|
76
|
-
result[postfixWithEndpointName('setpoint_change_source', msg, model)] = lookup[msg.data['setpointChangeSource']];
|
|
76
|
+
result[postfixWithEndpointName('setpoint_change_source', msg, model, meta)] = lookup[msg.data['setpointChangeSource']];
|
|
77
77
|
}
|
|
78
78
|
if (msg.data.hasOwnProperty('setpointChangeSourceTimeStamp')) {
|
|
79
79
|
const date = new Date(2000, 0, 1);
|
|
80
80
|
date.setSeconds(msg.data['setpointChangeSourceTimeStamp']);
|
|
81
81
|
const value = toLocalISOString(date);
|
|
82
|
-
result[postfixWithEndpointName('setpoint_change_source_timestamp', msg, model)] = value;
|
|
82
|
+
result[postfixWithEndpointName('setpoint_change_source_timestamp', msg, model, meta)] = value;
|
|
83
83
|
}
|
|
84
84
|
if (msg.data.hasOwnProperty('remoteSensing')) {
|
|
85
85
|
const value = msg.data['remoteSensing'];
|
|
86
|
-
result[postfixWithEndpointName('remote_sensing', msg, model)] = {
|
|
86
|
+
result[postfixWithEndpointName('remote_sensing', msg, model, meta)] = {
|
|
87
87
|
local_temperature: ((value & 1) > 0) ? 'remotely' : 'internally',
|
|
88
88
|
outdoor_temperature: ((value & 1<<1) > 0) ? 'remotely' : 'internally',
|
|
89
89
|
occupancy: ((value & 1<<2) > 0) ? 'remotely' : 'internally',
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
92
|
if (msg.data.hasOwnProperty('ctrlSeqeOfOper')) {
|
|
93
|
-
result[postfixWithEndpointName('control_sequence_of_operation', msg, model)] =
|
|
93
|
+
result[postfixWithEndpointName('control_sequence_of_operation', msg, model, meta)] =
|
|
94
94
|
constants.thermostatControlSequenceOfOperations[msg.data['ctrlSeqeOfOper']];
|
|
95
95
|
}
|
|
96
96
|
if (msg.data.hasOwnProperty('programingOperMode')) {
|
|
97
|
-
result[postfixWithEndpointName('programming_operation_mode', msg, model)] =
|
|
97
|
+
result[postfixWithEndpointName('programming_operation_mode', msg, model, meta)] =
|
|
98
98
|
constants.thermostatProgrammingOperationModes[msg.data['programingOperMode']];
|
|
99
99
|
}
|
|
100
100
|
if (msg.data.hasOwnProperty('systemMode')) {
|
|
101
|
-
result[postfixWithEndpointName('system_mode', msg, model)] = constants.thermostatSystemModes[msg.data['systemMode']];
|
|
101
|
+
result[postfixWithEndpointName('system_mode', msg, model, meta)] = constants.thermostatSystemModes[msg.data['systemMode']];
|
|
102
102
|
}
|
|
103
103
|
if (msg.data.hasOwnProperty('runningMode')) {
|
|
104
|
-
result[postfixWithEndpointName('running_mode', msg, model)] =
|
|
104
|
+
result[postfixWithEndpointName('running_mode', msg, model, meta)] =
|
|
105
|
+
constants.thermostatRunningMode[msg.data['runningMode']];
|
|
105
106
|
}
|
|
106
107
|
if (msg.data.hasOwnProperty('runningState')) {
|
|
107
|
-
result[postfixWithEndpointName('running_state', msg, model)] =
|
|
108
|
+
result[postfixWithEndpointName('running_state', msg, model, meta)] =
|
|
109
|
+
constants.thermostatRunningStates[msg.data['runningState']];
|
|
108
110
|
}
|
|
109
111
|
if (msg.data.hasOwnProperty('pIHeatingDemand')) {
|
|
110
|
-
result[postfixWithEndpointName('pi_heating_demand', msg, model)] =
|
|
112
|
+
result[postfixWithEndpointName('pi_heating_demand', msg, model, meta)] =
|
|
111
113
|
mapNumberRange(msg.data['pIHeatingDemand'], 0, 255, 0, 100);
|
|
112
114
|
}
|
|
113
115
|
if (msg.data.hasOwnProperty('tempSetpointHold')) {
|
|
114
|
-
result[postfixWithEndpointName('temperature_setpoint_hold', msg, model)] = msg.data['tempSetpointHold'] == 1;
|
|
116
|
+
result[postfixWithEndpointName('temperature_setpoint_hold', msg, model, meta)] = msg.data['tempSetpointHold'] == 1;
|
|
115
117
|
}
|
|
116
118
|
if (msg.data.hasOwnProperty('tempSetpointHoldDuration')) {
|
|
117
|
-
result[postfixWithEndpointName('temperature_setpoint_hold_duration', msg, model)] =
|
|
119
|
+
result[postfixWithEndpointName('temperature_setpoint_hold_duration', msg, model, meta)] =
|
|
120
|
+
msg.data['tempSetpointHoldDuration'];
|
|
118
121
|
}
|
|
119
122
|
if (msg.data.hasOwnProperty('minHeatSetpointLimit')) {
|
|
120
123
|
let value = precisionRound(msg.data['minHeatSetpointLimit'], 2) / 100;
|
|
121
124
|
value = value < -250 ? 0 : value;
|
|
122
|
-
result[postfixWithEndpointName('min_heat_setpoint_limit', msg, model)] = value;
|
|
125
|
+
result[postfixWithEndpointName('min_heat_setpoint_limit', msg, model, meta)] = value;
|
|
123
126
|
}
|
|
124
127
|
if (msg.data.hasOwnProperty('maxHeatSetpointLimit')) {
|
|
125
128
|
let value = precisionRound(msg.data['maxHeatSetpointLimit'], 2) / 100;
|
|
126
129
|
value = value < -250 ? 0 : value;
|
|
127
|
-
result[postfixWithEndpointName('max_heat_setpoint_limit', msg, model)] = value;
|
|
130
|
+
result[postfixWithEndpointName('max_heat_setpoint_limit', msg, model, meta)] = value;
|
|
128
131
|
}
|
|
129
132
|
if (msg.data.hasOwnProperty('absMinHeatSetpointLimit')) {
|
|
130
133
|
let value = precisionRound(msg.data['absMinHeatSetpointLimit'], 2) / 100;
|
|
131
134
|
value = value < -250 ? 0 : value;
|
|
132
|
-
result[postfixWithEndpointName('abs_min_heat_setpoint_limit', msg, model)] = value;
|
|
135
|
+
result[postfixWithEndpointName('abs_min_heat_setpoint_limit', msg, model, meta)] = value;
|
|
133
136
|
}
|
|
134
137
|
if (msg.data.hasOwnProperty('absMaxHeatSetpointLimit')) {
|
|
135
138
|
let value = precisionRound(msg.data['absMaxHeatSetpointLimit'], 2) / 100;
|
|
136
139
|
value = value < -250 ? 0 : value;
|
|
137
|
-
result[postfixWithEndpointName('abs_max_heat_setpoint_limit', msg, model)] = value;
|
|
140
|
+
result[postfixWithEndpointName('abs_max_heat_setpoint_limit', msg, model, meta)] = value;
|
|
138
141
|
}
|
|
139
142
|
if (msg.data.hasOwnProperty('acLouverPosition')) {
|
|
140
|
-
result[postfixWithEndpointName('ac_louver_position', msg, model)] =
|
|
143
|
+
result[postfixWithEndpointName('ac_louver_position', msg, model, meta)] =
|
|
141
144
|
constants.thermostatAcLouverPositions[msg.data['acLouverPosition']];
|
|
142
145
|
}
|
|
143
146
|
return result;
|
|
@@ -166,7 +169,7 @@ const converters = {
|
|
|
166
169
|
transitions.push(entry);
|
|
167
170
|
}
|
|
168
171
|
|
|
169
|
-
return {[postfixWithEndpointName('weekly_schedule', msg, model)]: {days, transitions}};
|
|
172
|
+
return {[postfixWithEndpointName('weekly_schedule', msg, model, meta)]: {days, transitions}};
|
|
170
173
|
},
|
|
171
174
|
},
|
|
172
175
|
hvac_user_interface: {
|
|
@@ -350,7 +353,7 @@ const converters = {
|
|
|
350
353
|
convert: (model, msg, publish, options, meta) => {
|
|
351
354
|
if (msg.data.hasOwnProperty('measuredValue')) {
|
|
352
355
|
const temperature = parseFloat(msg.data['measuredValue']) / 100.0;
|
|
353
|
-
const property = postfixWithEndpointName('temperature', msg, model);
|
|
356
|
+
const property = postfixWithEndpointName('temperature', msg, model, meta);
|
|
354
357
|
return {[property]: calibrateAndPrecisionRoundOptions(temperature, options, 'temperature')};
|
|
355
358
|
}
|
|
356
359
|
},
|
|
@@ -487,7 +490,7 @@ const converters = {
|
|
|
487
490
|
type: ['attributeReport', 'readResponse'],
|
|
488
491
|
convert: (model, msg, publish, options, meta) => {
|
|
489
492
|
if (msg.data.hasOwnProperty('currentLevel')) {
|
|
490
|
-
const property = postfixWithEndpointName('brightness', msg, model);
|
|
493
|
+
const property = postfixWithEndpointName('brightness', msg, model, meta);
|
|
491
494
|
return {[property]: msg.data['currentLevel']};
|
|
492
495
|
}
|
|
493
496
|
},
|
|
@@ -709,12 +712,12 @@ const converters = {
|
|
|
709
712
|
convert: (model, msg, publish, options, meta) => {
|
|
710
713
|
const result = {};
|
|
711
714
|
if (msg.data.hasOwnProperty('develcoPulseConfiguration')) {
|
|
712
|
-
result[postfixWithEndpointName('pulse_configuration', msg, model)] =
|
|
715
|
+
result[postfixWithEndpointName('pulse_configuration', msg, model, meta)] =
|
|
713
716
|
msg.data['develcoPulseConfiguration'];
|
|
714
717
|
}
|
|
715
718
|
|
|
716
719
|
if (msg.data.hasOwnProperty('develcoInterfaceMode')) {
|
|
717
|
-
result[postfixWithEndpointName('interface_mode', msg, model)] =
|
|
720
|
+
result[postfixWithEndpointName('interface_mode', msg, model, meta)] =
|
|
718
721
|
constants.develcoInterfaceMode.hasOwnProperty(msg.data['develcoInterfaceMode']) ?
|
|
719
722
|
constants.develcoInterfaceMode[msg.data['develcoInterfaceMode']] :
|
|
720
723
|
msg.data['develcoInterfaceMode'];
|
|
@@ -761,7 +764,7 @@ const converters = {
|
|
|
761
764
|
for (const entry of lookup) {
|
|
762
765
|
if (msg.data.hasOwnProperty(entry.key)) {
|
|
763
766
|
const factor = getFactor(entry.factor);
|
|
764
|
-
const property = postfixWithEndpointName(entry.name, msg, model);
|
|
767
|
+
const property = postfixWithEndpointName(entry.name, msg, model, meta);
|
|
765
768
|
const value = msg.data[entry.key] * factor;
|
|
766
769
|
payload[property] = calibrateAndPrecisionRoundOptions(value, options, entry.name);
|
|
767
770
|
}
|
|
@@ -777,7 +780,7 @@ const converters = {
|
|
|
777
780
|
type: ['attributeReport', 'readResponse'],
|
|
778
781
|
convert: (model, msg, publish, options, meta) => {
|
|
779
782
|
if (msg.data.hasOwnProperty('onOff')) {
|
|
780
|
-
const property = postfixWithEndpointName('state', msg, model);
|
|
783
|
+
const property = postfixWithEndpointName('state', msg, model, meta);
|
|
781
784
|
return {[property]: msg.data['onOff'] === 1 ? 'ON' : 'OFF'};
|
|
782
785
|
}
|
|
783
786
|
},
|
|
@@ -790,7 +793,7 @@ const converters = {
|
|
|
790
793
|
// prevent that multiple messages get send.
|
|
791
794
|
// https://github.com/Koenkk/zigbee2mqtt/issues/3687
|
|
792
795
|
if (msg.data.hasOwnProperty('onOff') && !hasAlreadyProcessedMessage(msg)) {
|
|
793
|
-
const property = postfixWithEndpointName('state', msg, model);
|
|
796
|
+
const property = postfixWithEndpointName('state', msg, model, meta);
|
|
794
797
|
return {[property]: msg.data['onOff'] === 1 ? 'ON' : 'OFF'};
|
|
795
798
|
}
|
|
796
799
|
},
|
|
@@ -801,7 +804,7 @@ const converters = {
|
|
|
801
804
|
convert: (model, msg, publish, options, meta) => {
|
|
802
805
|
const lookup = {0: 'off', 1: 'on', 2: 'toggle', 255: 'previous'};
|
|
803
806
|
if (msg.data.hasOwnProperty('startUpOnOff')) {
|
|
804
|
-
const property = postfixWithEndpointName('power_on_behavior', msg, model);
|
|
807
|
+
const property = postfixWithEndpointName('power_on_behavior', msg, model, meta);
|
|
805
808
|
return {[property]: lookup[msg.data['startUpOnOff']]};
|
|
806
809
|
}
|
|
807
810
|
},
|
|
@@ -944,9 +947,9 @@ const converters = {
|
|
|
944
947
|
type: 'commandStatusChangeNotification',
|
|
945
948
|
convert: (model, msg, publish, options, meta) => {
|
|
946
949
|
const zoneStatus = msg.data.zonestatus;
|
|
947
|
-
const contactProperty = postfixWithEndpointName('contact', msg, model);
|
|
948
|
-
const tamperProperty = postfixWithEndpointName('tamper', msg, model);
|
|
949
|
-
const batteryLowProperty = postfixWithEndpointName('battery_low', msg, model);
|
|
950
|
+
const contactProperty = postfixWithEndpointName('contact', msg, model, meta);
|
|
951
|
+
const tamperProperty = postfixWithEndpointName('tamper', msg, model, meta);
|
|
952
|
+
const batteryLowProperty = postfixWithEndpointName('battery_low', msg, model, meta);
|
|
950
953
|
|
|
951
954
|
return {
|
|
952
955
|
[contactProperty]: !((zoneStatus & 1) > 0),
|
|
@@ -1087,12 +1090,22 @@ const converters = {
|
|
|
1087
1090
|
};
|
|
1088
1091
|
},
|
|
1089
1092
|
},
|
|
1093
|
+
command_store: {
|
|
1094
|
+
cluster: 'genScenes',
|
|
1095
|
+
type: 'commandStore',
|
|
1096
|
+
convert: (model, msg, publish, options, meta) => {
|
|
1097
|
+
if (utils.hasAlreadyProcessedMessage(msg)) return;
|
|
1098
|
+
const payload = {action: utils.postfixWithEndpointName(`store_${msg.data.sceneid}`, msg, model, meta)};
|
|
1099
|
+
utils.addActionGroup(payload, msg, model);
|
|
1100
|
+
return payload;
|
|
1101
|
+
},
|
|
1102
|
+
},
|
|
1090
1103
|
command_recall: {
|
|
1091
1104
|
cluster: 'genScenes',
|
|
1092
1105
|
type: 'commandRecall',
|
|
1093
1106
|
convert: (model, msg, publish, options, meta) => {
|
|
1094
1107
|
if (hasAlreadyProcessedMessage(msg)) return;
|
|
1095
|
-
const payload = {action: postfixWithEndpointName(`recall_${msg.data.sceneid}`, msg, model)};
|
|
1108
|
+
const payload = {action: postfixWithEndpointName(`recall_${msg.data.sceneid}`, msg, model, meta)};
|
|
1096
1109
|
addActionGroup(payload, msg, model);
|
|
1097
1110
|
return payload;
|
|
1098
1111
|
},
|
|
@@ -1102,7 +1115,7 @@ const converters = {
|
|
|
1102
1115
|
type: 'commandPanic',
|
|
1103
1116
|
convert: (model, msg, publish, options, meta) => {
|
|
1104
1117
|
if (hasAlreadyProcessedMessage(msg)) return;
|
|
1105
|
-
const payload = {action: postfixWithEndpointName(`panic`, msg, model)};
|
|
1118
|
+
const payload = {action: postfixWithEndpointName(`panic`, msg, model, meta)};
|
|
1106
1119
|
addActionGroup(payload, msg, model);
|
|
1107
1120
|
return payload;
|
|
1108
1121
|
},
|
|
@@ -1113,7 +1126,7 @@ const converters = {
|
|
|
1113
1126
|
convert: (model, msg, publish, options, meta) => {
|
|
1114
1127
|
if (hasAlreadyProcessedMessage(msg)) return;
|
|
1115
1128
|
const payload = {
|
|
1116
|
-
action: postfixWithEndpointName(constants.armMode[msg.data['armmode']], msg, model),
|
|
1129
|
+
action: postfixWithEndpointName(constants.armMode[msg.data['armmode']], msg, model, meta),
|
|
1117
1130
|
action_code: msg.data.code,
|
|
1118
1131
|
action_zone: msg.data.zoneid,
|
|
1119
1132
|
};
|
|
@@ -1136,7 +1149,7 @@ const converters = {
|
|
|
1136
1149
|
type: 'commandStop',
|
|
1137
1150
|
convert: (model, msg, publish, options, meta) => {
|
|
1138
1151
|
if (hasAlreadyProcessedMessage(msg)) return;
|
|
1139
|
-
const payload = {action: postfixWithEndpointName('stop', msg, model)};
|
|
1152
|
+
const payload = {action: postfixWithEndpointName('stop', msg, model, meta)};
|
|
1140
1153
|
addActionGroup(payload, msg, model);
|
|
1141
1154
|
return payload;
|
|
1142
1155
|
},
|
|
@@ -1146,7 +1159,7 @@ const converters = {
|
|
|
1146
1159
|
type: 'commandUpOpen',
|
|
1147
1160
|
convert: (model, msg, publish, options, meta) => {
|
|
1148
1161
|
if (hasAlreadyProcessedMessage(msg)) return;
|
|
1149
|
-
const payload = {action: postfixWithEndpointName('open', msg, model)};
|
|
1162
|
+
const payload = {action: postfixWithEndpointName('open', msg, model, meta)};
|
|
1150
1163
|
addActionGroup(payload, msg, model);
|
|
1151
1164
|
return payload;
|
|
1152
1165
|
},
|
|
@@ -1156,7 +1169,7 @@ const converters = {
|
|
|
1156
1169
|
type: 'commandDownClose',
|
|
1157
1170
|
convert: (model, msg, publish, options, meta) => {
|
|
1158
1171
|
if (hasAlreadyProcessedMessage(msg)) return;
|
|
1159
|
-
const payload = {action: postfixWithEndpointName('close', msg, model)};
|
|
1172
|
+
const payload = {action: postfixWithEndpointName('close', msg, model, meta)};
|
|
1160
1173
|
addActionGroup(payload, msg, model);
|
|
1161
1174
|
return payload;
|
|
1162
1175
|
},
|
|
@@ -1166,7 +1179,7 @@ const converters = {
|
|
|
1166
1179
|
type: 'commandOn',
|
|
1167
1180
|
convert: (model, msg, publish, options, meta) => {
|
|
1168
1181
|
if (hasAlreadyProcessedMessage(msg)) return;
|
|
1169
|
-
const payload = {action: postfixWithEndpointName('on', msg, model)};
|
|
1182
|
+
const payload = {action: postfixWithEndpointName('on', msg, model, meta)};
|
|
1170
1183
|
addActionGroup(payload, msg, model);
|
|
1171
1184
|
return payload;
|
|
1172
1185
|
},
|
|
@@ -1176,7 +1189,7 @@ const converters = {
|
|
|
1176
1189
|
type: 'commandOff',
|
|
1177
1190
|
convert: (model, msg, publish, options, meta) => {
|
|
1178
1191
|
if (hasAlreadyProcessedMessage(msg)) return;
|
|
1179
|
-
const payload = {action: postfixWithEndpointName('off', msg, model)};
|
|
1192
|
+
const payload = {action: postfixWithEndpointName('off', msg, model, meta)};
|
|
1180
1193
|
addActionGroup(payload, msg, model);
|
|
1181
1194
|
return payload;
|
|
1182
1195
|
},
|
|
@@ -1186,7 +1199,7 @@ const converters = {
|
|
|
1186
1199
|
type: 'commandOffWithEffect',
|
|
1187
1200
|
convert: (model, msg, publish, options, meta) => {
|
|
1188
1201
|
if (hasAlreadyProcessedMessage(msg)) return;
|
|
1189
|
-
const payload = {action: postfixWithEndpointName(`off`, msg, model)};
|
|
1202
|
+
const payload = {action: postfixWithEndpointName(`off`, msg, model, meta)};
|
|
1190
1203
|
addActionGroup(payload, msg, model);
|
|
1191
1204
|
return payload;
|
|
1192
1205
|
},
|
|
@@ -1196,7 +1209,7 @@ const converters = {
|
|
|
1196
1209
|
type: 'commandToggle',
|
|
1197
1210
|
convert: (model, msg, publish, options, meta) => {
|
|
1198
1211
|
if (hasAlreadyProcessedMessage(msg)) return;
|
|
1199
|
-
const payload = {action: postfixWithEndpointName('toggle', msg, model)};
|
|
1212
|
+
const payload = {action: postfixWithEndpointName('toggle', msg, model, meta)};
|
|
1200
1213
|
addActionGroup(payload, msg, model);
|
|
1201
1214
|
return payload;
|
|
1202
1215
|
},
|
|
@@ -1208,7 +1221,7 @@ const converters = {
|
|
|
1208
1221
|
convert: (model, msg, publish, options, meta) => {
|
|
1209
1222
|
if (hasAlreadyProcessedMessage(msg)) return;
|
|
1210
1223
|
const payload = {
|
|
1211
|
-
action: postfixWithEndpointName(`brightness_move_to_level`, msg, model),
|
|
1224
|
+
action: postfixWithEndpointName(`brightness_move_to_level`, msg, model, meta),
|
|
1212
1225
|
action_level: msg.data.level,
|
|
1213
1226
|
action_transition_time: msg.data.transtime / 100,
|
|
1214
1227
|
};
|
|
@@ -1216,7 +1229,7 @@ const converters = {
|
|
|
1216
1229
|
|
|
1217
1230
|
if (options.simulated_brightness) {
|
|
1218
1231
|
globalStore.putValue(msg.endpoint, 'simulated_brightness_brightness', msg.data.level);
|
|
1219
|
-
const property = postfixWithEndpointName('brightness', msg, model);
|
|
1232
|
+
const property = postfixWithEndpointName('brightness', msg, model, meta);
|
|
1220
1233
|
payload[property] = msg.data.level;
|
|
1221
1234
|
}
|
|
1222
1235
|
|
|
@@ -1230,7 +1243,7 @@ const converters = {
|
|
|
1230
1243
|
convert: (model, msg, publish, options, meta) => {
|
|
1231
1244
|
if (hasAlreadyProcessedMessage(msg)) return;
|
|
1232
1245
|
const direction = msg.data.movemode === 1 ? 'down' : 'up';
|
|
1233
|
-
const action = postfixWithEndpointName(`brightness_move_${direction}`, msg, model);
|
|
1246
|
+
const action = postfixWithEndpointName(`brightness_move_${direction}`, msg, model, meta);
|
|
1234
1247
|
const payload = {action, action_rate: msg.data.rate};
|
|
1235
1248
|
addActionGroup(payload, msg, model);
|
|
1236
1249
|
|
|
@@ -1248,7 +1261,7 @@ const converters = {
|
|
|
1248
1261
|
brightness += delta;
|
|
1249
1262
|
brightness = numberWithinRange(brightness, 0, 255);
|
|
1250
1263
|
globalStore.putValue(msg.endpoint, 'simulated_brightness_brightness', brightness);
|
|
1251
|
-
const property = postfixWithEndpointName('brightness', msg, model);
|
|
1264
|
+
const property = postfixWithEndpointName('brightness', msg, model, meta);
|
|
1252
1265
|
publish({[property]: brightness});
|
|
1253
1266
|
}, intervalOpts);
|
|
1254
1267
|
|
|
@@ -1267,7 +1280,7 @@ const converters = {
|
|
|
1267
1280
|
if (hasAlreadyProcessedMessage(msg)) return;
|
|
1268
1281
|
const direction = msg.data.stepmode === 1 ? 'down' : 'up';
|
|
1269
1282
|
const payload = {
|
|
1270
|
-
action: postfixWithEndpointName(`brightness_step_${direction}`, msg, model),
|
|
1283
|
+
action: postfixWithEndpointName(`brightness_step_${direction}`, msg, model, meta),
|
|
1271
1284
|
action_step_size: msg.data.stepsize,
|
|
1272
1285
|
action_transition_time: msg.data.transtime / 100,
|
|
1273
1286
|
};
|
|
@@ -1279,7 +1292,7 @@ const converters = {
|
|
|
1279
1292
|
brightness += delta;
|
|
1280
1293
|
brightness = numberWithinRange(brightness, 0, 255);
|
|
1281
1294
|
globalStore.putValue(msg.endpoint, 'simulated_brightness_brightness', brightness);
|
|
1282
|
-
const property = postfixWithEndpointName('brightness', msg, model);
|
|
1295
|
+
const property = postfixWithEndpointName('brightness', msg, model, meta);
|
|
1283
1296
|
payload[property] = brightness;
|
|
1284
1297
|
}
|
|
1285
1298
|
|
|
@@ -1297,7 +1310,7 @@ const converters = {
|
|
|
1297
1310
|
globalStore.putValue(msg.endpoint, 'simulated_brightness_timer', undefined);
|
|
1298
1311
|
}
|
|
1299
1312
|
|
|
1300
|
-
const payload = {action: postfixWithEndpointName(`brightness_stop`, msg, model)};
|
|
1313
|
+
const payload = {action: postfixWithEndpointName(`brightness_stop`, msg, model, meta)};
|
|
1301
1314
|
addActionGroup(payload, msg, model);
|
|
1302
1315
|
return payload;
|
|
1303
1316
|
},
|
|
@@ -1308,7 +1321,7 @@ const converters = {
|
|
|
1308
1321
|
convert: (model, msg, publish, options, meta) => {
|
|
1309
1322
|
if (hasAlreadyProcessedMessage(msg)) return;
|
|
1310
1323
|
const direction = msg.data.movemode === 1 ? 'down' : 'up';
|
|
1311
|
-
const action = postfixWithEndpointName(`color_temperature_move_${direction}`, msg, model);
|
|
1324
|
+
const action = postfixWithEndpointName(`color_temperature_move_${direction}`, msg, model, meta);
|
|
1312
1325
|
const payload = {action, action_rate: msg.data.rate, action_minimum: msg.data.minimum, action_maximum: msg.data.maximum};
|
|
1313
1326
|
addActionGroup(payload, msg, model);
|
|
1314
1327
|
return payload;
|
|
@@ -1321,7 +1334,7 @@ const converters = {
|
|
|
1321
1334
|
if (hasAlreadyProcessedMessage(msg)) return;
|
|
1322
1335
|
const direction = msg.data.stepmode === 1 ? 'up' : 'down';
|
|
1323
1336
|
const payload = {
|
|
1324
|
-
action: postfixWithEndpointName(`color_temperature_step_${direction}`, msg, model),
|
|
1337
|
+
action: postfixWithEndpointName(`color_temperature_step_${direction}`, msg, model, meta),
|
|
1325
1338
|
action_step_size: msg.data.stepsize,
|
|
1326
1339
|
};
|
|
1327
1340
|
|
|
@@ -1339,7 +1352,7 @@ const converters = {
|
|
|
1339
1352
|
convert: (model, msg, publish, options, meta) => {
|
|
1340
1353
|
if (hasAlreadyProcessedMessage(msg)) return;
|
|
1341
1354
|
const payload = {
|
|
1342
|
-
action: postfixWithEndpointName(`enhanced_move_to_hue_and_saturation`, msg, model),
|
|
1355
|
+
action: postfixWithEndpointName(`enhanced_move_to_hue_and_saturation`, msg, model, meta),
|
|
1343
1356
|
action_enhanced_hue: msg.data.enhancehue,
|
|
1344
1357
|
action_hue: mapNumberRange(msg.data.enhancehue, 0, 65535, 0, 360, 1),
|
|
1345
1358
|
action_saturation: msg.data.saturation,
|
|
@@ -1357,7 +1370,7 @@ const converters = {
|
|
|
1357
1370
|
if (hasAlreadyProcessedMessage(msg)) return;
|
|
1358
1371
|
const direction = msg.data.stepmode === 1 ? 'up' : 'down';
|
|
1359
1372
|
const payload = {
|
|
1360
|
-
action: postfixWithEndpointName(`color_hue_step_${direction}`, msg, model),
|
|
1373
|
+
action: postfixWithEndpointName(`color_hue_step_${direction}`, msg, model, meta),
|
|
1361
1374
|
action_step_size: msg.data.stepsize,
|
|
1362
1375
|
action_transition_time: msg.data.transtime/100,
|
|
1363
1376
|
};
|
|
@@ -1372,7 +1385,7 @@ const converters = {
|
|
|
1372
1385
|
if (hasAlreadyProcessedMessage(msg)) return;
|
|
1373
1386
|
const direction = msg.data.stepmode === 1 ? 'up' : 'down';
|
|
1374
1387
|
const payload = {
|
|
1375
|
-
action: postfixWithEndpointName(`color_saturation_step_${direction}`, msg, model),
|
|
1388
|
+
action: postfixWithEndpointName(`color_saturation_step_${direction}`, msg, model, meta),
|
|
1376
1389
|
action_step_size: msg.data.stepsize,
|
|
1377
1390
|
action_transition_time: msg.data.transtime/100,
|
|
1378
1391
|
};
|
|
@@ -1393,7 +1406,7 @@ const converters = {
|
|
|
1393
1406
|
};
|
|
1394
1407
|
|
|
1395
1408
|
const payload = {
|
|
1396
|
-
action: postfixWithEndpointName(`color_loop_set`, msg, model),
|
|
1409
|
+
action: postfixWithEndpointName(`color_loop_set`, msg, model, meta),
|
|
1397
1410
|
action_update_flags: {
|
|
1398
1411
|
action: (updateFlags & 1 << 0) > 0,
|
|
1399
1412
|
direction: (updateFlags & 1 << 1) > 0,
|
|
@@ -1416,7 +1429,7 @@ const converters = {
|
|
|
1416
1429
|
convert: (model, msg, publish, options, meta) => {
|
|
1417
1430
|
if (hasAlreadyProcessedMessage(msg)) return;
|
|
1418
1431
|
const payload = {
|
|
1419
|
-
action: postfixWithEndpointName(`color_temperature_move`, msg, model),
|
|
1432
|
+
action: postfixWithEndpointName(`color_temperature_move`, msg, model, meta),
|
|
1420
1433
|
action_color_temperature: msg.data.colortemp,
|
|
1421
1434
|
action_transition_time: msg.data.transtime,
|
|
1422
1435
|
};
|
|
@@ -1430,7 +1443,7 @@ const converters = {
|
|
|
1430
1443
|
convert: (model, msg, publish, options, meta) => {
|
|
1431
1444
|
if (hasAlreadyProcessedMessage(msg)) return;
|
|
1432
1445
|
const payload = {
|
|
1433
|
-
action: postfixWithEndpointName(`color_move`, msg, model),
|
|
1446
|
+
action: postfixWithEndpointName(`color_move`, msg, model, meta),
|
|
1434
1447
|
action_color: {
|
|
1435
1448
|
x: precisionRound(msg.data.colorx / 65536, 3),
|
|
1436
1449
|
y: precisionRound(msg.data.colory / 65536, 3),
|
|
@@ -1447,7 +1460,7 @@ const converters = {
|
|
|
1447
1460
|
convert: (model, msg, publish, options, meta) => {
|
|
1448
1461
|
if (hasAlreadyProcessedMessage(msg)) return;
|
|
1449
1462
|
const movestop = msg.data.movemode == 1 ? 'move' : 'stop';
|
|
1450
|
-
const action = postfixWithEndpointName(`hue_${movestop}`, msg, model);
|
|
1463
|
+
const action = postfixWithEndpointName(`hue_${movestop}`, msg, model, meta);
|
|
1451
1464
|
const payload = {action, action_rate: msg.data.rate};
|
|
1452
1465
|
addActionGroup(payload, msg, model);
|
|
1453
1466
|
return payload;
|
|
@@ -1459,7 +1472,7 @@ const converters = {
|
|
|
1459
1472
|
convert: (model, msg, publish, options, meta) => {
|
|
1460
1473
|
if (hasAlreadyProcessedMessage(msg)) return;
|
|
1461
1474
|
const payload = {
|
|
1462
|
-
action: postfixWithEndpointName('move_to_saturation', msg, model),
|
|
1475
|
+
action: postfixWithEndpointName('move_to_saturation', msg, model, meta),
|
|
1463
1476
|
action_saturation: msg.data.saturation,
|
|
1464
1477
|
action_transition_time: msg.data.transtime,
|
|
1465
1478
|
};
|
|
@@ -1473,7 +1486,7 @@ const converters = {
|
|
|
1473
1486
|
convert: (model, msg, publish, options, meta) => {
|
|
1474
1487
|
if (hasAlreadyProcessedMessage(msg)) return;
|
|
1475
1488
|
const payload = {
|
|
1476
|
-
action: postfixWithEndpointName(`move_to_hue`, msg, model),
|
|
1489
|
+
action: postfixWithEndpointName(`move_to_hue`, msg, model, meta),
|
|
1477
1490
|
action_hue: msg.data.hue,
|
|
1478
1491
|
action_transition_time: msg.data.transtime / 100,
|
|
1479
1492
|
action_direction: msg.data.direction === 0 ? 'decrement' : 'increment',
|
|
@@ -1487,7 +1500,7 @@ const converters = {
|
|
|
1487
1500
|
type: 'commandEmergency',
|
|
1488
1501
|
convert: (model, msg, publish, options, meta) => {
|
|
1489
1502
|
if (hasAlreadyProcessedMessage(msg)) return;
|
|
1490
|
-
const payload = {action: postfixWithEndpointName(`emergency`, msg, model)};
|
|
1503
|
+
const payload = {action: postfixWithEndpointName(`emergency`, msg, model, meta)};
|
|
1491
1504
|
addActionGroup(payload, msg, model);
|
|
1492
1505
|
return payload;
|
|
1493
1506
|
},
|
|
@@ -1497,7 +1510,7 @@ const converters = {
|
|
|
1497
1510
|
type: 'commandOn',
|
|
1498
1511
|
convert: (model, msg, publish, options, meta) => {
|
|
1499
1512
|
if (hasAlreadyProcessedMessage(msg)) return;
|
|
1500
|
-
const property = postfixWithEndpointName('state', msg, model);
|
|
1513
|
+
const property = postfixWithEndpointName('state', msg, model, meta);
|
|
1501
1514
|
return {[property]: 'ON'};
|
|
1502
1515
|
},
|
|
1503
1516
|
},
|
|
@@ -1506,7 +1519,7 @@ const converters = {
|
|
|
1506
1519
|
type: 'commandOff',
|
|
1507
1520
|
convert: (model, msg, publish, options, meta) => {
|
|
1508
1521
|
if (hasAlreadyProcessedMessage(msg)) return;
|
|
1509
|
-
const property = postfixWithEndpointName('state', msg, model);
|
|
1522
|
+
const property = postfixWithEndpointName('state', msg, model, meta);
|
|
1510
1523
|
return {[property]: 'OFF'};
|
|
1511
1524
|
},
|
|
1512
1525
|
},
|
|
@@ -1514,7 +1527,7 @@ const converters = {
|
|
|
1514
1527
|
cluster: 'genIdentify',
|
|
1515
1528
|
type: ['attributeReport', 'readResponse'],
|
|
1516
1529
|
convert: (model, msg, publish, options, meta) => {
|
|
1517
|
-
return {action: postfixWithEndpointName(`identify`, msg, model)};
|
|
1530
|
+
return {action: postfixWithEndpointName(`identify`, msg, model, meta)};
|
|
1518
1531
|
},
|
|
1519
1532
|
},
|
|
1520
1533
|
cover_position_tilt: {
|
|
@@ -1530,11 +1543,11 @@ const converters = {
|
|
|
1530
1543
|
const invert = model.meta && model.meta.coverInverted ? !options.invert_cover : options.invert_cover;
|
|
1531
1544
|
if (msg.data.hasOwnProperty('currentPositionLiftPercentage') && msg.data['currentPositionLiftPercentage'] <= 100) {
|
|
1532
1545
|
const value = msg.data['currentPositionLiftPercentage'];
|
|
1533
|
-
result[postfixWithEndpointName('position', msg, model)] = invert ? value : 100 - value;
|
|
1546
|
+
result[postfixWithEndpointName('position', msg, model, meta)] = invert ? value : 100 - value;
|
|
1534
1547
|
}
|
|
1535
1548
|
if (msg.data.hasOwnProperty('currentPositionTiltPercentage') && msg.data['currentPositionTiltPercentage'] <= 100) {
|
|
1536
1549
|
const value = msg.data['currentPositionTiltPercentage'];
|
|
1537
|
-
result[postfixWithEndpointName('tilt', msg, model)] = invert ? value : 100 - value;
|
|
1550
|
+
result[postfixWithEndpointName('tilt', msg, model, meta)] = invert ? value : 100 - value;
|
|
1538
1551
|
}
|
|
1539
1552
|
return result;
|
|
1540
1553
|
},
|
|
@@ -1896,10 +1909,10 @@ const converters = {
|
|
|
1896
1909
|
options: [exposes.options.precision('voc'), exposes.options.calibration('voc')],
|
|
1897
1910
|
convert: (model, msg, publish, options, meta) => {
|
|
1898
1911
|
const voc = parseFloat(msg.data['measuredValue']);
|
|
1899
|
-
const vocProperty = postfixWithEndpointName('voc', msg, model);
|
|
1912
|
+
const vocProperty = postfixWithEndpointName('voc', msg, model, meta);
|
|
1900
1913
|
|
|
1901
1914
|
let airQuality;
|
|
1902
|
-
const airQualityProperty = postfixWithEndpointName('air_quality', msg, model);
|
|
1915
|
+
const airQualityProperty = postfixWithEndpointName('air_quality', msg, model, meta);
|
|
1903
1916
|
if (voc <= 65) {
|
|
1904
1917
|
airQuality = 'excellent';
|
|
1905
1918
|
} else if (voc <= 220) {
|
|
@@ -2571,7 +2584,7 @@ const converters = {
|
|
|
2571
2584
|
convert: (model, msg, publish, options, meta) => {
|
|
2572
2585
|
const lookup = {0: 'off', 1: 'on', 2: 'previous'};
|
|
2573
2586
|
if (msg.data.hasOwnProperty('moesStartUpOnOff')) {
|
|
2574
|
-
const property = postfixWithEndpointName('power_on_behavior', msg, model);
|
|
2587
|
+
const property = postfixWithEndpointName('power_on_behavior', msg, model, meta);
|
|
2575
2588
|
return {[property]: lookup[msg.data['moesStartUpOnOff']]};
|
|
2576
2589
|
}
|
|
2577
2590
|
},
|
|
@@ -3503,106 +3516,108 @@ const converters = {
|
|
|
3503
3516
|
const result = {};
|
|
3504
3517
|
// Danfoss sends pi_heating_demand as raw %
|
|
3505
3518
|
if (typeof msg.data['pIHeatingDemand'] == 'number') {
|
|
3506
|
-
result[postfixWithEndpointName('pi_heating_demand', msg, model)] =
|
|
3519
|
+
result[postfixWithEndpointName('pi_heating_demand', msg, model, meta)] =
|
|
3507
3520
|
precisionRound(msg.data['pIHeatingDemand'], 0);
|
|
3508
3521
|
}
|
|
3509
3522
|
if (msg.data.hasOwnProperty('danfossWindowOpenFeatureEnable')) {
|
|
3510
|
-
result[postfixWithEndpointName('window_open_feature', msg, model)] =
|
|
3523
|
+
result[postfixWithEndpointName('window_open_feature', msg, model, meta)] =
|
|
3511
3524
|
(msg.data['danfossWindowOpenFeatureEnable'] === 1);
|
|
3512
3525
|
}
|
|
3513
3526
|
if (msg.data.hasOwnProperty('danfossWindowOpenInternal')) {
|
|
3514
|
-
result[postfixWithEndpointName('window_open_internal', msg, model)] =
|
|
3527
|
+
result[postfixWithEndpointName('window_open_internal', msg, model, meta)] =
|
|
3515
3528
|
constants.danfossWindowOpen.hasOwnProperty(msg.data['danfossWindowOpenInternal']) ?
|
|
3516
3529
|
constants.danfossWindowOpen[msg.data['danfossWindowOpenInternal']] :
|
|
3517
3530
|
msg.data['danfossWindowOpenInternal'];
|
|
3518
3531
|
}
|
|
3519
3532
|
if (msg.data.hasOwnProperty('danfossWindowOpenExternal')) {
|
|
3520
|
-
result[postfixWithEndpointName('window_open_external', msg, model)] = (msg.data['danfossWindowOpenExternal'] === 1);
|
|
3533
|
+
result[postfixWithEndpointName('window_open_external', msg, model, meta)] = (msg.data['danfossWindowOpenExternal'] === 1);
|
|
3521
3534
|
}
|
|
3522
3535
|
if (msg.data.hasOwnProperty('danfossDayOfWeek')) {
|
|
3523
|
-
result[postfixWithEndpointName('day_of_week', msg, model)] =
|
|
3536
|
+
result[postfixWithEndpointName('day_of_week', msg, model, meta)] =
|
|
3524
3537
|
constants.dayOfWeek.hasOwnProperty(msg.data['danfossDayOfWeek']) ?
|
|
3525
3538
|
constants.dayOfWeek[msg.data['danfossDayOfWeek']] :
|
|
3526
3539
|
msg.data['danfossDayOfWeek'];
|
|
3527
3540
|
}
|
|
3528
3541
|
if (msg.data.hasOwnProperty('danfossTriggerTime')) {
|
|
3529
|
-
result[postfixWithEndpointName('trigger_time', msg, model)] = msg.data['danfossTriggerTime'];
|
|
3542
|
+
result[postfixWithEndpointName('trigger_time', msg, model, meta)] = msg.data['danfossTriggerTime'];
|
|
3530
3543
|
}
|
|
3531
3544
|
if (msg.data.hasOwnProperty('danfossMountedModeActive')) {
|
|
3532
|
-
result[postfixWithEndpointName('mounted_mode_active', msg, model)] = (msg.data['danfossMountedModeActive'] === 1);
|
|
3545
|
+
result[postfixWithEndpointName('mounted_mode_active', msg, model, meta)] = (msg.data['danfossMountedModeActive'] === 1);
|
|
3533
3546
|
}
|
|
3534
3547
|
if (msg.data.hasOwnProperty('danfossMountedModeControl')) {
|
|
3535
|
-
result[postfixWithEndpointName('mounted_mode_control', msg, model)] = (msg.data['danfossMountedModeControl'] === 1);
|
|
3548
|
+
result[postfixWithEndpointName('mounted_mode_control', msg, model, meta)] = (msg.data['danfossMountedModeControl'] === 1);
|
|
3536
3549
|
}
|
|
3537
3550
|
if (msg.data.hasOwnProperty('danfossThermostatOrientation')) {
|
|
3538
|
-
result[postfixWithEndpointName('thermostat_vertical_orientation', msg, model)] =
|
|
3551
|
+
result[postfixWithEndpointName('thermostat_vertical_orientation', msg, model, meta)] =
|
|
3539
3552
|
(msg.data['danfossThermostatOrientation'] === 1);
|
|
3540
3553
|
}
|
|
3541
3554
|
if (msg.data.hasOwnProperty('danfossExternalMeasuredRoomSensor')) {
|
|
3542
|
-
result[postfixWithEndpointName('external_measured_room_sensor', msg, model)] =
|
|
3555
|
+
result[postfixWithEndpointName('external_measured_room_sensor', msg, model, meta)] =
|
|
3543
3556
|
msg.data['danfossExternalMeasuredRoomSensor'];
|
|
3544
3557
|
}
|
|
3545
3558
|
if (msg.data.hasOwnProperty('danfossRadiatorCovered')) {
|
|
3546
|
-
result[postfixWithEndpointName('radiator_covered', msg, model)] = (msg.data['danfossRadiatorCovered'] === 1);
|
|
3559
|
+
result[postfixWithEndpointName('radiator_covered', msg, model, meta)] = (msg.data['danfossRadiatorCovered'] === 1);
|
|
3547
3560
|
}
|
|
3548
3561
|
if (msg.data.hasOwnProperty('danfossViewingDirection')) {
|
|
3549
|
-
result[postfixWithEndpointName('viewing_direction', msg, model)] = (msg.data['danfossViewingDirection'] === 1);
|
|
3562
|
+
result[postfixWithEndpointName('viewing_direction', msg, model, meta)] = (msg.data['danfossViewingDirection'] === 1);
|
|
3550
3563
|
}
|
|
3551
3564
|
if (msg.data.hasOwnProperty('danfossAlgorithmScaleFactor')) {
|
|
3552
|
-
result[postfixWithEndpointName('algorithm_scale_factor', msg, model)] = msg.data['danfossAlgorithmScaleFactor'];
|
|
3565
|
+
result[postfixWithEndpointName('algorithm_scale_factor', msg, model, meta)] = msg.data['danfossAlgorithmScaleFactor'];
|
|
3553
3566
|
}
|
|
3554
3567
|
if (msg.data.hasOwnProperty('danfossHeatAvailable')) {
|
|
3555
|
-
result[postfixWithEndpointName('heat_available', msg, model)] = (msg.data['danfossHeatAvailable'] === 1);
|
|
3568
|
+
result[postfixWithEndpointName('heat_available', msg, model, meta)] = (msg.data['danfossHeatAvailable'] === 1);
|
|
3556
3569
|
}
|
|
3557
3570
|
if (msg.data.hasOwnProperty('danfossHeatRequired')) {
|
|
3558
3571
|
if (msg.data['danfossHeatRequired'] === 1) {
|
|
3559
|
-
result[postfixWithEndpointName('heat_required', msg, model)] = true;
|
|
3560
|
-
result[postfixWithEndpointName('running_state', msg, model)] = 'heat';
|
|
3572
|
+
result[postfixWithEndpointName('heat_required', msg, model, meta)] = true;
|
|
3573
|
+
result[postfixWithEndpointName('running_state', msg, model, meta)] = 'heat';
|
|
3561
3574
|
} else {
|
|
3562
|
-
result[postfixWithEndpointName('heat_required', msg, model)] = false;
|
|
3563
|
-
result[postfixWithEndpointName('running_state', msg, model)] = 'idle';
|
|
3575
|
+
result[postfixWithEndpointName('heat_required', msg, model, meta)] = false;
|
|
3576
|
+
result[postfixWithEndpointName('running_state', msg, model, meta)] = 'idle';
|
|
3564
3577
|
}
|
|
3565
3578
|
}
|
|
3566
3579
|
if (msg.data.hasOwnProperty('danfossLoadBalancingEnable')) {
|
|
3567
|
-
result[postfixWithEndpointName('load_balancing_enable', msg, model)] = (msg.data['danfossLoadBalancingEnable'] === 1);
|
|
3580
|
+
result[postfixWithEndpointName('load_balancing_enable', msg, model, meta)] = (msg.data['danfossLoadBalancingEnable'] === 1);
|
|
3568
3581
|
}
|
|
3569
3582
|
if (msg.data.hasOwnProperty('danfossLoadRoomMean')) {
|
|
3570
|
-
result[postfixWithEndpointName('load_room_mean', msg, model)] = msg.data['danfossLoadRoomMean'];
|
|
3583
|
+
result[postfixWithEndpointName('load_room_mean', msg, model, meta)] = msg.data['danfossLoadRoomMean'];
|
|
3571
3584
|
}
|
|
3572
3585
|
if (msg.data.hasOwnProperty('danfossLoadEstimate')) {
|
|
3573
|
-
result[postfixWithEndpointName('load_estimate', msg, model)] = msg.data['danfossLoadEstimate'];
|
|
3586
|
+
result[postfixWithEndpointName('load_estimate', msg, model, meta)] = msg.data['danfossLoadEstimate'];
|
|
3574
3587
|
}
|
|
3575
3588
|
if (msg.data.hasOwnProperty('danfossPreheatStatus')) {
|
|
3576
|
-
result[postfixWithEndpointName('preheat_status', msg, model)] = (msg.data['danfossPreheatStatus'] === 1);
|
|
3589
|
+
result[postfixWithEndpointName('preheat_status', msg, model, meta)] = (msg.data['danfossPreheatStatus'] === 1);
|
|
3577
3590
|
}
|
|
3578
3591
|
if (msg.data.hasOwnProperty('danfossAdaptionRunStatus')) {
|
|
3579
|
-
result[postfixWithEndpointName('adaptation_run_status', msg, model)] =
|
|
3592
|
+
result[postfixWithEndpointName('adaptation_run_status', msg, model, meta)] =
|
|
3580
3593
|
constants.danfossAdaptionRunStatus[msg.data['danfossAdaptionRunStatus']];
|
|
3581
3594
|
}
|
|
3582
3595
|
if (msg.data.hasOwnProperty('danfossAdaptionRunSettings')) {
|
|
3583
|
-
result[postfixWithEndpointName('adaptation_run_settings', msg, model)] =
|
|
3596
|
+
result[postfixWithEndpointName('adaptation_run_settings', msg, model, meta)] =
|
|
3597
|
+
(msg.data['danfossAdaptionRunSettings'] === 1);
|
|
3584
3598
|
}
|
|
3585
3599
|
if (msg.data.hasOwnProperty('danfossAdaptionRunControl')) {
|
|
3586
|
-
result[postfixWithEndpointName('adaptation_run_control', msg, model)] =
|
|
3600
|
+
result[postfixWithEndpointName('adaptation_run_control', msg, model, meta)] =
|
|
3587
3601
|
constants.danfossAdaptionRunControl[msg.data['danfossAdaptionRunControl']];
|
|
3588
3602
|
}
|
|
3589
3603
|
if (msg.data.hasOwnProperty('danfossRegulationSetpointOffset')) {
|
|
3590
|
-
result[postfixWithEndpointName('regulation_setpoint_offset', msg, model)] =
|
|
3604
|
+
result[postfixWithEndpointName('regulation_setpoint_offset', msg, model, meta)] =
|
|
3605
|
+
msg.data['danfossRegulationSetpointOffset'];
|
|
3591
3606
|
}
|
|
3592
3607
|
// Danfoss Icon Converters
|
|
3593
3608
|
if (msg.data.hasOwnProperty('danfossRoomStatusCode')) {
|
|
3594
|
-
result[postfixWithEndpointName('room_status_code', msg, model)] =
|
|
3609
|
+
result[postfixWithEndpointName('room_status_code', msg, model, meta)] =
|
|
3595
3610
|
constants.danfossRoomStatusCode.hasOwnProperty(msg.data['danfossRoomStatusCode']) ?
|
|
3596
3611
|
constants.danfossRoomStatusCode[msg.data['danfossRoomStatusCode']] :
|
|
3597
3612
|
msg.data['danfossRoomStatusCode'];
|
|
3598
3613
|
}
|
|
3599
3614
|
if (msg.data.hasOwnProperty('danfossOutputStatus')) {
|
|
3600
3615
|
if (msg.data['danfossOutputStatus'] === 1) {
|
|
3601
|
-
result[postfixWithEndpointName('output_status', msg, model)] = 'active';
|
|
3602
|
-
result[postfixWithEndpointName('running_state', msg, model)] = 'heat';
|
|
3616
|
+
result[postfixWithEndpointName('output_status', msg, model, meta)] = 'active';
|
|
3617
|
+
result[postfixWithEndpointName('running_state', msg, model, meta)] = 'heat';
|
|
3603
3618
|
} else {
|
|
3604
|
-
result[postfixWithEndpointName('output_status', msg, model)] = 'inactive';
|
|
3605
|
-
result[postfixWithEndpointName('running_state', msg, model)] = 'idle';
|
|
3619
|
+
result[postfixWithEndpointName('output_status', msg, model, meta)] = 'inactive';
|
|
3620
|
+
result[postfixWithEndpointName('running_state', msg, model, meta)] = 'idle';
|
|
3606
3621
|
}
|
|
3607
3622
|
}
|
|
3608
3623
|
return result;
|
|
@@ -3620,7 +3635,7 @@ const converters = {
|
|
|
3620
3635
|
let percentage = msg.data['batteryPercentageRemaining'];
|
|
3621
3636
|
percentage = dontDividePercentage ? percentage : percentage / 2;
|
|
3622
3637
|
|
|
3623
|
-
result[postfixWithEndpointName('battery', msg, model)] = precisionRound(percentage, 2);
|
|
3638
|
+
result[postfixWithEndpointName('battery', msg, model, meta)] = precisionRound(percentage, 2);
|
|
3624
3639
|
}
|
|
3625
3640
|
return result;
|
|
3626
3641
|
},
|
|
@@ -3631,19 +3646,19 @@ const converters = {
|
|
|
3631
3646
|
convert: (model, msg, publish, options, meta) => {
|
|
3632
3647
|
const result = {};
|
|
3633
3648
|
if (msg.data.hasOwnProperty('danfossSystemStatusCode')) {
|
|
3634
|
-
result[postfixWithEndpointName('system_status_code', msg, model)] =
|
|
3649
|
+
result[postfixWithEndpointName('system_status_code', msg, model, meta)] =
|
|
3635
3650
|
constants.danfossSystemStatusCode.hasOwnProperty(msg.data['danfossSystemStatusCode']) ?
|
|
3636
3651
|
constants.danfossSystemStatusCode[msg.data['danfossSystemStatusCode']] :
|
|
3637
3652
|
msg.data['danfossSystemStatusCode'];
|
|
3638
3653
|
}
|
|
3639
3654
|
if (msg.data.hasOwnProperty('danfossSystemStatusWater')) {
|
|
3640
|
-
result[postfixWithEndpointName('system_status_water', msg, model)] =
|
|
3655
|
+
result[postfixWithEndpointName('system_status_water', msg, model, meta)] =
|
|
3641
3656
|
constants.danfossSystemStatusWater.hasOwnProperty(msg.data['danfossSystemStatusWater']) ?
|
|
3642
3657
|
constants.danfossSystemStatusWater[msg.data['danfossSystemStatusWater']] :
|
|
3643
3658
|
msg.data['danfossSystemStatusWater'];
|
|
3644
3659
|
}
|
|
3645
3660
|
if (msg.data.hasOwnProperty('danfossMultimasterRole')) {
|
|
3646
|
-
result[postfixWithEndpointName('multimaster_role', msg, model)] =
|
|
3661
|
+
result[postfixWithEndpointName('multimaster_role', msg, model, meta)] =
|
|
3647
3662
|
constants.danfossMultimasterRole.hasOwnProperty(msg.data['danfossMultimasterRole']) ?
|
|
3648
3663
|
constants.danfossMultimasterRole[msg.data['danfossMultimasterRole']] :
|
|
3649
3664
|
msg.data['danfossMultimasterRole'];
|
|
@@ -3747,7 +3762,7 @@ const converters = {
|
|
|
3747
3762
|
}
|
|
3748
3763
|
|
|
3749
3764
|
const payload = {
|
|
3750
|
-
action: postfixWithEndpointName(`color_temperature_move`, msg, model),
|
|
3765
|
+
action: postfixWithEndpointName(`color_temperature_move`, msg, model, meta),
|
|
3751
3766
|
action_color_temperature: msg.data.colortemp,
|
|
3752
3767
|
action_transition_time: msg.data.transtime,
|
|
3753
3768
|
action_color_temperature_direction: direction,
|
|
@@ -4908,7 +4923,7 @@ const converters = {
|
|
|
4908
4923
|
type: ['attributeReport', 'readResponse'],
|
|
4909
4924
|
convert: (model, msg, publish, options, meta) => {
|
|
4910
4925
|
if (msg.data.hasOwnProperty(0xfc00)) {
|
|
4911
|
-
const property = postfixWithEndpointName('min_brightness', msg, model);
|
|
4926
|
+
const property = postfixWithEndpointName('min_brightness', msg, model, meta);
|
|
4912
4927
|
const value = parseInt(msg.data[0xfc00].toString(16).slice(0, 2), 16);
|
|
4913
4928
|
return {[property]: value};
|
|
4914
4929
|
}
|
|
@@ -4940,7 +4955,7 @@ const converters = {
|
|
|
4940
4955
|
cluster: 'genOnOff',
|
|
4941
4956
|
type: 'commandToggle',
|
|
4942
4957
|
convert: (model, msg, publish, options, meta) => {
|
|
4943
|
-
return {action: postfixWithEndpointName('toggle', msg, model)};
|
|
4958
|
+
return {action: postfixWithEndpointName('toggle', msg, model, meta)};
|
|
4944
4959
|
},
|
|
4945
4960
|
},
|
|
4946
4961
|
ikea_arrow_click: {
|
|
@@ -5183,26 +5198,6 @@ const converters = {
|
|
|
5183
5198
|
return {action: `${button}_${action}`};
|
|
5184
5199
|
},
|
|
5185
5200
|
},
|
|
5186
|
-
ZG2819S_command_on: {
|
|
5187
|
-
cluster: 'genOnOff',
|
|
5188
|
-
type: 'commandOn',
|
|
5189
|
-
convert: (model, msg, publish, options, meta) => {
|
|
5190
|
-
// The device sends this command for all four group IDs.
|
|
5191
|
-
// Only forward for the first group.
|
|
5192
|
-
if (msg.groupID !== 46337) return null;
|
|
5193
|
-
return {action: postfixWithEndpointName('on', msg, model)};
|
|
5194
|
-
},
|
|
5195
|
-
},
|
|
5196
|
-
ZG2819S_command_off: {
|
|
5197
|
-
cluster: 'genOnOff',
|
|
5198
|
-
type: 'commandOff',
|
|
5199
|
-
convert: (model, msg, publish, options, meta) => {
|
|
5200
|
-
// The device sends this command for all four group IDs.
|
|
5201
|
-
// Only forward for the first group.
|
|
5202
|
-
if (msg.groupID !== 46337) return null;
|
|
5203
|
-
return {action: postfixWithEndpointName('off', msg, model)};
|
|
5204
|
-
},
|
|
5205
|
-
},
|
|
5206
5201
|
kmpcil_res005_occupancy: {
|
|
5207
5202
|
cluster: 'genBinaryInput',
|
|
5208
5203
|
type: ['attributeReport', 'readResponse'],
|
|
@@ -5423,7 +5418,7 @@ const converters = {
|
|
|
5423
5418
|
type: ['attributeReport', 'readResponse'],
|
|
5424
5419
|
convert: (model, msg, publish, options, meta) => {
|
|
5425
5420
|
const multiEndpoint = model.meta && model.meta.multiEndpoint;
|
|
5426
|
-
const property = multiEndpoint ? postfixWithEndpointName('state', msg, model) : 'state';
|
|
5421
|
+
const property = multiEndpoint ? postfixWithEndpointName('state', msg, model, meta) : 'state';
|
|
5427
5422
|
return {[property]: msg.data.presentValue ? 'ON' : 'OFF'};
|
|
5428
5423
|
},
|
|
5429
5424
|
},
|
|
@@ -5899,7 +5894,7 @@ const converters = {
|
|
|
5899
5894
|
const actionLookup = {0: 'release', 1: 'single', 2: 'double', 3: 'tripple', 4: 'hold'};
|
|
5900
5895
|
const value = msg.data['presentValue'];
|
|
5901
5896
|
const action = actionLookup[value];
|
|
5902
|
-
return {action: postfixWithEndpointName(action, msg, model)};
|
|
5897
|
+
return {action: postfixWithEndpointName(action, msg, model, meta)};
|
|
5903
5898
|
},
|
|
5904
5899
|
},
|
|
5905
5900
|
terncy_raw: {
|
|
@@ -5982,12 +5977,12 @@ const converters = {
|
|
|
5982
5977
|
const value = msg.data['currentPositionLiftPercentage'];
|
|
5983
5978
|
const position = invert ? 100 - value : value;
|
|
5984
5979
|
const state = invert ? (position > 0 ? 'CLOSE' : 'OPEN') : (position > 0 ? 'OPEN' : 'CLOSE');
|
|
5985
|
-
result[postfixWithEndpointName('position', msg, model)] = position;
|
|
5986
|
-
result[postfixWithEndpointName('state', msg, model)] = state;
|
|
5980
|
+
result[postfixWithEndpointName('position', msg, model, meta)] = position;
|
|
5981
|
+
result[postfixWithEndpointName('state', msg, model, meta)] = state;
|
|
5987
5982
|
}
|
|
5988
5983
|
if (msg.data.hasOwnProperty('currentPositionTiltPercentage') && msg.data['currentPositionTiltPercentage'] <= 100) {
|
|
5989
5984
|
const value = msg.data['currentPositionTiltPercentage'];
|
|
5990
|
-
result[postfixWithEndpointName('tilt', msg, model)] = invert ? 100 - value : value;
|
|
5985
|
+
result[postfixWithEndpointName('tilt', msg, model, meta)] = invert ? 100 - value : value;
|
|
5991
5986
|
}
|
|
5992
5987
|
return result;
|
|
5993
5988
|
},
|
|
@@ -6266,7 +6261,7 @@ const converters = {
|
|
|
6266
6261
|
cluster: 'lightingColorCtrl',
|
|
6267
6262
|
type: ['raw'],
|
|
6268
6263
|
convert: (model, msg, publish, options, meta) => {
|
|
6269
|
-
const payload = {action: postfixWithEndpointName(`color_stop`, msg, model)};
|
|
6264
|
+
const payload = {action: postfixWithEndpointName(`color_stop`, msg, model, meta)};
|
|
6270
6265
|
addActionGroup(payload, msg, model);
|
|
6271
6266
|
return payload;
|
|
6272
6267
|
},
|
|
@@ -7018,7 +7013,7 @@ const converters = {
|
|
|
7018
7013
|
options: [exposes.options.legacy()],
|
|
7019
7014
|
convert: (model, msg, publish, options, meta) => {
|
|
7020
7015
|
const action = msg.data['onOff'] === 1 ? 'release' : 'hold';
|
|
7021
|
-
const payload = {action: postfixWithEndpointName(action, msg, model)};
|
|
7016
|
+
const payload = {action: postfixWithEndpointName(action, msg, model, meta)};
|
|
7022
7017
|
|
|
7023
7018
|
if (isLegacyEnabled(options)) {
|
|
7024
7019
|
const key = `button_${getKey(model.endpoint(msg.device), msg.endpoint.ID)}`;
|
|
@@ -7034,7 +7029,7 @@ const converters = {
|
|
|
7034
7029
|
convert: (model, msg, publish, options, meta) => {
|
|
7035
7030
|
// Xiaomi wall switches use endpoint 4, 5 or 6 to indicate an action on the button so we have to skip that.
|
|
7036
7031
|
if (msg.data.hasOwnProperty('onOff') && ![4, 5, 6].includes(msg.endpoint.ID)) {
|
|
7037
|
-
const property = postfixWithEndpointName('state', msg, model);
|
|
7032
|
+
const property = postfixWithEndpointName('state', msg, model, meta);
|
|
7038
7033
|
return {[property]: msg.data['onOff'] === 1 ? 'ON' : 'OFF'};
|
|
7039
7034
|
}
|
|
7040
7035
|
},
|
|
@@ -7292,7 +7287,7 @@ const converters = {
|
|
|
7292
7287
|
const value = msg.data[property];
|
|
7293
7288
|
|
|
7294
7289
|
if (dict.hasOwnProperty(value)) {
|
|
7295
|
-
return {[postfixWithEndpointName('power_outage_memory', msg, model)]: dict[value]};
|
|
7290
|
+
return {[postfixWithEndpointName('power_outage_memory', msg, model, meta)]: dict[value]};
|
|
7296
7291
|
}
|
|
7297
7292
|
}
|
|
7298
7293
|
},
|
|
@@ -7308,7 +7303,7 @@ const converters = {
|
|
|
7308
7303
|
const value = msg.data[property];
|
|
7309
7304
|
|
|
7310
7305
|
if (dict.hasOwnProperty(value)) {
|
|
7311
|
-
return {[postfixWithEndpointName('indicator_mode', msg, model)]: dict[value]};
|
|
7306
|
+
return {[postfixWithEndpointName('indicator_mode', msg, model, meta)]: dict[value]};
|
|
7312
7307
|
}
|
|
7313
7308
|
}
|
|
7314
7309
|
},
|
|
@@ -7606,7 +7601,7 @@ const converters = {
|
|
|
7606
7601
|
options: [exposes.options.precision('temperature'), exposes.options.calibration('temperature')],
|
|
7607
7602
|
convert: (model, msg, publish, options, meta) => {
|
|
7608
7603
|
const temperature = parseFloat(msg.data['measuredValue']) / 100.0;
|
|
7609
|
-
const property = postfixWithEndpointName('local_temperature', msg, model);
|
|
7604
|
+
const property = postfixWithEndpointName('local_temperature', msg, model, meta);
|
|
7610
7605
|
return {[property]: calibrateAndPrecisionRoundOptions(temperature, options, 'temperature')};
|
|
7611
7606
|
},
|
|
7612
7607
|
},
|
|
@@ -8349,7 +8344,7 @@ const converters = {
|
|
|
8349
8344
|
if (msg.data[2] !== 71) return;
|
|
8350
8345
|
if (hasAlreadyProcessedMessage(msg)) return;
|
|
8351
8346
|
const movestop = 'stop';
|
|
8352
|
-
const action = postfixWithEndpointName(`hue_${movestop}`, msg, model);
|
|
8347
|
+
const action = postfixWithEndpointName(`hue_${movestop}`, msg, model, meta);
|
|
8353
8348
|
const payload = {action};
|
|
8354
8349
|
addActionGroup(payload, msg, model);
|
|
8355
8350
|
return payload;
|