This commit is contained in:
Paul
2020-03-04 19:19:10 +01:00
parent 98a41db973
commit 8874543a75
3 changed files with 31 additions and 18 deletions

View File

@@ -113,7 +113,7 @@ static const command_t project_cmds[] PROGMEM = {
{false, "queue", "show current Tx queue"}, {false, "queue", "show current Tx queue"},
{false, "send XX ...", "send raw telegram data to EMS bus (XX are hex values)"}, {false, "send XX ...", "send raw telegram data to EMS bus (XX are hex values)"},
{false, "thermostat read <type ID>", "send read request to the thermostat for heating circuit hc 1-4"}, {false, "thermostat read <type ID>", "send read request to the thermostat for heating circuit hc 1-4"},
{false, "thermostat temp <hc> <degrees> [temp]", "set current thermostat temperature. temp=0-6 (see wiki)"}, {false, "thermostat temp <degrees> [mode] [hc]", "set current thermostat temperature. mode=0-6 (see wiki), hc=1-4"},
{false, "thermostat mode <hc> <mode>", "set mode (0=off, 1=manual, 2=auto) for heating circuit hc 1-4"}, {false, "thermostat mode <hc> <mode>", "set mode (0=off, 1=manual, 2=auto) for heating circuit hc 1-4"},
{false, "boiler read <type ID>", "send read request to boiler"}, {false, "boiler read <type ID>", "send read request to boiler"},
{false, "boiler wwtemp <degrees>", "set boiler warm water temperature"}, {false, "boiler wwtemp <degrees>", "set boiler warm water temperature"},
@@ -1602,20 +1602,24 @@ void TelnetCommandCallback(uint8_t wc, const char * commandLine) {
} }
// thermostat commands // thermostat commands
// thermostat temp <tempvalue> <modevalue> <heatingcircuit>
if ((strcmp(first_cmd, "thermostat") == 0) && (wc >= 3)) { if ((strcmp(first_cmd, "thermostat") == 0) && (wc >= 3)) {
char * second_cmd = _readWord(); char * second_cmd = _readWord();
if (strcmp(second_cmd, "temp") == 0) { if (strcmp(second_cmd, "temp") == 0) {
uint8_t hc = _readIntNumber(); // next parameter is the heating circuit
float temp = _readFloatNumber(); // read in next param which is the temp float temp = _readFloatNumber(); // read in next param which is the temp
if (wc == 5) {
// we have a temp mode given if (wc == 3) {
_THERMOSTAT_TEMP_MODE temp_mode = (_THERMOSTAT_TEMP_MODE)_readIntNumber(); // next parameter is the temp mode type // no more params
ems_setThermostatTemp(temp, hc, temp_mode); ems_setThermostatTemp(temp, EMS_THERMOSTAT_DEFAULTHC);
} else {
ems_setThermostatTemp(temp, hc);
}
ok = true; ok = true;
} else {
// get modevalue and heatingcircuit
_THERMOSTAT_TEMP_MODE temp_mode = (_THERMOSTAT_TEMP_MODE)_readIntNumber(); // next parameter is the temp mode type
uint8_t hc = _readIntNumber(); // next parameter is the heating circuit
ems_setThermostatTemp(temp, hc, temp_mode);
ok = true;
}
} else if (strcmp(second_cmd, "mode") == 0) { } else if (strcmp(second_cmd, "mode") == 0) {
uint8_t hc = _readIntNumber(); // next parameter is the heating circuit uint8_t hc = _readIntNumber(); // next parameter is the heating circuit
ems_setThermostatMode(_readIntNumber(), hc); ems_setThermostatMode(_readIntNumber(), hc);

View File

@@ -266,8 +266,9 @@ bool ems_getHeatPumpEnabled() {
return (EMS_HeatPump.device_id != EMS_ID_NONE); return (EMS_HeatPump.device_id != EMS_ID_NONE);
} }
// thermostat has already the 7th bit (to indicate write) stripped
uint8_t ems_getThermostatFlags() { uint8_t ems_getThermostatFlags() {
return (EMS_Thermostat.device_flags & 0x7F); // strip 7th bit which is used to show whether Write is supported return (EMS_Thermostat.device_flags);
} }
uint8_t ems_getSolarModuleFlags() { uint8_t ems_getSolarModuleFlags() {
@@ -1840,6 +1841,15 @@ void _process_Version(_EMS_RxTelegram * EMS_RxTelegram) {
brand = 0; // unknown brand = 0; // unknown
} }
/*
// override to emulate other thermostats - FR100
if (device_id == 0x17) {
brand = 2;
device_id = 0x10;
product_id = 107;
}
*/
// first scan through matching boilers, as these are unique to DeviceID 0x08 // first scan through matching boilers, as these are unique to DeviceID 0x08
uint8_t i = 0; uint8_t i = 0;
while (i < _EMS_Devices_max) { while (i < _EMS_Devices_max) {
@@ -2451,16 +2461,14 @@ void ems_setThermostatTemp(float temperature, uint8_t hc_num, _THERMOSTAT_TEMP_M
EMS_TxTelegram.type_validate = EMS_TxTelegram.type; EMS_TxTelegram.type_validate = EMS_TxTelegram.type;
} }
else if (model == EMS_DEVICE_FLAG_JUNKERS) { else if (model & EMS_DEVICE_FLAG_JUNKERS) {
EMS_TxTelegram.emsplus = true; // Assuming here that all Junkers use EMS+ EMS_TxTelegram.emsplus = true; // Assuming here that all Junkers use EMS+
// figure out if we have older or new thermostats // figure out if we have older or new thermostats
// Heating Circuits on 0x65 or 0x79 (see https://github.com/proddy/EMS-ESP/issues/335#issuecomment-593324716) // Heating Circuits on 0x65 (EMS_DEVICE_FLAG_JUNKERS_CONFIG1) or 0x79 (EMS_DEVICE_FLAG_JUNKERS_CONFIG2)
// strip 7th (write) and 6th (junkers) bits to leave EMS_DEVICE_FLAG_JUNKERS_CONFIG1 or CONFIG2 // see https://github.com/proddy/EMS-ESP/issues/335#issuecomment-593324716)
bool newer_junkers = ((model & 0x3F) == EMS_DEVICE_FLAG_JUNKERS_CONFIG1); if ((model & 0x3F) == EMS_DEVICE_FLAG_JUNKERS_CONFIG1) {
// EMS_DEVICE_FLAG_JUNKERS_CONFIG1 - new models like the FW series
if (newer_junkers) {
// new models like the FW series
switch (temptype) { switch (temptype) {
case THERMOSTAT_TEMP_MODE_NOFROST: case THERMOSTAT_TEMP_MODE_NOFROST:
EMS_TxTelegram.offset = EMS_OFFSET_JunkersSetMessage_no_frost_temp; EMS_TxTelegram.offset = EMS_OFFSET_JunkersSetMessage_no_frost_temp;
@@ -2483,6 +2491,7 @@ void ems_setThermostatTemp(float temperature, uint8_t hc_num, _THERMOSTAT_TEMP_M
EMS_TxTelegram.type = EMS_TYPE_JunkersSetMessage1_HC1 + hc_num - 1; // 0x65 EMS_TxTelegram.type = EMS_TYPE_JunkersSetMessage1_HC1 + hc_num - 1; // 0x65
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_JunkersStatusMessage_HC1 + hc_num - 1; EMS_TxTelegram.comparisonPostRead = EMS_TYPE_JunkersStatusMessage_HC1 + hc_num - 1;
} else { } else {
// EMS_DEVICE_FLAG_JUNKERS_CONFIG2
switch (temptype) { switch (temptype) {
case THERMOSTAT_TEMP_MODE_NOFROST: case THERMOSTAT_TEMP_MODE_NOFROST:
EMS_TxTelegram.offset = EMS_OFFSET_JunkersSetMessage2_no_frost_temp; EMS_TxTelegram.offset = EMS_OFFSET_JunkersSetMessage2_no_frost_temp;

View File

@@ -1 +1 @@
#define APP_VERSION "1.9.5b48" #define APP_VERSION "1.9.5b49"