From d37d7a3e53b5ac99e27937e401a2d268c5cc450a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20De=20Fr=C3=A8ne?= Date: Mon, 19 Aug 2024 20:49:00 +0200 Subject: [PATCH] fix: Fixes for ELKO Super TR + ctm_thermostat (#7871) * fix: Revert changes to ctm_thermostat * fix(ELKO 4523430): Use correct value for 'regulator_mode' --- src/devices/ctm.ts | 41 +++++++++++++++++++++++++++++++++++++++++ src/devices/elko.ts | 4 ++-- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/src/devices/ctm.ts b/src/devices/ctm.ts index 8cc2649db8299..4c1d21c02dfaf 100644 --- a/src/devices/ctm.ts +++ b/src/devices/ctm.ts @@ -102,6 +102,10 @@ const fzLocal = { // Load result.load = data[0x0401]; } + if (data.hasOwnProperty('elkoLoad')) { + // Load + result.load = data['elkoLoad']; + } if (data.hasOwnProperty(0x0402)) { // Display text result.display_text = data[0x0402]; @@ -123,10 +127,27 @@ const fzLocal = { }; result.sensor = utils.getFromLookup(data[0x0403], sensorModeLookup); } + if (data.hasOwnProperty('elkoSensor')) { + // Sensor + const sensorModeLookup = { + 0: 'air', + 1: 'floor', + 2: 'external', + 3: 'regulator', + 4: 'mv_air', + 5: 'mv_external', + 6: 'mv_regulator', + }; + result.sensor = utils.getFromLookup(data['elkoSensor'], sensorModeLookup); + } if (data.hasOwnProperty(0x0405)) { // Regulator mode result.regulator_mode = data[0x0405] ? 'regulator' : 'thermostat'; } + if (data.hasOwnProperty('elkoRegulatorMode')) { + // Regulator mode + result.regulator_mode = data['elkoRegulatorMode'] ? 'regulator' : 'thermostat'; + } if (data.hasOwnProperty(0x0406)) { // Power status result.power_status = data[0x0406] ? 'ON' : 'OFF'; @@ -139,6 +160,10 @@ const fzLocal = { // Mean power result.mean_power = data[0x0408]; } + if (data.hasOwnProperty('elkoMeanPower')) { + // Mean power + result.mean_power = data['elkoMeanPower']; + } if (data.hasOwnProperty(0x0409)) { // Floor temp result.floor_temp = utils.precisionRound(data[0x0409], 2) / 100; @@ -151,18 +176,34 @@ const fzLocal = { // Night switching result.night_switching = data[0x0411] ? 'ON' : 'OFF'; } + if (data.hasOwnProperty('elkoNightSwitching')) { + // Night switching + result.night_switching = data['elkoNightSwitching'] ? 'ON' : 'OFF'; + } if (data.hasOwnProperty(0x0412)) { // Frost guard result.frost_guard = data[0x0412] ? 'ON' : 'OFF'; } + if (data.hasOwnProperty('elkoFrostGuard')) { + // Frost guard + result.frost_guard = data['elkoFrostGuard'] ? 'ON' : 'OFF'; + } if (data.hasOwnProperty(0x0413)) { // Child lock result.child_lock = data[0x0413] ? 'LOCK' : 'UNLOCK'; } + if (data.hasOwnProperty('elkoChildLock')) { + // Child lock + result.child_lock = data['elkoChildLock'] ? 'LOCK' : 'UNLOCK'; + } if (data.hasOwnProperty(0x0414)) { // Max floor temp result.max_floor_temp = data[0x0414]; } + if (data.hasOwnProperty('elkoMaxFloorTemp')) { + // Max floor temp + result.max_floor_temp = data['elkoMaxFloorTemp']; + } if (data.hasOwnProperty(0x0415)) { // Running_state result.running_state = data[0x0415] ? 'heat' : 'idle'; diff --git a/src/devices/elko.ts b/src/devices/elko.ts index c007dedb8b7e5..eb1971f5650b1 100644 --- a/src/devices/elko.ts +++ b/src/devices/elko.ts @@ -64,8 +64,8 @@ const definitions: Definition[] = [ description: 'Device in regulator or thermostat mode.', access: 'ALL', reporting: {attribute: 'elkoRegulatorMode', min: 0, max: constants.repInterval.HOUR, change: null}, - valueOn: ['regulator', 0], - valueOff: ['thermostat', 1], + valueOn: ['regulator', 1], + valueOff: ['thermostat', 0], }), numeric({ name: 'regulator_time',