zigbee-herdsman-converters 14.0.662 → 14.0.663

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.
@@ -21,6 +21,9 @@ module.exports = [
21
21
  const endpoint = device.getEndpoint(1);
22
22
  await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
23
23
  await reporting.onOff(endpoint);
24
+ // Has Unknown power source, force it here.
25
+ device.powerSource = 'Mains (single phase)';
26
+ device.save();
24
27
  },
25
28
  },
26
29
  {
@@ -3,9 +3,24 @@ const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/lega
3
3
  const tz = require('../converters/toZigbee');
4
4
  const reporting = require('../lib/reporting');
5
5
  const extend = require('../lib/extend');
6
+ const utils = require('../lib/utils');
6
7
  const e = exposes.presets;
7
8
  const ea = exposes.access;
8
9
 
10
+ const fzLocal = {
11
+ on_off_via_brightness: {
12
+ cluster: 'genLevelCtrl',
13
+ type: ['attributeReport', 'readResponse'],
14
+ convert: (model, msg, publish, options, meta) => {
15
+ if (msg.data.hasOwnProperty('currentLevel')) {
16
+ const currentLevel = Number(msg.data['currentLevel']);
17
+ const property = utils.postfixWithEndpointName('state', msg, model, meta);
18
+ return {[property]: currentLevel > 0 ? 'ON' : 'OFF'};
19
+ }
20
+ },
21
+ },
22
+ };
23
+
9
24
  module.exports = [
10
25
  {
11
26
  zigbeeModel: ['DL15S'],
@@ -91,21 +106,24 @@ module.exports = [
91
106
  model: 'ZS057-D0Z',
92
107
  vendor: 'Leviton',
93
108
  description: 'Wall switch, 0-10V dimmer, 120-277V, Lumina™ RF',
109
+ meta: {disableDefaultResponse: true},
94
110
  extend: extend.light_onoff_brightness({disableEffect: true, noConfigure: true}),
95
- fromZigbee: [fz.brightness, fz.identify, fz.lighting_ballast_configuration, fz.level_config],
96
- toZigbee: [tz.light_onoff_brightness, tz.ballast_config, tz.level_config],
111
+ fromZigbee: [fz.on_off, fzLocal.on_off_via_brightness, fz.lighting_ballast_configuration],
112
+ toZigbee: [tz.light_onoff_brightness, tz.ballast_config],
97
113
  exposes: [e.light_brightness(),
114
+ // Note: ballast_power_on_level used to be here, but it does't appear to work properly with this device
115
+ // If set, it's reset back to 0 when the device is turned off then back to 32 when turned on
98
116
  exposes.numeric('ballast_minimum_level', ea.ALL).withValueMin(1).withValueMax(254)
99
117
  .withDescription('Specifies the minimum brightness value'),
100
118
  exposes.numeric('ballast_maximum_level', ea.ALL).withValueMin(1).withValueMax(254)
101
- .withDescription('Specifies the maximum brightness value'),
102
- exposes.numeric('ballast_power_on_level', ea.ALL).withValueMin(1).withValueMax(254)
103
- .withDescription('Specifies the initialisation light level. Can not be set lower than "ballast_minimum_level"')],
119
+ .withDescription('Specifies the maximum brightness value')],
104
120
  configure: async (device, coordinatorEndpoint, logger) => {
105
- await extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
106
121
  const endpoint = device.getEndpoint(1);
107
122
  await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl', 'lightingBallastCfg']);
108
- await reporting.onOff(endpoint);
123
+ // This device doesn't reliably report state changes - make it chatty to compensate for that
124
+ // This feels like a hack - hopefully there is a better fix at some point
125
+ await reporting.onOff(endpoint, {max: 5});
126
+ await reporting.brightness(endpoint, {max: 5});
109
127
  },
110
128
  },
111
129
  ];
@@ -5,7 +5,51 @@ const reporting = require('../lib/reporting');
5
5
  const e = exposes.presets;
6
6
  const constants = require('../lib/constants');
7
7
 
8
+ const fzLocal = {
9
+ power: {
10
+ cluster: 'hvacThermostat',
11
+ type: ['attributeReport', 'readResponse'],
12
+ convert: (model, msg, publish, options, meta) => {
13
+ if (msg.data.hasOwnProperty('16392')) {
14
+ return {power: msg.data['16392']};
15
+ }
16
+ },
17
+ },
18
+ energy: {
19
+ cluster: 'hvacThermostat',
20
+ type: ['attributeReport', 'readResponse'],
21
+ convert: (model, msg, publish, options, meta) => {
22
+ if (msg.data.hasOwnProperty('16393')) {
23
+ return {energy: parseFloat(msg.data['16393']) / 1000};
24
+ }
25
+ },
26
+ },
27
+ };
28
+
8
29
  module.exports = [
30
+ {
31
+ zigbeeModel: ['HT402'],
32
+ model: 'HT402',
33
+ vendor: 'Stelpro',
34
+ description: 'Hilo thermostat',
35
+ fromZigbee: [fz.stelpro_thermostat, fz.hvac_user_interface, fzLocal.power, fzLocal.energy],
36
+ toZigbee: [tz.thermostat_local_temperature, tz.thermostat_occupancy, tz.thermostat_occupied_heating_setpoint,
37
+ tz.thermostat_temperature_display_mode, tz.thermostat_keypad_lockout, tz.thermostat_system_mode,
38
+ tz.thermostat_running_state, tz.stelpro_thermostat_outdoor_temperature],
39
+ exposes: [e.local_temperature(), e.keypad_lockout(), e.power(), e.energy(),
40
+ exposes.climate().withSetpoint('occupied_heating_setpoint', 5, 30, 0.5).withLocalTemperature()
41
+ .withSystemMode(['heat']).withRunningState(['idle', 'heat'])],
42
+ configure: async (device, coordinatorEndpoint, logger) => {
43
+ const endpoint = device.getEndpoint(25);
44
+ const binds = ['genBasic', 'genIdentify', 'genGroups', 'hvacThermostat', 'hvacUserInterfaceCfg', 'msTemperatureMeasurement'];
45
+ await reporting.bind(endpoint, coordinatorEndpoint, binds);
46
+ await reporting.thermostatTemperature(endpoint);
47
+ await reporting.thermostatOccupiedHeatingSetpoint(endpoint);
48
+ await reporting.thermostatSystemMode(endpoint);
49
+ await reporting.thermostatPIHeatingDemand(endpoint);
50
+ await reporting.thermostatKeypadLockMode(endpoint);
51
+ },
52
+ },
9
53
  {
10
54
  zigbeeModel: ['ST218'],
11
55
  model: 'ST218',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "14.0.662",
3
+ "version": "14.0.663",
4
4
  "description": "Collection of device converters to be used with zigbee-herdsman",
5
5
  "main": "index.js",
6
6
  "files": [