From 1388dd81bbfdb417cad928f63f57f5f1e4f03467 Mon Sep 17 00:00:00 2001 From: Christian De Frene Date: Sun, 15 Dec 2024 23:29:24 +0100 Subject: [PATCH] fix(ELKO): Resolve order of magnitude issue with floor_temp Fixes the following issues: * https://github.com/Koenkk/zigbee2mqtt/issues/25022 * https://github.com/Koenkk/zigbee2mqtt/issues/25112 --- src/converters/fromZigbee.ts | 11 +++++------ src/devices/elko.ts | 1 + 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/converters/fromZigbee.ts b/src/converters/fromZigbee.ts index 4191e45f72e5a..242ead060f0cd 100644 --- a/src/converters/fromZigbee.ts +++ b/src/converters/fromZigbee.ts @@ -1924,16 +1924,15 @@ const converters1 = { const result = converters1.thermostat.convert(model, msg, publish, options, meta) as KeyValue; const data = msg.data; if (data.localTemp !== undefined) { - const value = precisionRound(msg.data['localTemp'], 2) / 100; + let value = precisionRound(msg.data['localTemp'], 2) / 100; const valuesFloorSensor = ['floor', 'supervisor_floor']; const sensorType = meta.state.sensor as string; const floorTemperature = meta.state.floor_temp as number; if (valuesFloorSensor.includes(sensorType) && options.local_temperature_based_on_sensor) { - result[postfixWithEndpointName('local_temperature', msg, model, meta)] = floorTemperature / 100; - } else { - if (value >= -273.15) { - result[postfixWithEndpointName('local_temperature', msg, model, meta)] = value; - } + value = floorTemperature; + } + if (value >= -273.15) { + result[postfixWithEndpointName('local_temperature', msg, model, meta)] = value; } } if (data.elkoDisplayText !== undefined) { diff --git a/src/devices/elko.ts b/src/devices/elko.ts index d6dbbdcbbb169..515c763be4a9d 100644 --- a/src/devices/elko.ts +++ b/src/devices/elko.ts @@ -104,6 +104,7 @@ const definitions: DefinitionWithExtend[] = [ access: 'STATE_GET', unit: '°C', reporting: {min: 0, max: constants.repInterval.HOUR, change: 10}, + scale: 100, }), numeric({ name: 'max_floor_temp',