added service code number

This commit is contained in:
proddy
2019-03-12 21:54:03 +01:00
parent 412ed2fa16
commit 007f8c1da1
5 changed files with 29 additions and 19 deletions

1
.gitignore vendored
View File

@@ -6,3 +6,4 @@
platformio.ini platformio.ini
lib/readme.txt lib/readme.txt
.travis.yml .travis.yml
stackdmp.txt

View File

@@ -76,7 +76,7 @@ extern "C" {
#define COLOR_BOLD_OFF "\x1B[22m" // fixed by Scott Arlott #define COLOR_BOLD_OFF "\x1B[22m" // fixed by Scott Arlott
// SPIFFS // SPIFFS
#define SPIFFS_MAXSIZE 500 // https://arduinojson.org/v5/assistant/ #define SPIFFS_MAXSIZE 500 // https://arduinojson.org/v6/assistant/
// CRASH // CRASH
#define SAVE_CRASH_EEPROM_OFFSET 0x0100 // initial address for crash data #define SAVE_CRASH_EEPROM_OFFSET 0x0100 // initial address for crash data

View File

@@ -327,7 +327,7 @@ void showInfo() {
_renderIntValue("Burner current power", "%", EMS_Boiler.curBurnPow); _renderIntValue("Burner current power", "%", EMS_Boiler.curBurnPow);
_renderFloatValue("Flame current", "uA", EMS_Boiler.flameCurr); _renderFloatValue("Flame current", "uA", EMS_Boiler.flameCurr);
_renderFloatValue("System pressure", "bar", EMS_Boiler.sysPress); _renderFloatValue("System pressure", "bar", EMS_Boiler.sysPress);
myDebug(" Current System Service Code: %s", EMS_Boiler.serviceCodeChar); myDebug(" System Service Code: %s(%d)", EMS_Boiler.serviceCodeChar, EMS_Boiler.serviceCode);
// UBAParametersMessage // UBAParametersMessage
_renderIntValue("Heating temperature setting on the boiler", "C", EMS_Boiler.heating_temp); _renderIntValue("Heating temperature setting on the boiler", "C", EMS_Boiler.heating_temp);
@@ -446,6 +446,7 @@ void publishValues(bool force) {
rootBoiler["boilTemp"] = _float_to_char(s, EMS_Boiler.boilTemp); rootBoiler["boilTemp"] = _float_to_char(s, EMS_Boiler.boilTemp);
rootBoiler["pumpMod"] = _int_to_char(s, EMS_Boiler.pumpMod); rootBoiler["pumpMod"] = _int_to_char(s, EMS_Boiler.pumpMod);
rootBoiler["ServiceCode"] = EMS_Boiler.serviceCodeChar; rootBoiler["ServiceCode"] = EMS_Boiler.serviceCodeChar;
rootBoiler["ServiceCodeNumber"] = EMS_Boiler.serviceCode;
serializeJson(doc, data, sizeof(data)); serializeJson(doc, data, sizeof(data));
@@ -512,9 +513,9 @@ void publishValues(bool force) {
for (size_t i = 0; i < measureJson(doc) - 1; i++) { for (size_t i = 0; i < measureJson(doc) - 1; i++) {
crc.update(data[i]); crc.update(data[i]);
} }
uint32_t checksum = crc.finalize(); fchecksum = crc.finalize();
if ((previousThermostatPublishCRC != checksum) || force) { if ((previousThermostatPublishCRC != fchecksum) || force) {
previousThermostatPublishCRC = checksum; previousThermostatPublishCRC = fchecksum;
myDebugLog("Publishing thermostat data via MQTT"); myDebugLog("Publishing thermostat data via MQTT");
// send values via MQTT // send values via MQTT

View File

@@ -203,6 +203,7 @@ void ems_init() {
EMS_Boiler.flameCurr = EMS_VALUE_FLOAT_NOTSET; // Flame current in micro amps EMS_Boiler.flameCurr = EMS_VALUE_FLOAT_NOTSET; // Flame current in micro amps
EMS_Boiler.sysPress = EMS_VALUE_FLOAT_NOTSET; // System pressure EMS_Boiler.sysPress = EMS_VALUE_FLOAT_NOTSET; // System pressure
strlcpy(EMS_Boiler.serviceCodeChar, "??", sizeof(EMS_Boiler.serviceCodeChar)); strlcpy(EMS_Boiler.serviceCodeChar, "??", sizeof(EMS_Boiler.serviceCodeChar));
EMS_Boiler.serviceCode = EMS_VALUE_SHORT_NOTSET;
// UBAMonitorSlow // UBAMonitorSlow
EMS_Boiler.extTemp = EMS_VALUE_FLOAT_NOTSET; // Outside temperature EMS_Boiler.extTemp = EMS_VALUE_FLOAT_NOTSET; // Outside temperature
@@ -925,6 +926,8 @@ void _process_UBAMonitorWWMessage(uint8_t type, uint8_t * data, uint8_t length)
/** /**
* UBAMonitorFast - type 0x18 - central heating monitor part 1 (25 bytes long) * UBAMonitorFast - type 0x18 - central heating monitor part 1 (25 bytes long)
* received every 10 seconds * received every 10 seconds
* e.g. 08 00 18 00 4B 01 67 02 00 01 01 40 40 01 4B 80 00 01 4A 00 00 0E 30 45 01 09 00 00 00 (CRC=04), #data=25
* 08 00 18 00 4B 01 56 03 00 01 01 40 40 01 3E 80 00 01 4D 00 00 0E 30 45 01 09 00 00 00 (CRC=EA), #data=25
*/ */
void _process_UBAMonitorFast(uint8_t type, uint8_t * data, uint8_t length) { void _process_UBAMonitorFast(uint8_t type, uint8_t * data, uint8_t length) {
EMS_Boiler.selFlowTemp = data[0]; EMS_Boiler.selFlowTemp = data[0];
@@ -948,6 +951,9 @@ void _process_UBAMonitorFast(uint8_t type, uint8_t * data, uint8_t length) {
EMS_Boiler.serviceCodeChar[0] = char(data[18]); // ascii character 1 EMS_Boiler.serviceCodeChar[0] = char(data[18]); // ascii character 1
EMS_Boiler.serviceCodeChar[1] = char(data[19]); // ascii character 2 EMS_Boiler.serviceCodeChar[1] = char(data[19]); // ascii character 2
// read error code
EMS_Boiler.serviceCode = (data[20] << 8) + data[21];
if (data[17] == 0xFF) { // missing value for system pressure if (data[17] == 0xFF) { // missing value for system pressure
EMS_Boiler.sysPress = 0; EMS_Boiler.sysPress = 0;
} else { } else {

View File

@@ -27,6 +27,7 @@
#define EMS_VALUE_INT_OFF 0 // boolean false #define EMS_VALUE_INT_OFF 0 // boolean false
#define EMS_VALUE_INT_NOTSET 0xFF // for 8-bit ints #define EMS_VALUE_INT_NOTSET 0xFF // for 8-bit ints
#define EMS_VALUE_LONG_NOTSET 0xFFFFFF // for 3-byte longs #define EMS_VALUE_LONG_NOTSET 0xFFFFFF // for 3-byte longs
#define EMS_VALUE_SHORT_NOTSET 0xFFFF // for 2-byte shorts
#define EMS_VALUE_FLOAT_NOTSET -255 // float #define EMS_VALUE_FLOAT_NOTSET -255 // float
#define EMS_THERMOSTAT_READ_YES true #define EMS_THERMOSTAT_READ_YES true
@@ -172,6 +173,7 @@ typedef struct { // UBAParameterWW
float flameCurr; // Flame current in micro amps float flameCurr; // Flame current in micro amps
float sysPress; // System pressure float sysPress; // System pressure
char serviceCodeChar[2]; // 2 character status/service code char serviceCodeChar[2]; // 2 character status/service code
uint16_t serviceCode; // error/service code
// UBAMonitorSlow // UBAMonitorSlow
float extTemp; // Outside temperature float extTemp; // Outside temperature