mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
changed some values from ushort to short and notset-value to -32000
This commit is contained in:
@@ -441,6 +441,8 @@ void showInfo() {
|
|||||||
_renderIntValue(" Night temperature", "C", EMS_Thermostat.hc[hc_num - 1].nighttemp, 2); // convert to a single byte * 2
|
_renderIntValue(" Night temperature", "C", EMS_Thermostat.hc[hc_num - 1].nighttemp, 2); // convert to a single byte * 2
|
||||||
_renderIntValue(" Vacation temperature", "C", EMS_Thermostat.hc[hc_num - 1].holidaytemp, 2); // convert to a single byte * 2
|
_renderIntValue(" Vacation temperature", "C", EMS_Thermostat.hc[hc_num - 1].holidaytemp, 2); // convert to a single byte * 2
|
||||||
}
|
}
|
||||||
|
if (EMS_Thermostat.hc[hc_num - 1].circuitcalctemp != EMS_VALUE_USHORT_NOTSET)
|
||||||
|
_renderIntValue(" calculatet flow temperature", "C",EMS_Thermostat.hc[hc_num - 1].circuitcalctemp);
|
||||||
|
|
||||||
// Render Thermostat Mode
|
// Render Thermostat Mode
|
||||||
_EMS_THERMOSTAT_MODE thermoMode;
|
_EMS_THERMOSTAT_MODE thermoMode;
|
||||||
@@ -472,14 +474,18 @@ void showInfo() {
|
|||||||
if (ems_getMixingDeviceEnabled()) {
|
if (ems_getMixingDeviceEnabled()) {
|
||||||
myDebug_P(PSTR("")); // newline
|
myDebug_P(PSTR("")); // newline
|
||||||
myDebug_P(PSTR("%sMixing module stats:%s"), COLOR_BOLD_ON, COLOR_BOLD_OFF);
|
myDebug_P(PSTR("%sMixing module stats:%s"), COLOR_BOLD_ON, COLOR_BOLD_OFF);
|
||||||
_renderUShortValue("Switch temperature", "C", EMS_Boiler.switchTemp);
|
myDebug_P(PSTR(" Mixing: %s"), ems_getDeviceDescription(EMS_DEVICE_TYPE_MIXING, buffer_type,false));
|
||||||
|
if (EMS_Boiler.switchTemp != EMS_VALUE_SHORT_NOTSET)
|
||||||
|
_renderShortValue("Switch temperature", "C", EMS_Boiler.switchTemp);
|
||||||
|
|
||||||
for (uint8_t hc_num = 1; hc_num <= EMS_THERMOSTAT_MAXHC; hc_num++) {
|
for (uint8_t hc_num = 1; hc_num <= EMS_THERMOSTAT_MAXHC; hc_num++) {
|
||||||
if (EMS_Mixing.hc[hc_num - 1].active) {
|
if (EMS_Mixing.hc[hc_num - 1].active) {
|
||||||
myDebug_P(PSTR(" Mixing Circuit %d"), hc_num);
|
myDebug_P(PSTR(" Mixing Circuit %d"), hc_num);
|
||||||
_renderUShortValue(" Current flow temperature", "C", EMS_Mixing.hc[hc_num - 1].flowTemp);
|
if (EMS_Mixing.hc[hc_num - 1].flowTemp != EMS_VALUE_SHORT_NOTSET)
|
||||||
|
_renderShortValue(" Current flow temperature", "C", EMS_Mixing.hc[hc_num - 1].flowTemp);
|
||||||
if (EMS_Mixing.hc[hc_num - 1].flowSetTemp != EMS_VALUE_INT_NOTSET)
|
if (EMS_Mixing.hc[hc_num - 1].flowSetTemp != EMS_VALUE_INT_NOTSET)
|
||||||
_renderIntValue(" Setpoint flow temperature", "C", EMS_Mixing.hc[hc_num - 1].flowSetTemp);
|
_renderIntValue(" Setpoint flow temperature", "C", EMS_Mixing.hc[hc_num - 1].flowSetTemp);
|
||||||
|
if (EMS_Mixing.hc[hc_num - 1].pumpMod != EMS_VALUE_INT_NOTSET)
|
||||||
_renderIntValue(" Current pump modulation", "%", EMS_Mixing.hc[hc_num - 1].pumpMod);
|
_renderIntValue(" Current pump modulation", "%", EMS_Mixing.hc[hc_num - 1].pumpMod);
|
||||||
if (EMS_Mixing.hc[hc_num - 1].valveStatus != EMS_VALUE_INT_NOTSET)
|
if (EMS_Mixing.hc[hc_num - 1].valveStatus != EMS_VALUE_INT_NOTSET)
|
||||||
_renderIntValue(" Current valve status", "", EMS_Mixing.hc[hc_num - 1].valveStatus);
|
_renderIntValue(" Current valve status", "", EMS_Mixing.hc[hc_num - 1].valveStatus);
|
||||||
|
|||||||
@@ -161,6 +161,7 @@ void ems_init() {
|
|||||||
EMS_Boiler.burnStarts = EMS_VALUE_LONG_NOTSET; // # burner restarts
|
EMS_Boiler.burnStarts = EMS_VALUE_LONG_NOTSET; // # burner restarts
|
||||||
EMS_Boiler.burnWorkMin = EMS_VALUE_LONG_NOTSET; // Total burner operating time
|
EMS_Boiler.burnWorkMin = EMS_VALUE_LONG_NOTSET; // Total burner operating time
|
||||||
EMS_Boiler.heatWorkMin = EMS_VALUE_LONG_NOTSET; // Total heat operating time
|
EMS_Boiler.heatWorkMin = EMS_VALUE_LONG_NOTSET; // Total heat operating time
|
||||||
|
EMS_Boiler.switchTemp = EMS_VALUE_SHORT_NOTSET;
|
||||||
|
|
||||||
// UBAMonitorWWMessage
|
// UBAMonitorWWMessage
|
||||||
EMS_Boiler.wWCurTmp = EMS_VALUE_USHORT_NOTSET; // Warm Water current temperature
|
EMS_Boiler.wWCurTmp = EMS_VALUE_USHORT_NOTSET; // Warm Water current temperature
|
||||||
@@ -1243,6 +1244,7 @@ void _process_MMStatusMessage(_EMS_RxTelegram * EMS_RxTelegram) {
|
|||||||
if (hc != 0) {
|
if (hc != 0) {
|
||||||
return; // invalid type
|
return; // invalid type
|
||||||
}
|
}
|
||||||
|
//hc++;
|
||||||
EMS_Mixing.hc[hc].active = true;
|
EMS_Mixing.hc[hc].active = true;
|
||||||
|
|
||||||
_setValue(EMS_RxTelegram, &EMS_Mixing.hc[hc].flowTemp, EMS_OFFSET_MMStatusMessage_flow_temp);
|
_setValue(EMS_RxTelegram, &EMS_Mixing.hc[hc].flowTemp, EMS_OFFSET_MMStatusMessage_flow_temp);
|
||||||
@@ -1767,6 +1769,7 @@ void _process_Version(_EMS_RxTelegram * EMS_RxTelegram) {
|
|||||||
EMS_Mixing.device_desc_p = device_desc_p;
|
EMS_Mixing.device_desc_p = device_desc_p;
|
||||||
EMS_Mixing.device_flags = flags;
|
EMS_Mixing.device_flags = flags;
|
||||||
EMS_Mixing.detected = true;
|
EMS_Mixing.detected = true;
|
||||||
|
strlcpy(EMS_Mixing.version, version, sizeof(EMS_Mixing.version));
|
||||||
ems_doReadCommand(EMS_TYPE_MMPLUSStatusMessage_HC1, device_id); // fetch MM values
|
ems_doReadCommand(EMS_TYPE_MMPLUSStatusMessage_HC1, device_id); // fetch MM values
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1979,6 +1982,12 @@ char * ems_getDeviceDescription(_EMS_DEVICE_TYPE device_type, char * buffer, boo
|
|||||||
product_id = EMS_HeatPump.product_id;
|
product_id = EMS_HeatPump.product_id;
|
||||||
device_desc_p = EMS_HeatPump.device_desc_p;
|
device_desc_p = EMS_HeatPump.device_desc_p;
|
||||||
version = EMS_HeatPump.version;
|
version = EMS_HeatPump.version;
|
||||||
|
} else if (device_type == EMS_DEVICE_TYPE_MIXING) {
|
||||||
|
enabled = ems_getMixingDeviceEnabled();
|
||||||
|
device_id = EMS_Mixing.device_id;
|
||||||
|
product_id = EMS_Mixing.product_id;
|
||||||
|
device_desc_p = EMS_Mixing.device_desc_p;
|
||||||
|
version = EMS_Mixing.version;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!enabled) {
|
if (!enabled) {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
#define EMS_VALUE_BOOL_ON2 0xFF // boolean true, EMS sometimes uses 0xFF for TRUE
|
#define EMS_VALUE_BOOL_ON2 0xFF // boolean true, EMS sometimes uses 0xFF for TRUE
|
||||||
#define EMS_VALUE_BOOL_OFF 0x00 // boolean false
|
#define EMS_VALUE_BOOL_OFF 0x00 // boolean false
|
||||||
#define EMS_VALUE_INT_NOTSET 0xFF // for 8-bit unsigned ints/bytes
|
#define EMS_VALUE_INT_NOTSET 0xFF // for 8-bit unsigned ints/bytes
|
||||||
#define EMS_VALUE_SHORT_NOTSET -32768 // for 2-byte signed shorts
|
#define EMS_VALUE_SHORT_NOTSET -32000 //-32768 // for 2-byte signed shorts
|
||||||
#define EMS_VALUE_USHORT_NOTSET 0x8000 // for 2-byte unsigned shorts
|
#define EMS_VALUE_USHORT_NOTSET 0x8000 // for 2-byte unsigned shorts
|
||||||
#define EMS_VALUE_LONG_NOTSET 0xFFFFFF // for 3-byte longs
|
#define EMS_VALUE_LONG_NOTSET 0xFFFFFF // for 3-byte longs
|
||||||
#define EMS_VALUE_BOOL_NOTSET 0xFE // random number that's not 0, 1 or FF
|
#define EMS_VALUE_BOOL_NOTSET 0xFE // random number that's not 0, 1 or FF
|
||||||
@@ -282,7 +282,7 @@ typedef struct {
|
|||||||
uint32_t burnStarts; // # burner starts
|
uint32_t burnStarts; // # burner starts
|
||||||
uint32_t burnWorkMin; // Total burner operating time
|
uint32_t burnWorkMin; // Total burner operating time
|
||||||
uint32_t heatWorkMin; // Total heat operating time
|
uint32_t heatWorkMin; // Total heat operating time
|
||||||
uint16_t switchTemp; // Switch temperature
|
int16_t switchTemp; // Switch temperature
|
||||||
|
|
||||||
// UBAMonitorWWMessage
|
// UBAMonitorWWMessage
|
||||||
uint16_t wWCurTmp; // Warm Water current temperature
|
uint16_t wWCurTmp; // Warm Water current temperature
|
||||||
@@ -322,7 +322,7 @@ typedef struct {
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
uint8_t hc; // heating circuit 1, 2, 3 or 4
|
uint8_t hc; // heating circuit 1, 2, 3 or 4
|
||||||
bool active; // true if there is data for this HC
|
bool active; // true if there is data for this HC
|
||||||
uint16_t flowTemp;
|
int16_t flowTemp;
|
||||||
uint8_t pumpMod;
|
uint8_t pumpMod;
|
||||||
uint8_t valveStatus;
|
uint8_t valveStatus;
|
||||||
uint8_t flowSetTemp;
|
uint8_t flowSetTemp;
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ char * _bool_to_char(char * s, uint8_t value) {
|
|||||||
// negative values are assumed stored as 1-compliment (https://medium.com/@LeeJulija/how-integers-are-stored-in-memory-using-twos-complement-5ba04d61a56c)
|
// negative values are assumed stored as 1-compliment (https://medium.com/@LeeJulija/how-integers-are-stored-in-memory-using-twos-complement-5ba04d61a56c)
|
||||||
char * _short_to_char(char * s, int16_t value, uint8_t decimals) {
|
char * _short_to_char(char * s, int16_t value, uint8_t decimals) {
|
||||||
// remove errors or invalid values
|
// remove errors or invalid values
|
||||||
if (value == EMS_VALUE_SHORT_NOTSET) {
|
if (value == EMS_VALUE_SHORT_NOTSET || value == EMS_VALUE_USHORT_NOTSET) {
|
||||||
strlcpy(s, "?", 10);
|
strlcpy(s, "?", 10);
|
||||||
return (s);
|
return (s);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user