zigbee-herdsman-converters 15.0.19 → 15.0.20
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 +24 -3
- package/devices/philips.js +56 -0
- package/lib/exposes.js +1 -0
- package/package.json +1 -1
package/converters/fromZigbee.js
CHANGED
|
@@ -794,37 +794,58 @@ const converters = {
|
|
|
794
794
|
on_off: {
|
|
795
795
|
cluster: 'genOnOff',
|
|
796
796
|
type: ['attributeReport', 'readResponse'],
|
|
797
|
+
options: [exposes.options.state_action()],
|
|
797
798
|
convert: (model, msg, publish, options, meta) => {
|
|
798
799
|
if (msg.data.hasOwnProperty('onOff')) {
|
|
800
|
+
const payload = {};
|
|
799
801
|
const property = postfixWithEndpointName('state', msg, model, meta);
|
|
800
|
-
|
|
802
|
+
const state = msg.data['onOff'] === 1 ? 'ON' : 'OFF';
|
|
803
|
+
payload[property] = state;
|
|
804
|
+
if (options && options.state_action) {
|
|
805
|
+
payload['action'] = postfixWithEndpointName(state.toLowerCase(), msg, model, meta);
|
|
806
|
+
}
|
|
807
|
+
return payload;
|
|
801
808
|
}
|
|
802
809
|
},
|
|
803
810
|
},
|
|
804
811
|
on_off_force_multiendpoint: {
|
|
805
812
|
cluster: 'genOnOff',
|
|
806
813
|
type: ['attributeReport', 'readResponse'],
|
|
814
|
+
options: [exposes.options.state_action()],
|
|
807
815
|
convert: (model, msg, publish, options, meta) => {
|
|
808
816
|
// This converted is need instead of `fz.on_off` when no meta: {multiEndpoint: true} can be defined for this device
|
|
809
817
|
// but it is needed for the `state`. E.g. when a switch has 3 channels (state_l1, state_l2, state_l3) but
|
|
810
818
|
// has combined power measurements (power, energy))
|
|
811
819
|
if (msg.data.hasOwnProperty('onOff')) {
|
|
820
|
+
const payload = {};
|
|
812
821
|
const endpointName = model.hasOwnProperty('endpoint') ?
|
|
813
822
|
utils.getKey(model.endpoint(meta.device), msg.endpoint.ID) : msg.endpoint.ID;
|
|
814
|
-
|
|
823
|
+
const state = msg.data['onOff'] === 1 ? 'ON' : 'OFF';
|
|
824
|
+
payload[`state_${endpointName}`] = state;
|
|
825
|
+
if (options && options.state_action) {
|
|
826
|
+
payload['action'] = `${state.toLowerCase()}_${endpointName}`;
|
|
827
|
+
}
|
|
828
|
+
return payload;
|
|
815
829
|
}
|
|
816
830
|
},
|
|
817
831
|
},
|
|
818
832
|
on_off_skip_duplicate_transaction: {
|
|
819
833
|
cluster: 'genOnOff',
|
|
820
834
|
type: ['attributeReport', 'readResponse'],
|
|
835
|
+
options: [exposes.options.state_action()],
|
|
821
836
|
convert: (model, msg, publish, options, meta) => {
|
|
822
837
|
// Device sends multiple messages with the same transactionSequenceNumber,
|
|
823
838
|
// prevent that multiple messages get send.
|
|
824
839
|
// https://github.com/Koenkk/zigbee2mqtt/issues/3687
|
|
825
840
|
if (msg.data.hasOwnProperty('onOff') && !hasAlreadyProcessedMessage(msg, model)) {
|
|
841
|
+
const payload = {};
|
|
826
842
|
const property = postfixWithEndpointName('state', msg, model, meta);
|
|
827
|
-
|
|
843
|
+
const state = msg.data['onOff'] === 1 ? 'ON' : 'OFF';
|
|
844
|
+
payload[property] = state;
|
|
845
|
+
if (options && options.state_action) {
|
|
846
|
+
payload['action'] = postfixWithEndpointName(state.toLowerCase(), msg, model, meta);
|
|
847
|
+
}
|
|
848
|
+
return payload;
|
|
828
849
|
}
|
|
829
850
|
},
|
|
830
851
|
},
|
package/devices/philips.js
CHANGED
|
@@ -1458,6 +1458,13 @@ module.exports = [
|
|
|
1458
1458
|
description: 'Hue white ambiance E26 with Bluetooth',
|
|
1459
1459
|
extend: hueExtend.light_onoff_brightness_colortemp(),
|
|
1460
1460
|
},
|
|
1461
|
+
{
|
|
1462
|
+
zigbeeModel: ['LTO003'],
|
|
1463
|
+
model: '9290024782',
|
|
1464
|
+
vendor: 'Philips',
|
|
1465
|
+
description: 'Hue G125 B22 White Ambiance filament bulb',
|
|
1466
|
+
extend: hueExtend.light_onoff_brightness(),
|
|
1467
|
+
},
|
|
1461
1468
|
{
|
|
1462
1469
|
zigbeeModel: ['LTW010', 'LTW001', 'LTW004'],
|
|
1463
1470
|
model: '8718696548738',
|
|
@@ -3021,6 +3028,13 @@ module.exports = [
|
|
|
3021
3028
|
description: 'Hue White Ambiance E27 filament screw globe',
|
|
3022
3029
|
extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [222, 454]}),
|
|
3023
3030
|
},
|
|
3031
|
+
{
|
|
3032
|
+
zigbeeModel: ['LTA006'],
|
|
3033
|
+
model: '8719514301443',
|
|
3034
|
+
vendor: 'Philips',
|
|
3035
|
+
description: 'Hue White Ambiance B22 filament screw globe',
|
|
3036
|
+
extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [222, 454]}),
|
|
3037
|
+
},
|
|
3024
3038
|
{
|
|
3025
3039
|
zigbeeModel: ['LWE006'],
|
|
3026
3040
|
model: '929002294102',
|
|
@@ -3309,4 +3323,46 @@ module.exports = [
|
|
|
3309
3323
|
description: 'Hue white ambiance extra bright high lumen dimmable LED smart retrofit recessed 6" downlight',
|
|
3310
3324
|
extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 500]}),
|
|
3311
3325
|
},
|
|
3326
|
+
{
|
|
3327
|
+
zigbeeModel: ['929003115901'],
|
|
3328
|
+
model: '929003117101',
|
|
3329
|
+
vendor: 'Philips',
|
|
3330
|
+
description: 'Hue Perifo Ceiling Light, 3 pendant (black)',
|
|
3331
|
+
extend: hueExtend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
|
|
3332
|
+
},
|
|
3333
|
+
{
|
|
3334
|
+
zigbeeModel: ['929003117201'],
|
|
3335
|
+
model: '929003117201',
|
|
3336
|
+
vendor: 'Philips',
|
|
3337
|
+
description: 'Hue Perifo Ceiling Light, 3 pendant (white)',
|
|
3338
|
+
extend: hueExtend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
|
|
3339
|
+
},
|
|
3340
|
+
{
|
|
3341
|
+
zigbeeModel: ['929003117301'],
|
|
3342
|
+
model: '929003117301',
|
|
3343
|
+
vendor: 'Philips',
|
|
3344
|
+
description: 'Hue Perifo Ceiling Light, 4 spotlights (black)',
|
|
3345
|
+
extend: hueExtend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
|
|
3346
|
+
},
|
|
3347
|
+
{
|
|
3348
|
+
zigbeeModel: ['929003117401'],
|
|
3349
|
+
model: '929003117401',
|
|
3350
|
+
vendor: 'Philips',
|
|
3351
|
+
description: 'Hue Perifo Ceiling Light, 4 spotlights (white)',
|
|
3352
|
+
extend: hueExtend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
|
|
3353
|
+
},
|
|
3354
|
+
{
|
|
3355
|
+
zigbeeModel: ['929003117701'],
|
|
3356
|
+
model: '929003117701',
|
|
3357
|
+
vendor: 'Philips',
|
|
3358
|
+
description: 'Hue Perifo Wall Light, 3 spotlights (black)',
|
|
3359
|
+
extend: hueExtend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
|
|
3360
|
+
},
|
|
3361
|
+
{
|
|
3362
|
+
zigbeeModel: ['929003117801'],
|
|
3363
|
+
model: '929003117801',
|
|
3364
|
+
vendor: 'Philips',
|
|
3365
|
+
description: 'Hue Perifo Wall Light, 3 spotlights (white)',
|
|
3366
|
+
extend: hueExtend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
|
|
3367
|
+
},
|
|
3312
3368
|
];
|
package/lib/exposes.js
CHANGED
|
@@ -521,6 +521,7 @@ module.exports = {
|
|
|
521
521
|
legacy: () => new Binary(`legacy`, access.SET, true, false).withDescription(`Set to false to disable the legacy integration (highly recommended), will change structure of the published payload (default true).`),
|
|
522
522
|
measurement_poll_interval: (extraNote='') => new Numeric(`measurement_poll_interval`, access.SET).withValueMin(-1).withDescription(`This device does not support reporting electric measurements so it is polled instead. The default poll interval is 60 seconds, set to -1 to disable.${extraNote}`),
|
|
523
523
|
illuminance_below_threshold_check: () => new Binary(`illuminance_below_threshold_check`, access.SET, true, false).withDescription(`Set to false to also send messages when illuminance is above threshold in night mode (default true).`),
|
|
524
|
+
state_action: () => new Binary(`state_action`, access.SET, true, false).withDescription(`State actions will also be published as 'action' when true (default false).`),
|
|
524
525
|
},
|
|
525
526
|
presets: {
|
|
526
527
|
ac_frequency: () => new Numeric('ac_frequency', access.STATE).withUnit('Hz').withDescription('Measured electrical AC frequency'),
|