mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 08:49:52 +03:00
ServiceCode as 2-byte char
This commit is contained in:
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- Scanning known EMS Devices now ignores duplicates (https://github.com/proddy/EMS-ESP-Boiler/pull/30)
|
- Scanning known EMS Devices now ignores duplicates (https://github.com/proddy/EMS-ESP-Boiler/pull/30)
|
||||||
|
- ServiceCode stored as a two byte char
|
||||||
|
|
||||||
## [1.2.3] 2019-01-03
|
## [1.2.3] 2019-01-03
|
||||||
|
|
||||||
|
|||||||
@@ -481,7 +481,7 @@ void MyESP::_telnetHandle() {
|
|||||||
while (SerialAndTelnet.available()) {
|
while (SerialAndTelnet.available()) {
|
||||||
char character = SerialAndTelnet.read(); // Get character
|
char character = SerialAndTelnet.read(); // Get character
|
||||||
|
|
||||||
// check for ctrl-D
|
// check for ctrl-D (EOF) or EOT
|
||||||
if ((character == 0xEC) || (character == 0x04)) {
|
if ((character == 0xEC) || (character == 0x04)) {
|
||||||
SerialAndTelnet.disconnectClient();
|
SerialAndTelnet.disconnectClient();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -341,7 +341,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: %c%c", EMS_Boiler.serviceCodeChar1, EMS_Boiler.serviceCodeChar2);
|
myDebug(" Current System Service Code: %s", EMS_Boiler.serviceCodeChar);
|
||||||
|
|
||||||
// UBAMonitorSlow
|
// UBAMonitorSlow
|
||||||
_renderFloatValue("Outside temperature", "C", EMS_Boiler.extTemp);
|
_renderFloatValue("Outside temperature", "C", EMS_Boiler.extTemp);
|
||||||
@@ -438,8 +438,7 @@ void publishValues(bool force) {
|
|||||||
rootBoiler["sysPress"] = _float_to_char(s, EMS_Boiler.sysPress);
|
rootBoiler["sysPress"] = _float_to_char(s, EMS_Boiler.sysPress);
|
||||||
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);
|
||||||
snprintf(s, sizeof(s), "%c%c", EMS_Boiler.serviceCodeChar1, EMS_Boiler.serviceCodeChar2);
|
rootBoiler["ServiceCode"] = EMS_Boiler.serviceCodeChar;
|
||||||
rootBoiler["ServiceCode"] = s;
|
|
||||||
|
|
||||||
rlen = rootBoiler.measureLength();
|
rlen = rootBoiler.measureLength();
|
||||||
rootBoiler.printTo(data, rlen + 1); // form the json string
|
rootBoiler.printTo(data, rlen + 1); // form the json string
|
||||||
|
|||||||
33
src/ems.cpp
33
src/ems.cpp
@@ -198,21 +198,20 @@ void ems_init(_EMS_MODEL_ID boiler_modelid, _EMS_MODEL_ID thermostat_modelid) {
|
|||||||
EMS_Boiler.wWComfort = EMS_VALUE_INT_NOTSET;
|
EMS_Boiler.wWComfort = EMS_VALUE_INT_NOTSET;
|
||||||
|
|
||||||
// UBAMonitorFast
|
// UBAMonitorFast
|
||||||
EMS_Boiler.selFlowTemp = EMS_VALUE_INT_NOTSET; // Selected flow temperature
|
EMS_Boiler.selFlowTemp = EMS_VALUE_INT_NOTSET; // Selected flow temperature
|
||||||
EMS_Boiler.curFlowTemp = EMS_VALUE_FLOAT_NOTSET; // Current flow temperature
|
EMS_Boiler.curFlowTemp = EMS_VALUE_FLOAT_NOTSET; // Current flow temperature
|
||||||
EMS_Boiler.retTemp = EMS_VALUE_FLOAT_NOTSET; // Return temperature
|
EMS_Boiler.retTemp = EMS_VALUE_FLOAT_NOTSET; // Return temperature
|
||||||
EMS_Boiler.burnGas = EMS_VALUE_INT_NOTSET; // Gas on/off
|
EMS_Boiler.burnGas = EMS_VALUE_INT_NOTSET; // Gas on/off
|
||||||
EMS_Boiler.fanWork = EMS_VALUE_INT_NOTSET; // Fan on/off
|
EMS_Boiler.fanWork = EMS_VALUE_INT_NOTSET; // Fan on/off
|
||||||
EMS_Boiler.ignWork = EMS_VALUE_INT_NOTSET; // Ignition on/off
|
EMS_Boiler.ignWork = EMS_VALUE_INT_NOTSET; // Ignition on/off
|
||||||
EMS_Boiler.heatPmp = EMS_VALUE_INT_NOTSET; // Boiler pump on/off
|
EMS_Boiler.heatPmp = EMS_VALUE_INT_NOTSET; // Boiler pump on/off
|
||||||
EMS_Boiler.wWHeat = EMS_VALUE_INT_NOTSET; // 3-way valve on WW
|
EMS_Boiler.wWHeat = EMS_VALUE_INT_NOTSET; // 3-way valve on WW
|
||||||
EMS_Boiler.wWCirc = EMS_VALUE_INT_NOTSET; // Circulation on/off
|
EMS_Boiler.wWCirc = EMS_VALUE_INT_NOTSET; // Circulation on/off
|
||||||
EMS_Boiler.selBurnPow = EMS_VALUE_INT_NOTSET; // Burner max power
|
EMS_Boiler.selBurnPow = EMS_VALUE_INT_NOTSET; // Burner max power
|
||||||
EMS_Boiler.curBurnPow = EMS_VALUE_INT_NOTSET; // Burner current power
|
EMS_Boiler.curBurnPow = EMS_VALUE_INT_NOTSET; // Burner current power
|
||||||
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
|
||||||
EMS_Boiler.serviceCodeChar1 = EMS_VALUE_INT_NOTSET; // service codes
|
strlcpy(EMS_Boiler.serviceCodeChar, "??", sizeof(EMS_Boiler.serviceCodeChar));
|
||||||
EMS_Boiler.serviceCodeChar2 = EMS_VALUE_INT_NOTSET; // service codes
|
|
||||||
|
|
||||||
// UBAMonitorSlow
|
// UBAMonitorSlow
|
||||||
EMS_Boiler.extTemp = EMS_VALUE_FLOAT_NOTSET; // Outside temperature
|
EMS_Boiler.extTemp = EMS_VALUE_FLOAT_NOTSET; // Outside temperature
|
||||||
@@ -934,8 +933,8 @@ void _process_UBAMonitorFast(uint8_t * data, uint8_t length) {
|
|||||||
EMS_Boiler.flameCurr = _toFloat(15, data);
|
EMS_Boiler.flameCurr = _toFloat(15, data);
|
||||||
|
|
||||||
// read the service code / installation status as appears on the display
|
// read the service code / installation status as appears on the display
|
||||||
EMS_Boiler.serviceCodeChar1 = data[18]; // ascii character 1
|
EMS_Boiler.serviceCodeChar[0] = char(data[18]); // ascii character 1
|
||||||
EMS_Boiler.serviceCodeChar2 = data[19]; // ascii character 2
|
EMS_Boiler.serviceCodeChar[1] = char(data[19]); // ascii character 2
|
||||||
|
|
||||||
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;
|
||||||
|
|||||||
29
src/ems.h
29
src/ems.h
@@ -221,21 +221,20 @@ typedef struct { // UBAParameterWW
|
|||||||
uint8_t wWComfort; // Warm water comfort or ECO mode
|
uint8_t wWComfort; // Warm water comfort or ECO mode
|
||||||
|
|
||||||
// UBAMonitorFast
|
// UBAMonitorFast
|
||||||
uint8_t selFlowTemp; // Selected flow temperature
|
uint8_t selFlowTemp; // Selected flow temperature
|
||||||
float curFlowTemp; // Current flow temperature
|
float curFlowTemp; // Current flow temperature
|
||||||
float retTemp; // Return temperature
|
float retTemp; // Return temperature
|
||||||
uint8_t burnGas; // Gas on/off
|
uint8_t burnGas; // Gas on/off
|
||||||
uint8_t fanWork; // Fan on/off
|
uint8_t fanWork; // Fan on/off
|
||||||
uint8_t ignWork; // Ignition on/off
|
uint8_t ignWork; // Ignition on/off
|
||||||
uint8_t heatPmp; // Circulating pump on/off
|
uint8_t heatPmp; // Circulating pump on/off
|
||||||
uint8_t wWHeat; // 3-way valve on WW
|
uint8_t wWHeat; // 3-way valve on WW
|
||||||
uint8_t wWCirc; // Circulation on/off
|
uint8_t wWCirc; // Circulation on/off
|
||||||
uint8_t selBurnPow; // Burner max power
|
uint8_t selBurnPow; // Burner max power
|
||||||
uint8_t curBurnPow; // Burner current power
|
uint8_t curBurnPow; // Burner current power
|
||||||
float flameCurr; // Flame current in micro amps
|
float flameCurr; // Flame current in micro amps
|
||||||
float sysPress; // System pressure
|
float sysPress; // System pressure
|
||||||
uint8_t serviceCodeChar1; // First Character in status/service code
|
char serviceCodeChar[2]; // 2 character status/service code
|
||||||
uint8_t serviceCodeChar2; // Second Character in status/service code
|
|
||||||
|
|
||||||
// UBAMonitorSlow
|
// UBAMonitorSlow
|
||||||
float extTemp; // Outside temperature
|
float extTemp; // Outside temperature
|
||||||
|
|||||||
Reference in New Issue
Block a user