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

Setting system mode for Eurotronic thermostat #682

Merged
merged 5 commits into from Oct 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions converters/fromZigbee.js
Expand Up @@ -1931,6 +1931,7 @@ const converters = {
const result = {};
if (typeof msg.data['localTemp'] == 'number') {
result.local_temperature = precisionRound(msg.data['localTemp'], 2) / 100;
result.local_temperature = calibrateAndPrecisionRoundOptions(result.local_temperature, options, 'temperature')
}
if (typeof msg.data['localTemperatureCalibration'] == 'number') {
result.local_temperature_calibration =
Expand Down Expand Up @@ -1999,6 +2000,13 @@ const converters = {
}
if (typeof msg.data[0x4008] == 'number') {
result.eurotronic_system_mode = msg.data[0x4008];
if ((result.eurotronic_system_mode & 1 << 2) != 0) {
result.system_mode = common.thermostatSystemModes[1]; // boost => auto
} else if ((result.eurotronic_system_mode & (1 << 4)) != 0 ) {
result.system_mode = common.thermostatSystemModes[0]; // off
} else {
result.system_mode = common.thermostatSystemModes[4]; // heat
}
}
if (typeof msg.data[0x4002] == 'number') {
result.eurotronic_error_status = msg.data[0x4002];
Expand Down
21 changes: 21 additions & 0 deletions converters/toZigbee.js
Expand Up @@ -728,6 +728,27 @@ const converters = {
}
},
},
eurotronic_thermostat_system_mode: {
key: 'system_mode',
convertSet: async (entity, key, value, meta) => {
const systemMode = utils.getKeyByValue(common.thermostatSystemModes, value, value);
switch (systemMode) {
case 0:
value |= 1 << 5; // off
break;
case 1:
value |= 1 << 2; // boost
break;
default:
value |= 1 << 4 // heat
}
const payload = {0x4008: {value, type: 0x22}};
await entity.write('hvacThermostat', payload, options.eurotronic);
},
convertGet: async (entity, key, meta) => {
await entity.read('hvacThermostat', ['systemMode']);
},
},
eurotronic_system_mode: {
key: 'eurotronic_system_mode',
convertSet: async (entity, key, value, meta) => {
Expand Down
13 changes: 10 additions & 3 deletions devices.js
Expand Up @@ -3983,22 +3983,29 @@ const devices = [
],
toZigbee: [
tz.thermostat_occupied_heating_setpoint, tz.thermostat_unoccupied_heating_setpoint,
tz.thermostat_local_temperature_calibration, tz.thermostat_system_mode,
tz.thermostat_local_temperature_calibration, tz.eurotronic_thermostat_system_mode,
tz.eurotronic_system_mode, tz.eurotronic_error_status, tz.thermostat_setpoint_raise_lower,
tz.thermostat_control_sequence_of_operation, tz.thermostat_remote_sensing,
tz.eurotronic_current_heating_setpoint, tz.eurotronic_trv_mode, tz.eurotronic_valve_position,
],
meta: {configureKey: 1},
meta: {configureKey: 2},
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(1);
const options = {manufacturerCode: 4151,}
await bind(endpoint, coordinatorEndpoint, ['genPowerCfg', 'hvacThermostat']);
await configureReporting.thermostatTemperature(endpoint);
await endpoint.configureReporting('hvacThermostat', [{
attribute: {ID: 0x4003, type: 41},
minimumReportInterval: 0,
maximumReportInterval: repInterval.HOUR,
reportableChange: 25,
}]);
}], options);
await endpoint.configureReporting('hvacThermostat', [{
attribute: {ID: 0x4008, type: 34},
minimumReportInterval: 0,
maximumReportInterval: repInterval.HOUR,
reportableChange: 1,
}], options);
},
},

Expand Down