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

Added Eurotronic Spirit Zigbee thermostat #254

Merged
merged 9 commits into from
Feb 3, 2019
29 changes: 29 additions & 0 deletions converters/fromZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -1419,6 +1419,9 @@ const converters = {
if (typeof state == 'number' && common.thermostatRunningStates.hasOwnProperty(state)) {
result.running_state = common.thermostatRunningStates[state];
}
if (typeof msg.data.data['pIHeatingDemand'] == 'number') {
result.pi_heating_demand = msg.data.data['pIHeatingDemand'];
}
return result;
},
},
Expand Down Expand Up @@ -1476,6 +1479,27 @@ const converters = {
if (typeof state == 'number' && common.thermostatRunningStates.hasOwnProperty(state)) {
result.running_state = common.thermostatRunningStates[state];
}
if (typeof msg.data.data['pIHeatingDemand'] == 'number') {
result.pi_heating_demand = msg.data.data['pIHeatingDemand'];
}
return result;
},
},
eurotronic_thermostat_att_report: {
cid: 'hvacThermostat',
type: 'attReport',
convert: (model, msg, publish, options) => {
const result = {};
if (typeof msg.data.data[16387] == 'number') {
result.current_heating_setpoint =
precisionRound(msg.data.data[16387], 2) / 100;
}
if (typeof msg.data.data[16392] == 'number') {
result.eurotronic_system_mode = msg.data.data[16392];
}
if (typeof msg.data.data[16386] == 'number') {
result.eurotronic_16386 = msg.data.data[16386];
}
return result;
},
},
Expand Down Expand Up @@ -1677,6 +1701,11 @@ const converters = {
type: 'attReport',
convert: (model, msg, publish, options) => null,
},
ignore_thermostat_change: {
cid: 'hvacThermostat',
type: 'devChange',
convert: (model, msg, publish, options) => null,
},
};

module.exports = converters;
63 changes: 63 additions & 0 deletions converters/toZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ const cfg = {
disDefaultRsp: 1,
manufCode: 0x115F,
},
eurotronic: {
manufSpec: 1,
manufCode: 4151,
},
};

const converters = {
Expand Down Expand Up @@ -882,6 +886,65 @@ const converters = {
};
},
},
eurotronic_system_mode: {
key: 'eurotronic_system_mode',
convert: (key, value, message, type, postfix) => {
const cid = 'hvacThermostat';
const attrId = 16392;
if (type === 'set') {
return {
cid: cid,
cmd: 'write',
cmdType: 'foundation',
zclData: [{
// Bit 0 = ? (default 1)
// Bit 2 = Boost
// Bit 7 = Child protection
attrId: attrId,
dataType: 0x22,
attrData: value,
}],
cfg: cfg.eurotronic,
};
} else if (type === 'get') {
return {
cid: cid,
cmd: 'read',
cmdType: 'foundation',
zclData: [{attrId: attrId}],
cfg: cfg.eurotronic,
};
}
},
},
eurotronic_16386: {
key: 'eurotronic_16386',
convert: (key, value, message, type, postfix) => {
const cid = 'hvacThermostat';
const attrId = 16386;
if (type === 'set') {
return {
cid: cid,
cmd: 'write',
cmdType: 'foundation',
zclData: [{
attrId: attrId,
dataType: 0x20,
attrData: value,
}],
cfg: cfg.eurotronic,
};
} else if (type === 'get') {
return {
cid: cid,
cmd: 'read',
cmdType: 'foundation',
zclData: [{attrId: attrId}],
cfg: cfg.eurotronic,
};
}
},
},
livolo_switch_on_off: {
key: ['state'],
convert: (key, value, message, type, postfix) => {
Expand Down
32 changes: 32 additions & 0 deletions devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -2291,6 +2291,38 @@ const devices = [
},
},

// Eurotronic
{
zigbeeModel: ['SPZB0001'],
model: 'SPZB0001',
vendor: 'Eurotronic',
description: 'Spirit Zigbee wireless heater thermostat',
supports: 'temperature, heating system control',
fromZigbee: [
fz.thermostat_att_report, fz.eurotronic_thermostat_att_report,
fz.ignore_thermostat_change, fz.hue_battery, fz.ignore_power_change,
],
toZigbee: [
tz.thermostat_occupied_heating_setpoint, tz.thermostat_unoccupied_heating_setpoint,
tz.thermostat_local_temperature_calibration, tz.thermostat_system_mode,
tz.eurotronic_system_mode, tz.eurotronic_16386, tz.thermostat_setpoint_raise_lower,
tz.thermostat_control_sequence_of_operation, tz.thermostat_remote_sensing,
],
configure: (ieeeAddr, shepherd, coordinator, callback) => {
const device = shepherd.find(ieeeAddr, 1);
const actions = [
(cb) => device.bind('genPowerCfg', coordinator, cb),
(cb) => device.bind('hvacThermostat', coordinator, cb),
(cb) => device.report('hvacThermostat', 'localTemp', 1, 1200, 25, cb),
(cb) => device.foundation('hvacThermostat', 'configReport', [{
direction: 0, attrId: 16387, dataType: 41, minRepIntval: 0,
maxRepIntval: 600, repChange: 25}], {manufSpec: 1, manufCode: 4151}, cb),
];

execute(device, actions, callback);
},
},

// Livolo
{
zigbeeModel: ['TI0001 '],
Expand Down