Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix window_open switch for Bosch Thermostats. #1

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/devices/bosch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,12 +384,12 @@ const tzLocal = {
},
} satisfies Tz.Converter,
bosch_thermostat: {
key: ['window_open', 'boost', 'system_mode', 'pi_heating_demand', 'remote_temperature', 'valve_adapt_process'],
key: ['window_detection', 'boost', 'system_mode', 'pi_heating_demand', 'remote_temperature', 'valve_adapt_process'],
convertSet: async (entity, key, value, meta) => {
if (key === 'window_open') {
if (key === 'window_detection') {
const index = utils.getFromLookup(value, stateOffOn);
await entity.write('hvacThermostat', {0x4042: {value: index, type: Zcl.DataType.enum8}}, manufacturerOptions);
return {state: {window_open: value}};
return {state: {window_detection: value}};
}
if (key === 'boost') {
const index = utils.getFromLookup(value, stateOffOn);
Expand Down Expand Up @@ -447,7 +447,7 @@ const tzLocal = {
},
convertGet: async (entity, key, meta) => {
switch (key) {
case 'window_open':
case 'window_detection':
await entity.read('hvacThermostat', [0x4042], manufacturerOptions);
break;
case 'boost':
Expand Down Expand Up @@ -699,7 +699,7 @@ const fzLocal = {
result.remote_temperature = utils.precisionRound(data[0x4040] / 100, 1);
}
if (data.hasOwnProperty(0x4042)) {
result.window_open = (Object.keys(stateOffOn)[data[0x4042]]);
result.window_detection = (Object.keys(stateOffOn)[data[0x4042]]);
}
if (data.hasOwnProperty(0x4043)) {
result.boost = (Object.keys(stateOffOn)[data[0x4043]]);
Expand Down Expand Up @@ -1056,7 +1056,7 @@ const definitions: Definition[] = [
.withRunningState(['idle', 'heat'], ea.STATE),
e.binary('boost', ea.ALL, 'ON', 'OFF')
.withDescription('Activate boost heating'),
e.binary('window_open', ea.ALL, 'ON', 'OFF')
e.binary('window_detection', ea.ALL, 'ON', 'OFF')
.withDescription('Window open'),
e.enum('display_orientation', ea.ALL, Object.keys(displayOrientation))
.withDescription('Display orientation')
Expand Down Expand Up @@ -1131,7 +1131,7 @@ const definitions: Definition[] = [
maximumReportInterval: constants.repInterval.HOUR * 12,
reportableChange: null,
}], manufacturerOptions);
// report window_open
// report window_detection
await endpoint.configureReporting('hvacThermostat', [{
attribute: {ID: 0x4042, type: Zcl.DataType.enum8},
minimumReportInterval: 0,
Expand Down Expand Up @@ -1171,7 +1171,7 @@ const definitions: Definition[] = [
.withRunningState(['idle', 'heat'], ea.STATE_GET),
e.humidity(),
e.binary('boost', ea.ALL, 'ON', 'OFF').withDescription('Activate Boost heating'),
e.binary('window_open', ea.ALL, 'ON', 'OFF').withDescription('Window open'),
e.binary('window_detection', ea.ALL, 'ON', 'OFF').withDescription('Window open'),
e.child_lock().setAccess('state', ea.ALL),
e.numeric('display_ontime', ea.ALL).withValueMin(5).withValueMax(30).withDescription('Specifies the display On-time'),
e.numeric('display_brightness', ea.ALL).withValueMin(0).withValueMax(10).withDescription('Specifies the brightness value of the display'),
Expand All @@ -1192,7 +1192,7 @@ const definitions: Definition[] = [
maximumReportInterval: constants.repInterval.HOUR,
reportableChange: 1,
}], manufacturerOptions);
// report window_open
// report window_detection
await endpoint.configureReporting('hvacThermostat', [{
attribute: {ID: 0x4042, type: Zcl.DataType.enum8},
minimumReportInterval: 0,
Expand Down Expand Up @@ -1230,7 +1230,7 @@ const definitions: Definition[] = [
.withRunningState(['idle', 'heat'], ea.STATE_GET),
e.humidity(),
e.binary('boost', ea.ALL, 'ON', 'OFF').withDescription('Activate Boost heating'),
e.binary('window_open', ea.ALL, 'ON', 'OFF').withDescription('Window open'),
e.binary('window_detection', ea.ALL, 'ON', 'OFF').withDescription('Window open'),
e.child_lock().setAccess('state', ea.ALL),
e.numeric('display_ontime', ea.ALL).withValueMin(5).withValueMax(30).withDescription('Specifies the display On-time'),
e.numeric('display_brightness', ea.ALL).withValueMin(0).withValueMax(10).withDescription('Specifies the brightness value of the display'),
Expand All @@ -1257,7 +1257,7 @@ const definitions: Definition[] = [
maximumReportInterval: constants.repInterval.HOUR,
reportableChange: 1,
}], manufacturerOptions);
// report window_open
// report window_detection
await endpoint.configureReporting('hvacThermostat', [{
attribute: {ID: 0x4042, type: Zcl.DataType.enum8},
minimumReportInterval: 0,
Expand Down