From 1b9517dac7a044c27f8e6b65eb1334473b921727 Mon Sep 17 00:00:00 2001 From: Tom Davis Date: Mon, 27 Jan 2025 23:43:20 +0000 Subject: [PATCH] SNZB-02D: add support for temperature and humidity calibration --- src/devices/sonoff.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/devices/sonoff.ts b/src/devices/sonoff.ts index c8808faa996e9..4f69180c18561 100644 --- a/src/devices/sonoff.ts +++ b/src/devices/sonoff.ts @@ -862,6 +862,8 @@ const definitions: DefinitionWithExtend[] = [ comfortHumidityMin: {ID: 0x0005, type: Zcl.DataType.UINT16}, comfortHumidityMax: {ID: 0x0006, type: Zcl.DataType.UINT16}, temperatureUnits: {ID: 0x0007, type: Zcl.DataType.UINT16}, + temperatureCalibration: {ID: 0x2003, type: Zcl.DataType.INT16}, + humidityCalibration: {ID: 0x2004, type: Zcl.DataType.INT16}, }, commands: {}, commandsResponse: {}, @@ -926,6 +928,28 @@ const definitions: DefinitionWithExtend[] = [ description: 'The unit of the temperature displayed on the device screen. Note: wake up the device by pressing the button on the back before changing this value.', }), + m.numeric({ + name: 'temperature_calibration', + cluster: 'customSonoffSnzb02d', + attribute: 'temperatureCalibration', + description: 'Offset to add/subtract to the reported temperature', + valueMin: -50, + valueMax: 50, + scale: 100, + valueStep: 0.1, + unit: '°C', + }), + m.numeric({ + name: 'humidity_calibration', + cluster: 'customSonoffSnzb02d', + attribute: 'humidityCalibration', + description: 'Offset to add/subtract to the reported relative humidity', + valueMin: -50, + valueMax: 50, + scale: 100, + valueStep: 0.1, + unit: '%', + }), ], }, {