mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
added service code number
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,3 +6,4 @@
|
||||
platformio.ini
|
||||
lib/readme.txt
|
||||
.travis.yml
|
||||
stackdmp.txt
|
||||
@@ -76,7 +76,7 @@ extern "C" {
|
||||
#define COLOR_BOLD_OFF "\x1B[22m" // fixed by Scott Arlott
|
||||
|
||||
// SPIFFS
|
||||
#define SPIFFS_MAXSIZE 500 // https://arduinojson.org/v5/assistant/
|
||||
#define SPIFFS_MAXSIZE 500 // https://arduinojson.org/v6/assistant/
|
||||
|
||||
// CRASH
|
||||
#define SAVE_CRASH_EEPROM_OFFSET 0x0100 // initial address for crash data
|
||||
|
||||
@@ -327,7 +327,7 @@ void showInfo() {
|
||||
_renderIntValue("Burner current power", "%", EMS_Boiler.curBurnPow);
|
||||
_renderFloatValue("Flame current", "uA", EMS_Boiler.flameCurr);
|
||||
_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
|
||||
_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["pumpMod"] = _int_to_char(s, EMS_Boiler.pumpMod);
|
||||
rootBoiler["ServiceCode"] = EMS_Boiler.serviceCodeChar;
|
||||
rootBoiler["ServiceCodeNumber"] = EMS_Boiler.serviceCode;
|
||||
|
||||
serializeJson(doc, data, sizeof(data));
|
||||
|
||||
@@ -512,9 +513,9 @@ void publishValues(bool force) {
|
||||
for (size_t i = 0; i < measureJson(doc) - 1; i++) {
|
||||
crc.update(data[i]);
|
||||
}
|
||||
uint32_t checksum = crc.finalize();
|
||||
if ((previousThermostatPublishCRC != checksum) || force) {
|
||||
previousThermostatPublishCRC = checksum;
|
||||
fchecksum = crc.finalize();
|
||||
if ((previousThermostatPublishCRC != fchecksum) || force) {
|
||||
previousThermostatPublishCRC = fchecksum;
|
||||
myDebugLog("Publishing thermostat data via MQTT");
|
||||
|
||||
// send values via MQTT
|
||||
|
||||
@@ -203,6 +203,7 @@ void ems_init() {
|
||||
EMS_Boiler.flameCurr = EMS_VALUE_FLOAT_NOTSET; // Flame current in micro amps
|
||||
EMS_Boiler.sysPress = EMS_VALUE_FLOAT_NOTSET; // System pressure
|
||||
strlcpy(EMS_Boiler.serviceCodeChar, "??", sizeof(EMS_Boiler.serviceCodeChar));
|
||||
EMS_Boiler.serviceCode = EMS_VALUE_SHORT_NOTSET;
|
||||
|
||||
// UBAMonitorSlow
|
||||
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)
|
||||
* 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) {
|
||||
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[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
|
||||
EMS_Boiler.sysPress = 0;
|
||||
} else {
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#define EMS_VALUE_INT_OFF 0 // boolean false
|
||||
#define EMS_VALUE_INT_NOTSET 0xFF // for 8-bit ints
|
||||
#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_THERMOSTAT_READ_YES true
|
||||
@@ -172,6 +173,7 @@ typedef struct { // UBAParameterWW
|
||||
float flameCurr; // Flame current in micro amps
|
||||
float sysPress; // System pressure
|
||||
char serviceCodeChar[2]; // 2 character status/service code
|
||||
uint16_t serviceCode; // error/service code
|
||||
|
||||
// UBAMonitorSlow
|
||||
float extTemp; // Outside temperature
|
||||
|
||||
Reference in New Issue
Block a user