mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 16:59:50 +03:00
fix bug in HC counter for https://github.com/proddy/EMS-ESP/issues/162
This commit is contained in:
15
src/ems.cpp
15
src/ems.cpp
@@ -813,7 +813,7 @@ void ems_parseTelegram(uint8_t * telegram, uint8_t length) {
|
|||||||
*/
|
*/
|
||||||
if (EMS_Sys_Status.emsRxStatus != EMS_RX_STATUS_IDLE) {
|
if (EMS_Sys_Status.emsRxStatus != EMS_RX_STATUS_IDLE) {
|
||||||
if (EMS_Sys_Status.emsLogging > EMS_SYS_LOGGING_NONE) {
|
if (EMS_Sys_Status.emsLogging > EMS_SYS_LOGGING_NONE) {
|
||||||
myDebug_P(PSTR("** [DEBUG MODE] Warning, we missed the bus - Rx non-idle!"));
|
myDebug_P(PSTR("** Warning, we missed the bus - Rx non-idle!"));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1383,12 +1383,17 @@ void _process_RC30StatusMessage(_EMS_RxTelegram * EMS_RxTelegram) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* type 0x3E (HC1), 0x48 (HC2), 0x52 (HC3), 0x5C (HC4) - HK1MonitorMessage - data from the RC35 thermostat (0x10) - 16 bytes
|
* type 0x3E (HC1), 0x48 (HC2), 0x52 (HC3), 0x5C (HC4) - HK1MonitorMessage - data from the RC35 thermostat (0x10) - 16 bytes
|
||||||
|
* examples:
|
||||||
|
* 10 0B 3E 00 00 00 00 7D 00 00 00 00 00 00 00 00 00 11 05 04
|
||||||
|
* 10 00 48 00 00 00 00 00 E4 00 00 00 00 00 00 00 00 11 05 04
|
||||||
|
* 10 0B 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 00 00
|
||||||
|
* 10 0B 5C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 00 00
|
||||||
*
|
*
|
||||||
* For reading the temp values only
|
* For reading the temp values only
|
||||||
* received every 60 seconds
|
* received every 60 seconds
|
||||||
*/
|
*/
|
||||||
void _process_RC35StatusMessage(_EMS_RxTelegram * EMS_RxTelegram) {
|
void _process_RC35StatusMessage(_EMS_RxTelegram * EMS_RxTelegram) {
|
||||||
uint8_t hc_num = _getHeatingCircuit(EMS_RxTelegram); // which HC is it?
|
uint8_t hc_num = _getHeatingCircuit(EMS_RxTelegram) - 1; // which HC is it?
|
||||||
|
|
||||||
// check if setpoint temp sensor is unavailable
|
// check if setpoint temp sensor is unavailable
|
||||||
if (EMS_RxTelegram->data[EMS_OFFSET_RC35StatusMessage_setpoint] == 0x7D) {
|
if (EMS_RxTelegram->data[EMS_OFFSET_RC35StatusMessage_setpoint] == 0x7D) {
|
||||||
@@ -1401,12 +1406,12 @@ void _process_RC35StatusMessage(_EMS_RxTelegram * EMS_RxTelegram) {
|
|||||||
if (EMS_RxTelegram->data[EMS_OFFSET_RC35StatusMessage_curr] == 0x7D) {
|
if (EMS_RxTelegram->data[EMS_OFFSET_RC35StatusMessage_curr] == 0x7D) {
|
||||||
EMS_Thermostat.hc[hc_num].curr_roomTemp = EMS_VALUE_SHORT_NOTSET;
|
EMS_Thermostat.hc[hc_num].curr_roomTemp = EMS_VALUE_SHORT_NOTSET;
|
||||||
} else {
|
} else {
|
||||||
EMS_Thermostat.hc[hc_num].curr_roomTemp = _toShort(EMS_OFFSET_RC35StatusMessage_curr);
|
EMS_Thermostat.hc[hc_num].curr_roomTemp = _toShort(EMS_OFFSET_RC35StatusMessage_curr); // is * 10
|
||||||
}
|
}
|
||||||
|
|
||||||
EMS_Thermostat.hc[hc_num].day_mode = _bitRead(EMS_OFFSET_RC35StatusMessage_mode, 1); // get day mode flag
|
EMS_Thermostat.hc[hc_num].day_mode = _bitRead(EMS_OFFSET_RC35StatusMessage_mode, 1); // get day mode flag
|
||||||
|
|
||||||
EMS_Thermostat.hc[hc_num].circuitcalctemp = _toByte(EMS_OFFSET_RC35Set_circuitcalctemp); // 0x48 calculated temperature
|
EMS_Thermostat.hc[hc_num].circuitcalctemp = _toByte(EMS_OFFSET_RC35Set_circuitcalctemp); // calculated temperature
|
||||||
|
|
||||||
EMS_Sys_Status.emsRefreshed = true; // triggers a send the values back via MQTT
|
EMS_Sys_Status.emsRefreshed = true; // triggers a send the values back via MQTT
|
||||||
}
|
}
|
||||||
@@ -1587,7 +1592,7 @@ uint8_t _getHeatingCircuit(_EMS_RxTelegram * EMS_RxTelegram) {
|
|||||||
* received only after requested
|
* received only after requested
|
||||||
*/
|
*/
|
||||||
void _process_RC35Set(_EMS_RxTelegram * EMS_RxTelegram) {
|
void _process_RC35Set(_EMS_RxTelegram * EMS_RxTelegram) {
|
||||||
uint8_t hc_num = _getHeatingCircuit(EMS_RxTelegram); // which HC is it?
|
uint8_t hc_num = _getHeatingCircuit(EMS_RxTelegram) - 1; // which HC is it?
|
||||||
|
|
||||||
EMS_Thermostat.hc[hc_num].mode = _toByte(EMS_OFFSET_RC35Set_mode);
|
EMS_Thermostat.hc[hc_num].mode = _toByte(EMS_OFFSET_RC35Set_mode);
|
||||||
EMS_Thermostat.hc[hc_num].daytemp = _toByte(EMS_OFFSET_RC35Set_temp_day); // is * 2
|
EMS_Thermostat.hc[hc_num].daytemp = _toByte(EMS_OFFSET_RC35Set_temp_day); // is * 2
|
||||||
|
|||||||
Reference in New Issue
Block a user