diff --git a/.gitignore b/.gitignore index 559d0aabf..4c5ca7a42 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,6 @@ node_modules # project specfic scripts/stackdmp.txt firmware + +# firmware +*.bin diff --git a/.travis.yml b/.travis.yml index fc4d9ac79..f108c2321 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ os: linux language: python python: - - "2.7" + - "3.8" cache: directories: @@ -55,6 +55,7 @@ before_deploy: deploy: provider: releases edge: + source: wenkokke/dpl branch: master token: ${GITHUB_TOKEN} file_glob: true diff --git a/platformio.ini b/platformio.ini index 80fc57d1a..747006030 100644 --- a/platformio.ini +++ b/platformio.ini @@ -110,5 +110,5 @@ board = d1_mini build_type = release build_flags = ${common.build_flags} ${common.custom_flags} extra_scripts = - ;pre:scripts/pre_script.py + pre:scripts/pre_script.py scripts/main_script.py diff --git a/src/ems-esp.cpp b/src/ems-esp.cpp index 446274500..132f22a68 100644 --- a/src/ems-esp.cpp +++ b/src/ems-esp.cpp @@ -270,97 +270,101 @@ void showInfo() { } myDebug_P(PSTR("")); - myDebug_P(PSTR("%sBoiler stats:%s"), COLOR_BOLD_ON, COLOR_BOLD_OFF); - // version details - myDebug_P(PSTR(" Boiler: %s"), ems_getDeviceDescription(EMS_DEVICE_TYPE_BOILER, buffer_type)); + // show boiler stats if connected + if (ems_getBoilerEnabled()) { + myDebug_P(PSTR("%sBoiler stats:%s"), COLOR_BOLD_ON, COLOR_BOLD_OFF); - // active stats - if (ems_getBusConnected()) { - if (EMS_Boiler.tapwaterActive != EMS_VALUE_INT_NOTSET) { - myDebug_P(PSTR(" Hot tap water: %s"), EMS_Boiler.tapwaterActive ? "running" : "off"); + // version details + myDebug_P(PSTR(" Boiler: %s"), ems_getDeviceDescription(EMS_DEVICE_TYPE_BOILER, buffer_type)); + + // active stats + if (ems_getBusConnected()) { + if (EMS_Boiler.tapwaterActive != EMS_VALUE_INT_NOTSET) { + myDebug_P(PSTR(" Hot tap water: %s"), EMS_Boiler.tapwaterActive ? "running" : "off"); + } + + if (EMS_Boiler.heatingActive != EMS_VALUE_INT_NOTSET) { + myDebug_P(PSTR(" Central heating: %s"), EMS_Boiler.heatingActive ? "active" : "off"); + } } - if (EMS_Boiler.heatingActive != EMS_VALUE_INT_NOTSET) { - myDebug_P(PSTR(" Central heating: %s"), EMS_Boiler.heatingActive ? "active" : "off"); + // UBAParameterWW + _renderBoolValue("Warm Water activated", EMS_Boiler.wWActivated); + _renderBoolValue("Warm Water circulation pump available", EMS_Boiler.wWCircPump); + if (EMS_Boiler.wWComfort == EMS_VALUE_UBAParameterWW_wwComfort_Hot) { + myDebug_P(PSTR(" Warm Water comfort setting: Hot")); + } else if (EMS_Boiler.wWComfort == EMS_VALUE_UBAParameterWW_wwComfort_Eco) { + myDebug_P(PSTR(" Warm Water comfort setting: Eco")); + } else if (EMS_Boiler.wWComfort == EMS_VALUE_UBAParameterWW_wwComfort_Intelligent) { + myDebug_P(PSTR(" Warm Water comfort setting: Intelligent")); } - } - // UBAParameterWW - _renderBoolValue("Warm Water activated", EMS_Boiler.wWActivated); - _renderBoolValue("Warm Water circulation pump available", EMS_Boiler.wWCircPump); - if (EMS_Boiler.wWComfort == EMS_VALUE_UBAParameterWW_wwComfort_Hot) { - myDebug_P(PSTR(" Warm Water comfort setting: Hot")); - } else if (EMS_Boiler.wWComfort == EMS_VALUE_UBAParameterWW_wwComfort_Eco) { - myDebug_P(PSTR(" Warm Water comfort setting: Eco")); - } else if (EMS_Boiler.wWComfort == EMS_VALUE_UBAParameterWW_wwComfort_Intelligent) { - myDebug_P(PSTR(" Warm Water comfort setting: Intelligent")); - } + _renderIntValue("Warm Water selected temperature", "C", EMS_Boiler.wWSelTemp); + _renderIntValue("Warm Water desinfection temperature", "C", EMS_Boiler.wWDesinfectTemp); - _renderIntValue("Warm Water selected temperature", "C", EMS_Boiler.wWSelTemp); - _renderIntValue("Warm Water desinfection temperature", "C", EMS_Boiler.wWDesinfectTemp); + // UBAMonitorWWMessage + _renderUShortValue("Warm Water current temperature", "C", EMS_Boiler.wWCurTmp); + _renderIntValue("Warm Water current tap water flow", "l/min", EMS_Boiler.wWCurFlow, 10); + _renderLongValue("Warm Water # starts", "times", EMS_Boiler.wWStarts); + if (EMS_Boiler.wWWorkM != EMS_VALUE_LONG_NOTSET) { + myDebug_P(PSTR(" Warm Water active time: %d days %d hours %d minutes"), + EMS_Boiler.wWWorkM / 1440, + (EMS_Boiler.wWWorkM % 1440) / 60, + EMS_Boiler.wWWorkM % 60); + } + _renderBoolValue("Warm Water 3-way valve", EMS_Boiler.wWHeat); - // UBAMonitorWWMessage - _renderUShortValue("Warm Water current temperature", "C", EMS_Boiler.wWCurTmp); - _renderIntValue("Warm Water current tap water flow", "l/min", EMS_Boiler.wWCurFlow, 10); - _renderLongValue("Warm Water # starts", "times", EMS_Boiler.wWStarts); - if (EMS_Boiler.wWWorkM != EMS_VALUE_LONG_NOTSET) { - myDebug_P(PSTR(" Warm Water active time: %d days %d hours %d minutes"), - EMS_Boiler.wWWorkM / 1440, - (EMS_Boiler.wWWorkM % 1440) / 60, - EMS_Boiler.wWWorkM % 60); - } - _renderBoolValue("Warm Water 3-way valve", EMS_Boiler.wWHeat); + // UBAMonitorFast + _renderIntValue("Selected flow temperature", "C", EMS_Boiler.selFlowTemp); + _renderUShortValue("Current flow temperature", "C", EMS_Boiler.curFlowTemp); + _renderUShortValue("Return temperature", "C", EMS_Boiler.retTemp); + _renderBoolValue("Gas", EMS_Boiler.burnGas); + _renderBoolValue("Boiler pump", EMS_Boiler.heatPmp); + _renderBoolValue("Fan", EMS_Boiler.fanWork); + _renderBoolValue("Ignition", EMS_Boiler.ignWork); + _renderBoolValue("Circulation pump", EMS_Boiler.wWCirc); + _renderIntValue("Burner selected max power", "%", EMS_Boiler.selBurnPow); + _renderIntValue("Burner current power", "%", EMS_Boiler.curBurnPow); + _renderShortValue("Flame current", "uA", EMS_Boiler.flameCurr); + _renderIntValue("System pressure", "bar", EMS_Boiler.sysPress, 10); + if (EMS_Boiler.serviceCode == EMS_VALUE_USHORT_NOTSET) { + myDebug_P(PSTR(" System service code: %s"), EMS_Boiler.serviceCodeChar); + } else { + myDebug_P(PSTR(" System service code: %s (%d)"), EMS_Boiler.serviceCodeChar, EMS_Boiler.serviceCode); + } - // UBAMonitorFast - _renderIntValue("Selected flow temperature", "C", EMS_Boiler.selFlowTemp); - _renderUShortValue("Current flow temperature", "C", EMS_Boiler.curFlowTemp); - _renderUShortValue("Return temperature", "C", EMS_Boiler.retTemp); - _renderBoolValue("Gas", EMS_Boiler.burnGas); - _renderBoolValue("Boiler pump", EMS_Boiler.heatPmp); - _renderBoolValue("Fan", EMS_Boiler.fanWork); - _renderBoolValue("Ignition", EMS_Boiler.ignWork); - _renderBoolValue("Circulation pump", EMS_Boiler.wWCirc); - _renderIntValue("Burner selected max power", "%", EMS_Boiler.selBurnPow); - _renderIntValue("Burner current power", "%", EMS_Boiler.curBurnPow); - _renderShortValue("Flame current", "uA", EMS_Boiler.flameCurr); - _renderIntValue("System pressure", "bar", EMS_Boiler.sysPress, 10); - if (EMS_Boiler.serviceCode == EMS_VALUE_USHORT_NOTSET) { - myDebug_P(PSTR(" System service code: %s"), EMS_Boiler.serviceCodeChar); - } else { - myDebug_P(PSTR(" System service code: %s (%d)"), EMS_Boiler.serviceCodeChar, EMS_Boiler.serviceCode); - } + // UBAParametersMessage + _renderIntValue("Heating temperature setting on the boiler", "C", EMS_Boiler.heating_temp); + _renderIntValue("Boiler circuit pump modulation max power", "%", EMS_Boiler.pump_mod_max); + _renderIntValue("Boiler circuit pump modulation min power", "%", EMS_Boiler.pump_mod_min); - // UBAParametersMessage - _renderIntValue("Heating temperature setting on the boiler", "C", EMS_Boiler.heating_temp); - _renderIntValue("Boiler circuit pump modulation max power", "%", EMS_Boiler.pump_mod_max); - _renderIntValue("Boiler circuit pump modulation min power", "%", EMS_Boiler.pump_mod_min); - - // UBAMonitorSlow - if (EMS_Boiler.extTemp != EMS_VALUE_SHORT_NOTSET) { - _renderShortValue("Outside temperature", "C", EMS_Boiler.extTemp); - } - _renderUShortValue("Boiler temperature", "C", EMS_Boiler.boilTemp); - _renderUShortValue("Exhaust temperature", "C", EMS_Boiler.exhaustTemp); - _renderIntValue("Pump modulation", "%", EMS_Boiler.pumpMod); - _renderLongValue("Burner # starts", "times", EMS_Boiler.burnStarts); - if (EMS_Boiler.burnWorkMin != EMS_VALUE_LONG_NOTSET) { - myDebug_P(PSTR(" Total burner operating time: %d days %d hours %d minutes"), - EMS_Boiler.burnWorkMin / 1440, - (EMS_Boiler.burnWorkMin % 1440) / 60, - EMS_Boiler.burnWorkMin % 60); - } - if (EMS_Boiler.heatWorkMin != EMS_VALUE_LONG_NOTSET) { - myDebug_P(PSTR(" Total heat operating time: %d days %d hours %d minutes"), - EMS_Boiler.heatWorkMin / 1440, - (EMS_Boiler.heatWorkMin % 1440) / 60, - EMS_Boiler.heatWorkMin % 60); - } - if (EMS_Boiler.UBAuptime != EMS_VALUE_LONG_NOTSET) { - myDebug_P(PSTR(" Total UBA working time: %d days %d hours %d minutes"), - EMS_Boiler.UBAuptime / 1440, - (EMS_Boiler.UBAuptime % 1440) / 60, - EMS_Boiler.UBAuptime % 60); + // UBAMonitorSlow + if (EMS_Boiler.extTemp != EMS_VALUE_SHORT_NOTSET) { + _renderShortValue("Outside temperature", "C", EMS_Boiler.extTemp); + } + _renderUShortValue("Boiler temperature", "C", EMS_Boiler.boilTemp); + _renderUShortValue("Exhaust temperature", "C", EMS_Boiler.exhaustTemp); + _renderIntValue("Pump modulation", "%", EMS_Boiler.pumpMod); + _renderLongValue("Burner # starts", "times", EMS_Boiler.burnStarts); + if (EMS_Boiler.burnWorkMin != EMS_VALUE_LONG_NOTSET) { + myDebug_P(PSTR(" Total burner operating time: %d days %d hours %d minutes"), + EMS_Boiler.burnWorkMin / 1440, + (EMS_Boiler.burnWorkMin % 1440) / 60, + EMS_Boiler.burnWorkMin % 60); + } + if (EMS_Boiler.heatWorkMin != EMS_VALUE_LONG_NOTSET) { + myDebug_P(PSTR(" Total heat operating time: %d days %d hours %d minutes"), + EMS_Boiler.heatWorkMin / 1440, + (EMS_Boiler.heatWorkMin % 1440) / 60, + EMS_Boiler.heatWorkMin % 60); + } + if (EMS_Boiler.UBAuptime != EMS_VALUE_LONG_NOTSET) { + myDebug_P(PSTR(" Total UBA working time: %d days %d hours %d minutes"), + EMS_Boiler.UBAuptime / 1440, + (EMS_Boiler.UBAuptime % 1440) / 60, + EMS_Boiler.UBAuptime % 60); + } } // For SM10/SM100/SM200 Solar Module diff --git a/src/ems.cpp b/src/ems.cpp index feda2224b..e477c59f3 100644 --- a/src/ems.cpp +++ b/src/ems.cpp @@ -49,7 +49,7 @@ const uint8_t ems_crc_table[] = {0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, 0xF9, 0xFB, 0xFD, 0xFF, 0xF1, 0xF3, 0xF5, 0xF7, 0xE9, 0xEB, 0xED, 0xEF, 0xE1, 0xE3, 0xE5, 0xE7}; const uint8_t TX_WRITE_TIMEOUT_COUNT = 2; // 3 retries before timeout -const uint32_t EMS_BUS_TIMEOUT = 15000; // timeout in ms before recognizing the ems bus is offline (15 seconds) +const uint32_t EMS_BUS_TIMEOUT = 45000; // timeout in ms before recognizing the ems bus is offline (45 seconds) const uint32_t EMS_POLL_TIMEOUT = 5000000; // timeout in microseconds before recognizing the ems bus is offline (5 seconds) /* @@ -1195,8 +1195,9 @@ void _process_RC30StatusMessage(_EMS_RxTelegram * EMS_RxTelegram) { void _process_RC35StatusMessage(_EMS_RxTelegram * EMS_RxTelegram) { // exit if... // - the 15th byte (second from last) is 0x00, which I think is flow temp, means HC is not is use - // - its not a broadcast, so destination is 0x00 - if ((EMS_RxTelegram->data[14] == 0x00) || (EMS_RxTelegram->dest != EMS_ID_NONE)) { + // - its not a broadcast, so destination is 0x00 (not in use since 6/1/2020 - issue #238) + // if ((EMS_RxTelegram->data[14] == 0x00) || (EMS_RxTelegram->dest != EMS_ID_NONE)) { + if (EMS_RxTelegram->data[14] == 0x00) { return; } @@ -1369,6 +1370,11 @@ int8_t _getHeatingCircuit(_EMS_RxTelegram * EMS_RxTelegram) { return -1; } + // ignore telegrams that have no data, or only a single byte + if (EMS_RxTelegram->data_length <= 1) { + return -1; + } + int8_t hc; switch (EMS_RxTelegram->type) { diff --git a/src/ems_devices.h b/src/ems_devices.h index 486a7d813..9d65b40c4 100644 --- a/src/ems_devices.h +++ b/src/ems_devices.h @@ -12,10 +12,10 @@ #include "ems.h" // Fixed EMS Device IDs -#define EMS_ID_ME 0x0B // our device, hardcoded as the "Service Key" -#define EMS_ID_BOILER 0x08 // all UBA Boilers have 0x08 +#define EMS_ID_ME 0x0B // our device, hardcoded as the "Service Key" +#define EMS_ID_BOILER 0x08 // all UBA Boilers have 0x08 -#define EMS_ID_SM 0x30 // Solar Module SM10, SM100, SM200 and ISM1 +#define EMS_ID_SM 0x30 // Solar Module SM10, SM100, SM200 and ISM1 /* * Common Type @@ -237,22 +237,23 @@ static const _EMS_Device EMS_Devices[] = { // Other devices like controllers and modems // such as 0x11 for Switching, 0x09 for controllers, 0x02 for Connect, 0x48 for Gateway // - {71, EMS_DEVICE_TYPE_SWITCH, "WM10 Switch Module", EMS_DEVICE_FLAG_NONE}, // 0x11 - {68, EMS_DEVICE_TYPE_CONTROLLER, "BC10/RFM20 Receiver", EMS_DEVICE_FLAG_NONE}, // 0x09 - {218, EMS_DEVICE_TYPE_CONTROLLER, "Junkers M200/Buderus RFM200 Receiver", EMS_DEVICE_FLAG_NONE}, // 0x50 - {190, EMS_DEVICE_TYPE_CONTROLLER, "BC10 Base Controller", EMS_DEVICE_FLAG_NONE}, // 0x09 - {114, EMS_DEVICE_TYPE_CONTROLLER, "BC10 Base Controller", EMS_DEVICE_FLAG_NONE}, // 0x09 - {125, EMS_DEVICE_TYPE_CONTROLLER, "BC25 Base Controller", EMS_DEVICE_FLAG_NONE}, // 0x09 - {169, EMS_DEVICE_TYPE_CONTROLLER, "BC40 Base Controller", EMS_DEVICE_FLAG_NONE}, // 0x09 - {152, EMS_DEVICE_TYPE_CONTROLLER, "Controller", EMS_DEVICE_FLAG_NONE}, // 0x09 - {95, EMS_DEVICE_TYPE_CONTROLLER, "HT3 Controller", EMS_DEVICE_FLAG_NONE}, // 0x09 - {209, EMS_DEVICE_TYPE_CONTROLLER, "W-B ErP Boiler Control Panel", EMS_DEVICE_FLAG_NONE}, // 0x09 - {230, EMS_DEVICE_TYPE_CONTROLLER, "BC Base Controller", EMS_DEVICE_FLAG_NONE}, // 0x09 - {205, EMS_DEVICE_TYPE_CONNECT, "Nefit Moduline Easy Connect", EMS_DEVICE_FLAG_NONE}, // 0x02 - {206, EMS_DEVICE_TYPE_CONNECT, "Bosch Easy Connect", EMS_DEVICE_FLAG_NONE}, // 0x02 - {171, EMS_DEVICE_TYPE_CONNECT, "EMS-OT OpenTherm converter", EMS_DEVICE_FLAG_NONE}, // 0x02 - {189, EMS_DEVICE_TYPE_GATEWAY, "Web Gateway KM200", EMS_DEVICE_FLAG_NONE}, // 0x48 - {94, EMS_DEVICE_TYPE_GATEWAY, "RC Remote Device", EMS_DEVICE_FLAG_NONE}, // 0x18 + {71, EMS_DEVICE_TYPE_SWITCH, "WM10 Switch Module", EMS_DEVICE_FLAG_NONE}, // 0x11 + {68, EMS_DEVICE_TYPE_CONTROLLER, "BC10/RFM20 Receiver", EMS_DEVICE_FLAG_NONE}, // 0x09 + {218, EMS_DEVICE_TYPE_CONTROLLER, "Junkers M200/Buderus RFM200 Receiver", EMS_DEVICE_FLAG_NONE}, // 0x50 + {190, EMS_DEVICE_TYPE_CONTROLLER, "BC10 Base Controller", EMS_DEVICE_FLAG_NONE}, // 0x09 + {114, EMS_DEVICE_TYPE_CONTROLLER, "BC10 Base Controller", EMS_DEVICE_FLAG_NONE}, // 0x09 + {125, EMS_DEVICE_TYPE_CONTROLLER, "BC25 Base Controller", EMS_DEVICE_FLAG_NONE}, // 0x09 + {169, EMS_DEVICE_TYPE_CONTROLLER, "BC40 Base Controller", EMS_DEVICE_FLAG_NONE}, // 0x09 + {152, EMS_DEVICE_TYPE_CONTROLLER, "Controller", EMS_DEVICE_FLAG_NONE}, // 0x09 + {95, EMS_DEVICE_TYPE_CONTROLLER, "HT3 Controller", EMS_DEVICE_FLAG_NONE}, // 0x09 + {209, EMS_DEVICE_TYPE_CONTROLLER, "W-B ErP Boiler Control Panel", EMS_DEVICE_FLAG_NONE}, // 0x09 + {230, EMS_DEVICE_TYPE_CONTROLLER, "BC Base Controller", EMS_DEVICE_FLAG_NONE}, // 0x09 + {205, EMS_DEVICE_TYPE_CONNECT, "Nefit Moduline Easy Connect", EMS_DEVICE_FLAG_NONE}, // 0x02 + {206, EMS_DEVICE_TYPE_CONNECT, "Bosch Easy Connect", EMS_DEVICE_FLAG_NONE}, // 0x02 + {171, EMS_DEVICE_TYPE_CONNECT, "EMS-OT OpenTherm converter", EMS_DEVICE_FLAG_NONE}, // 0x02 + {189, EMS_DEVICE_TYPE_GATEWAY, "Web Gateway KM200", EMS_DEVICE_FLAG_NONE}, // 0x48 + {94, EMS_DEVICE_TYPE_GATEWAY, "RC Remote Device", EMS_DEVICE_FLAG_NONE}, // 0x18 + {207, EMS_DEVICE_TYPE_CONTROLLER, "Worcester Sense II/Bosch CS200 Solar Controller", EMS_DEVICE_FLAG_NONE}, // 0x10 // // Thermostats, typically device id of 0x10, 0x17, 0x18, 0x38 (RC100), 0x39 (Easy) @@ -263,7 +264,7 @@ static const _EMS_Device EMS_Devices[] = { {203, EMS_DEVICE_TYPE_THERMOSTAT, "Bosch EasyControl CT200", EMS_DEVICE_FLAG_EASY | EMS_DEVICE_FLAG_NO_WRITE}, // 0x18, cannot write {157, EMS_DEVICE_TYPE_THERMOSTAT, "Buderus RC200/Bosch CW100/Junkers CW100", EMS_DEVICE_FLAG_NO_WRITE}, // 0x18, cannot write - // Buderus/Nefit + // Buderus/Nefit specific {79, EMS_DEVICE_TYPE_THERMOSTAT, "RC10/Moduline 100", EMS_DEVICE_FLAG_RC10}, // 0x17 {77, EMS_DEVICE_TYPE_THERMOSTAT, "RC20/Moduline 300", EMS_DEVICE_FLAG_RC20}, // 0x17 {67, EMS_DEVICE_TYPE_THERMOSTAT, "RC30", EMS_DEVICE_FLAG_RC30}, // 0x10 diff --git a/src/version.h b/src/version.h index 53f287e97..55b458466 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define APP_VERSION "1.9.5b14" +#define APP_VERSION "1.9.5b16"