Skip to content

Commit

Permalink
feat: SNZB-02D: add support for comfort levels and temperature units. (
Browse files Browse the repository at this point in the history
  • Loading branch information
photomoose authored Jan 27, 2025
1 parent 809bb75 commit 1fc8d0e
Showing 1 changed file with 74 additions and 1 deletion.
75 changes: 74 additions & 1 deletion src/devices/sonoff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,80 @@ const definitions: DefinitionWithExtend[] = [
model: 'SNZB-02D',
vendor: 'SONOFF',
description: 'Temperature and humidity sensor with screen',
extend: [m.battery(), m.temperature(), m.humidity(), m.bindCluster({cluster: 'genPollCtrl', clusterType: 'input'})],
extend: [
m.deviceAddCustomCluster('customSonoffSnzb02d', {
ID: 0xfc11,
attributes: {
comfortTemperatureMax: {ID: 0x0003, type: Zcl.DataType.INT16},
comfortTemperatureMin: {ID: 0x0004, type: Zcl.DataType.INT16},
comfortHumidityMin: {ID: 0x0005, type: Zcl.DataType.UINT16},
comfortHumidityMax: {ID: 0x0006, type: Zcl.DataType.UINT16},
temperatureUnits: {ID: 0x0007, type: Zcl.DataType.UINT16},
},
commands: {},
commandsResponse: {},
}),
m.battery(),
m.temperature(),
m.humidity(),
m.bindCluster({cluster: 'genPollCtrl', clusterType: 'input'}),
m.numeric({
name: 'comfort_temperature_min',
cluster: 'customSonoffSnzb02d',
attribute: 'comfortTemperatureMin',
description:
'Minimum temperature that is considered comfortable. The device will display ❄️ when the temperature is lower than this value. Note: wake up the device by pressing the button on the back before changing this value.',
valueMin: -10,
valueMax: 60,
scale: 100,
valueStep: 0.1,
unit: '°C',
}),
m.numeric({
name: 'comfort_temperature_max',
cluster: 'customSonoffSnzb02d',
attribute: 'comfortTemperatureMax',
description:
'Maximum temperature that is considered comfortable. The device will display 🔥 when the temperature is higher than this value. Note: wake up the device by pressing the button on the back before changing this value.',
valueMin: -10,
valueMax: 60,
scale: 100,
valueStep: 0.1,
unit: '°C',
}),
m.numeric({
name: 'comfort_humidity_min',
cluster: 'customSonoffSnzb02d',
attribute: 'comfortHumidityMin',
description:
'Minimum relative humidity that is considered comfortable. The device will display ☀️ when the humidity is lower than this value. Note: wake up the device by pressing the button on the back before changing this value.',
valueMin: 5,
valueMax: 95,
scale: 100,
valueStep: 0.1,
unit: '%',
}),
m.numeric({
name: 'comfort_humidity_max',
cluster: 'customSonoffSnzb02d',
attribute: 'comfortHumidityMax',
description:
'Maximum relative humidity that is considered comfortable. The device will display 💧 when the humidity is higher than this value. Note: wake up the device by pressing the button on the back before changing this value.',
valueMin: 5,
valueMax: 95,
scale: 100,
valueStep: 0.1,
unit: '%',
}),
m.enumLookup({
name: 'temperature_units',
lookup: {Celsius: 0, Fahrenheit: 1},
cluster: 'customSonoffSnzb02d',
attribute: 'temperatureUnits',
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.',
}),
],
},
{
fingerprint: [
Expand Down

0 comments on commit 1fc8d0e

Please sign in to comment.