From 6cd0d83b47ae2e193031c6217c87d8e0fc62a015 Mon Sep 17 00:00:00 2001 From: Chrischi- Date: Sat, 5 Jan 2019 21:41:22 +0100 Subject: [PATCH 01/17] added Bitron Wall Thermostat --- devices.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/devices.js b/devices.js index 2cc6e0bfb5d7d..b730b7dbb12b0 100644 --- a/devices.js +++ b/devices.js @@ -1596,7 +1596,33 @@ const devices = [ return {'left': 12, 'right': 11}; }, }, + { + zigbeeModel: ['902010/32'], + model: 'AV2010/32', + vendor: 'Bitron Home', + description: 'Wall thermostat with relay', + supports: 'temperature, heating/cooling system control', + fromZigbee: [ + fz.bitron_bitron_battery, fz.bitron_thermostat_att_report, + fz.bitron_thermostat_dev_change, fz.ignore_power_change, + ], + toZigbee: [tz.thermostat_occupied_heating_setpoint, tz.thermostat_local_temperature_calibration], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.bind('hvacThermostat', coordinator, cb), + (cb) => device.report('hvacThermostat', 'localTemp', 300, 3600, 0, cb), + (cb) => device.report('hvacThermostat', 'runningState', 1, 0, 0, cb), + (cb) => device.report('hvacThermostat', 'occupiedHeatingSetpoint', 1, 0, 1, cb), + (cb) => device.report('genPowerCfg', 'batteryVoltage', 1800, 43200, 0, cb), + (cb) => device.report('genPowerCfg', 'batteryAlarmState', 1, 0, 1, cb), + ]; + execute(device, actions, callback); + }, + }, + // Gledopto { zigbeeModel: ['GLEDOPTO', 'GL-C-008', 'GL-C-007'], From d76c0ac2ee5671fe05722b9ae3c598e6b6dcb682 Mon Sep 17 00:00:00 2001 From: Chrischi- Date: Sat, 5 Jan 2019 21:43:50 +0100 Subject: [PATCH 02/17] added Bitron fromZigbee convertes bitron_battery (should be usefull for all bitron battery powered devices) bitron_thermostat_att_report bitron_thermostat_dev_change --- converters/fromZigbee.js | 66 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index be7f523a96b22..1448037e5d7ed 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -158,6 +158,72 @@ const converters = { return {occupancy: true}; }, }, + bitron_battery: { + cid: 'genPowerCfg', + type: 'attReport', + convert: (model, msg, publish, options) => { + const battery = {max: 3200, min: 2500}; + const voltage = msg.data.data['batteryVoltage'] * 100; + return { + battery: toPercentage(voltage, battery.min, battery.max), + voltage: voltage, + }; + }, + }, + bitron_thermostat_att_report: { + cid: 'hvacThermostat', + type: 'attReport', + convert: (model, msg, publish, options) => { + const deviceID = msg.endpoints[0].device.ieeeAddr; + if (!store[deviceID]) { + store[deviceID] = {localTemp: null}; + store[deviceID] = {occupiedHeatingSetpoint: null}; + store[deviceID] = {runningState: null}; + } + if (typeof msg.data.data.localTemp == 'number') { + store[deviceID].localTemp = msg.data.data.localTemp; + } + if ( typeof msg.data.data.occupiedHeatingSetpoint == 'number') { + store[deviceID].occupiedHeatingSetpoint = msg.data.data.occupiedHeatingSetpoint; + } + if (typeof msg.data.data.runningState == 'number') { + store[deviceID].runningState = msg.data.data.runningState; + } + return { + localTemp: precisionRound(store[deviceID].localTemp, 2)/100, + occupiedHeatingSetpoint: precisionRound(store[deviceID].occupiedHeatingSetpoint, 2)/100, + runningState: store[deviceID].runningState === 1 ? 'ON' : 'OFF', + batteryAlarmState: msg.data.data.batteryAlarmState === 1 ? 'ON' : 'OFF', + }; + }, + }, + bitron_thermostat_dev_change: { + cid: 'hvacThermostat', + type: 'devChange', + convert: (model, msg, publish, options) => { + const deviceID = msg.endpoints[0].device.ieeeAddr; + if (!store[deviceID]) { + store[deviceID] = {localTemp: null}; + store[deviceID] = {occupiedHeatingSetpoint: null}; + store[deviceID] = {runningState: null}; + } + if (typeof msg.data.data.localTemp == 'number') { + store[deviceID].localTemp = msg.data.data.localTemp; + } + if (typeof msg.data.data.occupiedHeatingSetpoint == 'number') { + store[deviceID].occupiedHeatingSetpoint = msg.data.data.occupiedHeatingSetpoint; + } + if (typeof msg.data.data.runningState == 'number') { + store[deviceID].runningState = msg.data.data.runningState; + } + return { + localTemp: precisionRound(store[deviceID].localTemp, 2)/100, + occupiedHeatingSetpoint: precisionRound(store[deviceID].occupiedHeatingSetpoint, 2)/100, + runningState: store[deviceID].runningState === 1 ? 'ON' : 'OFF', + batteryAlarmState: msg.data.data.batteryAlarmState === 1 ? 'ON' : 'OFF', + }; + }, + }, smartthings_contact: { cid: 'ssIasZone', type: 'statusChange', From e2830ef6ac0510e92b87e9ac0f198326c5725f50 Mon Sep 17 00:00:00 2001 From: Chrischi- Date: Sat, 5 Jan 2019 21:55:49 +0100 Subject: [PATCH 03/17] Update fromZigbee.js --- converters/fromZigbee.js | 48 +++++++++------------------------------- 1 file changed, 10 insertions(+), 38 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 1448037e5d7ed..6a042cf786526 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -174,26 +174,12 @@ const converters = { cid: 'hvacThermostat', type: 'attReport', convert: (model, msg, publish, options) => { - const deviceID = msg.endpoints[0].device.ieeeAddr; - if (!store[deviceID]) { - store[deviceID] = {localTemp: null}; - store[deviceID] = {occupiedHeatingSetpoint: null}; - store[deviceID] = {runningState: null}; - } - if (typeof msg.data.data.localTemp == 'number') { - store[deviceID].localTemp = msg.data.data.localTemp; - } - if ( typeof msg.data.data.occupiedHeatingSetpoint == 'number') { - store[deviceID].occupiedHeatingSetpoint = msg.data.data.occupiedHeatingSetpoint; - } - if (typeof msg.data.data.runningState == 'number') { - store[deviceID].runningState = msg.data.data.runningState; - } return { - localTemp: precisionRound(store[deviceID].localTemp, 2)/100, - occupiedHeatingSetpoint: precisionRound(store[deviceID].occupiedHeatingSetpoint, 2)/100, - runningState: store[deviceID].runningState === 1 ? 'ON' : 'OFF', - batteryAlarmState: msg.data.data.batteryAlarmState === 1 ? 'ON' : 'OFF', + local_temperature: precisionRound(msg.data.data['localTemp'], 2) / 100, + local_temperature_calibration: precisionRound(msg.data.data['localTemperatureCalibration'], 2) / 10, + occupied_heating_setpoint: precisionRound(msg.data.data['occupiedHeatingSetpoint'], 2) / 100, + running_state: msg.data.data['runningState'] === 1 ? 'ON' : 'OFF', + battery_alarm_state: msg.data.data['batteryAlarmState'] === 1 ? 'ON' : 'OFF', }; }, }, @@ -201,26 +187,12 @@ const converters = { cid: 'hvacThermostat', type: 'devChange', convert: (model, msg, publish, options) => { - const deviceID = msg.endpoints[0].device.ieeeAddr; - if (!store[deviceID]) { - store[deviceID] = {localTemp: null}; - store[deviceID] = {occupiedHeatingSetpoint: null}; - store[deviceID] = {runningState: null}; - } - if (typeof msg.data.data.localTemp == 'number') { - store[deviceID].localTemp = msg.data.data.localTemp; - } - if (typeof msg.data.data.occupiedHeatingSetpoint == 'number') { - store[deviceID].occupiedHeatingSetpoint = msg.data.data.occupiedHeatingSetpoint; - } - if (typeof msg.data.data.runningState == 'number') { - store[deviceID].runningState = msg.data.data.runningState; - } return { - localTemp: precisionRound(store[deviceID].localTemp, 2)/100, - occupiedHeatingSetpoint: precisionRound(store[deviceID].occupiedHeatingSetpoint, 2)/100, - runningState: store[deviceID].runningState === 1 ? 'ON' : 'OFF', - batteryAlarmState: msg.data.data.batteryAlarmState === 1 ? 'ON' : 'OFF', + local_temperature: precisionRound(msg.data.data['localTemp'], 2) / 100, + local_temperature_calibration: precisionRound(msg.data.data['localTemperatureCalibration'], 2) / 10, + occupied_heating_setpoint: precisionRound(msg.data.data['occupiedHeatingSetpoint'], 2) / 100, + running_state: msg.data.data['runningState'] === 1 ? 'ON' : 'OFF', + battery_alarm_state: msg.data.data['batteryAlarmState'] === 1 ? 'ON' : 'OFF', }; }, }, From 0221b7c0481e1db813ff3cf4a94c87794933549d Mon Sep 17 00:00:00 2001 From: Chrischi- Date: Sat, 5 Jan 2019 22:10:52 +0100 Subject: [PATCH 04/17] Update devices.js --- devices.js | 1 + 1 file changed, 1 insertion(+) diff --git a/devices.js b/devices.js index b730b7dbb12b0..52c5db94e449b 100644 --- a/devices.js +++ b/devices.js @@ -1613,6 +1613,7 @@ const devices = [ (cb) => device.bind('genPowerCfg', coordinator, cb), (cb) => device.bind('hvacThermostat', coordinator, cb), (cb) => device.report('hvacThermostat', 'localTemp', 300, 3600, 0, cb), + (cb) => device.report('hvacThermostat', 'local_temperature_calibration', 1, 0, 1, cb), (cb) => device.report('hvacThermostat', 'runningState', 1, 0, 0, cb), (cb) => device.report('hvacThermostat', 'occupiedHeatingSetpoint', 1, 0, 1, cb), (cb) => device.report('genPowerCfg', 'batteryVoltage', 1800, 43200, 0, cb), From 4dbb45c2308e38192c88671055f4bbfa5f4f4ffb Mon Sep 17 00:00:00 2001 From: Chrischi- Date: Sat, 5 Jan 2019 22:17:30 +0100 Subject: [PATCH 05/17] Update devices.js --- devices.js | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/devices.js b/devices.js index 52c5db94e449b..a7cbf4bb4cad4 100644 --- a/devices.js +++ b/devices.js @@ -1596,33 +1596,6 @@ const devices = [ return {'left': 12, 'right': 11}; }, }, - { - zigbeeModel: ['902010/32'], - model: 'AV2010/32', - vendor: 'Bitron Home', - description: 'Wall thermostat with relay', - supports: 'temperature, heating/cooling system control', - fromZigbee: [ - fz.bitron_bitron_battery, fz.bitron_thermostat_att_report, - fz.bitron_thermostat_dev_change, fz.ignore_power_change, - ], - toZigbee: [tz.thermostat_occupied_heating_setpoint, tz.thermostat_local_temperature_calibration], - configure: (ieeeAddr, shepherd, coordinator, callback) => { - const device = shepherd.find(ieeeAddr, 1); - const actions = [ - (cb) => device.bind('genPowerCfg', coordinator, cb), - (cb) => device.bind('hvacThermostat', coordinator, cb), - (cb) => device.report('hvacThermostat', 'localTemp', 300, 3600, 0, cb), - (cb) => device.report('hvacThermostat', 'local_temperature_calibration', 1, 0, 1, cb), - (cb) => device.report('hvacThermostat', 'runningState', 1, 0, 0, cb), - (cb) => device.report('hvacThermostat', 'occupiedHeatingSetpoint', 1, 0, 1, cb), - (cb) => device.report('genPowerCfg', 'batteryVoltage', 1800, 43200, 0, cb), - (cb) => device.report('genPowerCfg', 'batteryAlarmState', 1, 0, 1, cb), - ]; - - execute(device, actions, callback); - }, - }, // Gledopto { @@ -1889,6 +1862,33 @@ const devices = [ execute(device, actions, callback); }, }, + { + zigbeeModel: ['902010/32'], + model: 'AV2010/32', + vendor: 'Bitron Home', + description: 'Wall thermostat with relay', + supports: 'temperature, heating/cooling system control', + fromZigbee: [ + fz.bitron_bitron_battery, fz.bitron_thermostat_att_report, + fz.bitron_thermostat_dev_change, fz.ignore_power_change, + ], + toZigbee: [tz.thermostat_occupied_heating_setpoint, tz.thermostat_local_temperature_calibration], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.bind('hvacThermostat', coordinator, cb), + (cb) => device.report('hvacThermostat', 'localTemp', 300, 3600, 0, cb), + (cb) => device.report('hvacThermostat', 'local_temperature_calibration', 1, 0, 0, cb), + (cb) => device.report('hvacThermostat', 'runningState', 1, 0, 0, cb), + (cb) => device.report('hvacThermostat', 'occupiedHeatingSetpoint', 1, 0, 1, cb), + (cb) => device.report('genPowerCfg', 'batteryVoltage', 1800, 43200, 0, cb), + (cb) => device.report('genPowerCfg', 'batteryAlarmState', 1, 0, 1, cb), + ]; + + execute(device, actions, callback); + }, + }, // Iris { From 3651404b48fb3612aea621293942373626cfa0b8 Mon Sep 17 00:00:00 2001 From: Chrischi- Date: Sun, 6 Jan 2019 14:13:20 +0100 Subject: [PATCH 06/17] Update devices.js --- devices.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/devices.js b/devices.js index a7cbf4bb4cad4..896e1c85acb5a 100644 --- a/devices.js +++ b/devices.js @@ -1865,23 +1865,31 @@ const devices = [ { zigbeeModel: ['902010/32'], model: 'AV2010/32', - vendor: 'Bitron Home', + vendor: 'Bitron', description: 'Wall thermostat with relay', supports: 'temperature, heating/cooling system control', fromZigbee: [ - fz.bitron_bitron_battery, fz.bitron_thermostat_att_report, - fz.bitron_thermostat_dev_change, fz.ignore_power_change, + fz.ignore_basic_change, fz.bitron_thermostat_att_report, + fz.bitron_thermostat_dev_change, fz.bitron_battery, + ], + toZigbee: [ + tz.thermostat_occupied_heating_setpoint, tz.thermostat_local_temperature_calibration, + tz.thermostat_local_temperature, ], - toZigbee: [tz.thermostat_occupied_heating_setpoint, tz.thermostat_local_temperature_calibration], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); const actions = [ + (cb) => device.bind('genBasic', coordinator, cb), (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.bind('genIdentify', coordinator, cb), + (cb) => device.bind('genTime', coordinator, cb), + (cb) => device.bind('genPollCtrl', coordinator, cb), (cb) => device.bind('hvacThermostat', coordinator, cb), + (cb) => device.bind('hvacUserInterfaceCfg', coordinator, cb), (cb) => device.report('hvacThermostat', 'localTemp', 300, 3600, 0, cb), - (cb) => device.report('hvacThermostat', 'local_temperature_calibration', 1, 0, 0, cb), - (cb) => device.report('hvacThermostat', 'runningState', 1, 0, 0, cb), + (cb) => device.report('hvacThermostat', 'localTemperatureCalibration', 1, 0, 0, cb), (cb) => device.report('hvacThermostat', 'occupiedHeatingSetpoint', 1, 0, 1, cb), + (cb) => device.report('hvacThermostat', 'runningState', 1, 0, 0, cb), (cb) => device.report('genPowerCfg', 'batteryVoltage', 1800, 43200, 0, cb), (cb) => device.report('genPowerCfg', 'batteryAlarmState', 1, 0, 1, cb), ]; From 846ac95638c39b3d353de60c48ef37ef92507f39 Mon Sep 17 00:00:00 2001 From: Chrischi- Date: Sun, 6 Jan 2019 14:15:21 +0100 Subject: [PATCH 07/17] Update fromZigbee.js --- converters/fromZigbee.js | 44 +++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 6a042cf786526..1ab7d9fa27ce5 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -174,26 +174,42 @@ const converters = { cid: 'hvacThermostat', type: 'attReport', convert: (model, msg, publish, options) => { - return { - local_temperature: precisionRound(msg.data.data['localTemp'], 2) / 100, - local_temperature_calibration: precisionRound(msg.data.data['localTemperatureCalibration'], 2) / 10, - occupied_heating_setpoint: precisionRound(msg.data.data['occupiedHeatingSetpoint'], 2) / 100, - running_state: msg.data.data['runningState'] === 1 ? 'ON' : 'OFF', - battery_alarm_state: msg.data.data['batteryAlarmState'] === 1 ? 'ON' : 'OFF', - }; + if (typeof msg.data.data['localTemp'] == 'number') { + return {local_temperature: precisionRound(msg.data.data['localTemp'], 2) / 100}; + } + if (typeof msg.data.data['localTemperatureCalibration'] == 'number') { + return {local_temperature_calibration: precisionRound(msg.data.data['localTemperatureCalibration'], 2) / 10}; + } + if (typeof msg.data.data['occupiedHeatingSetpoint'] == 'number') { + return {occupied_heating_setpoint: precisionRound(msg.data.data['occupiedHeatingSetpoint'], 2) / 100}; + } + if (typeof msg.data.data['runningState'] == 'number') { + return {running_state: msg.data.data['runningState']}; + } + if (typeof msg.data.data['batteryAlarmState'] == 'number') { + return {battery_alarm_state: msg.data.data['batteryAlarmState']}; + } }, }, bitron_thermostat_dev_change: { cid: 'hvacThermostat', type: 'devChange', convert: (model, msg, publish, options) => { - return { - local_temperature: precisionRound(msg.data.data['localTemp'], 2) / 100, - local_temperature_calibration: precisionRound(msg.data.data['localTemperatureCalibration'], 2) / 10, - occupied_heating_setpoint: precisionRound(msg.data.data['occupiedHeatingSetpoint'], 2) / 100, - running_state: msg.data.data['runningState'] === 1 ? 'ON' : 'OFF', - battery_alarm_state: msg.data.data['batteryAlarmState'] === 1 ? 'ON' : 'OFF', - }; + if (typeof msg.data.data['localTemp'] == 'number') { + return {local_temperature: precisionRound(msg.data.data['localTemp'], 2) / 100}; + } + if (typeof msg.data.data['localTemperatureCalibration'] == 'number') { + return {local_temperature_calibration: precisionRound(msg.data.data['localTemperatureCalibration'], 2) / 10}; + } + if (typeof msg.data.data['occupiedHeatingSetpoint'] == 'number') { + return {occupied_heating_setpoint: precisionRound(msg.data.data['occupiedHeatingSetpoint'], 2) / 100}; + } + if (typeof msg.data.data['runningState'] == 'number') { + return {running_state: msg.data.data['runningState']}; + } + if (typeof msg.data.data['batteryAlarmState'] == 'number') { + return {battery_alarm_state: msg.data.data['batteryAlarmState']}; + } }, }, smartthings_contact: { From 2a879987f3ae97f5dd61a1cebdd34fdd0a17e21d Mon Sep 17 00:00:00 2001 From: Chrischi- Date: Sun, 6 Jan 2019 14:28:25 +0100 Subject: [PATCH 08/17] Update toZigbee.js i changed the calculation of the input values so that you can also set half degrees. before: 21.3 -> 21.0 21.4 -> 21.0 21.5 -> 22.0 now: 21.3 -> 21.5 21.4 -> 21.5 21.5 -> 21.5 --- converters/toZigbee.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 1aff14ac99195..227e97b618d50 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -305,7 +305,7 @@ const converters = { zclData: [{ attrId: zclId.attr(cid, attrId).value, dataType: zclId.attrType(cid, attrId).value, - attrData: Math.round(value) * 100, + attrData: (Math.round((value * 2).toFixed(1))/2).toFixed(1) * 100, }], cfg: cfg.default, }; @@ -333,7 +333,7 @@ const converters = { zclData: [{ attrId: zclId.attr(cid, attrId).value, dataType: zclId.attrType(cid, attrId).value, - attrData: Math.round(value) * 100, // TODO: Lookup in Zigbee documentation + attrData: (Math.round((value * 2).toFixed(1))/2).toFixed(1) * 100, }], cfg: cfg.default, }; From 64583c075bfee9bba202eae850d6790688dbf5f1 Mon Sep 17 00:00:00 2001 From: Chrischi- Date: Sun, 6 Jan 2019 15:47:06 +0100 Subject: [PATCH 09/17] Update fromZigbee.js --- converters/fromZigbee.js | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 1ab7d9fa27ce5..20feff474918e 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -174,42 +174,58 @@ const converters = { cid: 'hvacThermostat', type: 'attReport', convert: (model, msg, publish, options) => { + const result = {}; + if (typeof msg.data.data['localTemp'] == 'number') { - return {local_temperature: precisionRound(msg.data.data['localTemp'], 2) / 100}; + result.local_temperature = precisionRound(msg.data.data['localTemp'], 2) / 100; } + if (typeof msg.data.data['localTemperatureCalibration'] == 'number') { - return {local_temperature_calibration: precisionRound(msg.data.data['localTemperatureCalibration'], 2) / 10}; + result.local_temperature_calibration = precisionRound(msg.data.data['localTemperatureCalibration'], 2) / 10; } + if (typeof msg.data.data['occupiedHeatingSetpoint'] == 'number') { - return {occupied_heating_setpoint: precisionRound(msg.data.data['occupiedHeatingSetpoint'], 2) / 100}; + result.occupied_heating_setpoint = precisionRound(msg.data.data['occupiedHeatingSetpoint'], 2) / 100; } + if (typeof msg.data.data['runningState'] == 'number') { - return {running_state: msg.data.data['runningState']}; - } + result.running_state = msg.data.data['runningState']; + } + if (typeof msg.data.data['batteryAlarmState'] == 'number') { - return {battery_alarm_state: msg.data.data['batteryAlarmState']}; + result.battery_alarm_state = msg.data.data['batteryAlarmState']; } + + return result; }, }, bitron_thermostat_dev_change: { cid: 'hvacThermostat', type: 'devChange', convert: (model, msg, publish, options) => { + const result = {}; + if (typeof msg.data.data['localTemp'] == 'number') { - return {local_temperature: precisionRound(msg.data.data['localTemp'], 2) / 100}; + result.local_temperature = precisionRound(msg.data.data['localTemp'], 2) / 100; } + if (typeof msg.data.data['localTemperatureCalibration'] == 'number') { - return {local_temperature_calibration: precisionRound(msg.data.data['localTemperatureCalibration'], 2) / 10}; + result.local_temperature_calibration = precisionRound(msg.data.data['localTemperatureCalibration'], 2) / 10; } + if (typeof msg.data.data['occupiedHeatingSetpoint'] == 'number') { - return {occupied_heating_setpoint: precisionRound(msg.data.data['occupiedHeatingSetpoint'], 2) / 100}; + result.occupied_heating_setpoint = precisionRound(msg.data.data['occupiedHeatingSetpoint'], 2) / 100; } + if (typeof msg.data.data['runningState'] == 'number') { - return {running_state: msg.data.data['runningState']}; - } + result.running_state = msg.data.data['runningState']; + } + if (typeof msg.data.data['batteryAlarmState'] == 'number') { - return {battery_alarm_state: msg.data.data['batteryAlarmState']}; + result.battery_alarm_state = msg.data.data['batteryAlarmState']; } + + return result; }, }, smartthings_contact: { From f382798200060e69728ee581fc27f3d6ab91850e Mon Sep 17 00:00:00 2001 From: Chrischi- Date: Sun, 6 Jan 2019 15:49:18 +0100 Subject: [PATCH 10/17] added temperature_display_mode + running_state --- converters/toZigbee.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 227e97b618d50..2fe3d0084e955 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -573,6 +573,44 @@ const converters = { }; }, }, + thermostat_running_state: { + key: 'running_state', + convert: (key, value, message, type) => { + const cid = 'hvacThermostat'; + const attrId = 'runningState'; + if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{attrId: zclId.attr(cid, attrId).value}], + cfg: cfg.default, + }; + } + }, + }, + thermostat_temperature_display_mode: { + key: 'temperature_display_mode', + convert: (key, value, message, type) => { + const cid = 'hvacUserInterfaceCfg'; + const attrId = 'tempDisplayMode'; + if (type === 'set') { + return { + cid: cid, + cmd: 'write', + cmdType: 'foundation', + zclData: [{ + // 0x00 Temperature in °C + // 0x01 Temperature in °F + attrId: zclId.attr(cid, attrId).value, + dataType: zclId.attrType(cid, attrId).value, + attrData: value, + }], + cfg: cfg.default, + }; + } + }, + }, /* * Note when send the command to set sensitivity, press button on the device * to make it wakeup From d148861120a0f6af6348a5db65716c77494e6d2f Mon Sep 17 00:00:00 2001 From: Chrischi- Date: Sun, 6 Jan 2019 15:50:25 +0100 Subject: [PATCH 11/17] Update devices.js --- devices.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 896e1c85acb5a..ac61d04448724 100644 --- a/devices.js +++ b/devices.js @@ -1874,7 +1874,8 @@ const devices = [ ], toZigbee: [ tz.thermostat_occupied_heating_setpoint, tz.thermostat_local_temperature_calibration, - tz.thermostat_local_temperature, + tz.thermostat_local_temperature, tz.thermostat_running_state, + tz.thermostat_temperature_display_mode, ], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); From d0403a2c98f6a64dd4c4c6e355784ced4a810298 Mon Sep 17 00:00:00 2001 From: Chrischi- Date: Sun, 6 Jan 2019 16:16:54 +0100 Subject: [PATCH 12/17] Trailing spaces --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index ac61d04448724..c0b069087fbe3 100644 --- a/devices.js +++ b/devices.js @@ -1596,7 +1596,7 @@ const devices = [ return {'left': 12, 'right': 11}; }, }, - + // Gledopto { zigbeeModel: ['GLEDOPTO', 'GL-C-008', 'GL-C-007'], From 194a050714f55cf766ec033decdf0a18c850b25a Mon Sep 17 00:00:00 2001 From: Chrischi- Date: Sun, 6 Jan 2019 16:20:58 +0100 Subject: [PATCH 13/17] Update fromZigbee.js --- converters/fromZigbee.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 20feff474918e..069fe33704ad4 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -175,27 +175,21 @@ const converters = { type: 'attReport', convert: (model, msg, publish, options) => { const result = {}; - if (typeof msg.data.data['localTemp'] == 'number') { result.local_temperature = precisionRound(msg.data.data['localTemp'], 2) / 100; } - if (typeof msg.data.data['localTemperatureCalibration'] == 'number') { result.local_temperature_calibration = precisionRound(msg.data.data['localTemperatureCalibration'], 2) / 10; } - if (typeof msg.data.data['occupiedHeatingSetpoint'] == 'number') { result.occupied_heating_setpoint = precisionRound(msg.data.data['occupiedHeatingSetpoint'], 2) / 100; } - if (typeof msg.data.data['runningState'] == 'number') { result.running_state = msg.data.data['runningState']; } - if (typeof msg.data.data['batteryAlarmState'] == 'number') { result.battery_alarm_state = msg.data.data['batteryAlarmState']; } - return result; }, }, @@ -204,27 +198,21 @@ const converters = { type: 'devChange', convert: (model, msg, publish, options) => { const result = {}; - if (typeof msg.data.data['localTemp'] == 'number') { result.local_temperature = precisionRound(msg.data.data['localTemp'], 2) / 100; } - if (typeof msg.data.data['localTemperatureCalibration'] == 'number') { result.local_temperature_calibration = precisionRound(msg.data.data['localTemperatureCalibration'], 2) / 10; } - if (typeof msg.data.data['occupiedHeatingSetpoint'] == 'number') { result.occupied_heating_setpoint = precisionRound(msg.data.data['occupiedHeatingSetpoint'], 2) / 100; } - if (typeof msg.data.data['runningState'] == 'number') { result.running_state = msg.data.data['runningState']; } - if (typeof msg.data.data['batteryAlarmState'] == 'number') { result.battery_alarm_state = msg.data.data['batteryAlarmState']; - } - + } return result; }, }, From 52c560fdfe769993550c432181eb1c2b8eefac36 Mon Sep 17 00:00:00 2001 From: Chrischi- Date: Sun, 6 Jan 2019 16:26:13 +0100 Subject: [PATCH 14/17] Update fromZigbee.js --- converters/fromZigbee.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 069fe33704ad4..f4e97f68abd04 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -176,7 +176,7 @@ const converters = { convert: (model, msg, publish, options) => { const result = {}; if (typeof msg.data.data['localTemp'] == 'number') { - result.local_temperature = precisionRound(msg.data.data['localTemp'], 2) / 100; + result.local_temperature = precisionRound(msg.data.data['localTemp'], 2) / 100; } if (typeof msg.data.data['localTemperatureCalibration'] == 'number') { result.local_temperature_calibration = precisionRound(msg.data.data['localTemperatureCalibration'], 2) / 10; @@ -186,9 +186,9 @@ const converters = { } if (typeof msg.data.data['runningState'] == 'number') { result.running_state = msg.data.data['runningState']; - } + } if (typeof msg.data.data['batteryAlarmState'] == 'number') { - result.battery_alarm_state = msg.data.data['batteryAlarmState']; + result.battery_alarm_state = msg.data.data['batteryAlarmState']; } return result; }, @@ -199,7 +199,7 @@ const converters = { convert: (model, msg, publish, options) => { const result = {}; if (typeof msg.data.data['localTemp'] == 'number') { - result.local_temperature = precisionRound(msg.data.data['localTemp'], 2) / 100; + result.local_temperature = precisionRound(msg.data.data['localTemp'], 2) / 100; } if (typeof msg.data.data['localTemperatureCalibration'] == 'number') { result.local_temperature_calibration = precisionRound(msg.data.data['localTemperatureCalibration'], 2) / 10; @@ -209,10 +209,10 @@ const converters = { } if (typeof msg.data.data['runningState'] == 'number') { result.running_state = msg.data.data['runningState']; - } + } if (typeof msg.data.data['batteryAlarmState'] == 'number') { - result.battery_alarm_state = msg.data.data['batteryAlarmState']; - } + result.battery_alarm_state = msg.data.data['batteryAlarmState']; + } return result; }, }, From ad04a266a3e97520f8173a580f26652bf687a592 Mon Sep 17 00:00:00 2001 From: Chrischi- Date: Sun, 6 Jan 2019 16:58:08 +0100 Subject: [PATCH 15/17] Update fromZigbee.js --- converters/fromZigbee.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index f4e97f68abd04..2e141d653a086 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -179,10 +179,12 @@ const converters = { result.local_temperature = precisionRound(msg.data.data['localTemp'], 2) / 100; } if (typeof msg.data.data['localTemperatureCalibration'] == 'number') { - result.local_temperature_calibration = precisionRound(msg.data.data['localTemperatureCalibration'], 2) / 10; + result.local_temperature_calibration = + precisionRound(msg.data.data['localTemperatureCalibration'], 2) / 10; } if (typeof msg.data.data['occupiedHeatingSetpoint'] == 'number') { - result.occupied_heating_setpoint = precisionRound(msg.data.data['occupiedHeatingSetpoint'], 2) / 100; + result.occupied_heating_setpoint = + precisionRound(msg.data.data['occupiedHeatingSetpoint'], 2) / 100; } if (typeof msg.data.data['runningState'] == 'number') { result.running_state = msg.data.data['runningState']; @@ -202,10 +204,12 @@ const converters = { result.local_temperature = precisionRound(msg.data.data['localTemp'], 2) / 100; } if (typeof msg.data.data['localTemperatureCalibration'] == 'number') { - result.local_temperature_calibration = precisionRound(msg.data.data['localTemperatureCalibration'], 2) / 10; + result.local_temperature_calibration = + precisionRound(msg.data.data['localTemperatureCalibration'], 2) / 10; } if (typeof msg.data.data['occupiedHeatingSetpoint'] == 'number') { - result.occupied_heating_setpoint = precisionRound(msg.data.data['occupiedHeatingSetpoint'], 2) / 100; + result.occupied_heating_setpoint = + precisionRound(msg.data.data['occupiedHeatingSetpoint'], 2) / 100; } if (typeof msg.data.data['runningState'] == 'number') { result.running_state = msg.data.data['runningState']; From 926d688943dc70f438dd754e100ec3073ba99fca Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 8 Jan 2019 18:27:24 +0100 Subject: [PATCH 16/17] Update devices.js --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index c0b069087fbe3..753ef6ecca1d8 100644 --- a/devices.js +++ b/devices.js @@ -1866,7 +1866,7 @@ const devices = [ zigbeeModel: ['902010/32'], model: 'AV2010/32', vendor: 'Bitron', - description: 'Wall thermostat with relay', + description: 'Video wireless wall thermostat with relay', supports: 'temperature, heating/cooling system control', fromZigbee: [ fz.ignore_basic_change, fz.bitron_thermostat_att_report, From 33335b47859998fa3cd1ad6172a8a906a92b4408 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 8 Jan 2019 18:33:50 +0100 Subject: [PATCH 17/17] Update devices.js --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 753ef6ecca1d8..880c48d7b1bb4 100644 --- a/devices.js +++ b/devices.js @@ -1866,7 +1866,7 @@ const devices = [ zigbeeModel: ['902010/32'], model: 'AV2010/32', vendor: 'Bitron', - description: 'Video wireless wall thermostat with relay', + description: 'Wireless wall thermostat with relay', supports: 'temperature, heating/cooling system control', fromZigbee: [ fz.ignore_basic_change, fz.bitron_thermostat_att_report,