Skip to content

Commit

Permalink
fix: Fixes for ELKO Super TR + ctm_thermostat (#7871)
Browse files Browse the repository at this point in the history
* fix: Revert changes to ctm_thermostat

* fix(ELKO 4523430): Use correct value for 'regulator_mode'
  • Loading branch information
chdefrene authored Aug 19, 2024
1 parent 99defa3 commit d37d7a3
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
41 changes: 41 additions & 0 deletions src/devices/ctm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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';
Expand All @@ -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;
Expand All @@ -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';
Expand Down
4 changes: 2 additions & 2 deletions src/devices/elko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit d37d7a3

Please sign in to comment.