mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
This commit is contained in:
@@ -212,7 +212,40 @@ char * _short_to_char(char * s, int16_t value, uint8_t decimals = 1) {
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
// takes a short value (2 bytes), converts to a fraction
|
// convert short (two bytes) to text string
|
||||||
|
// decimals: 0 = no division, 1=divide value by 10, 2=divide by 2, 10=divide value by 100
|
||||||
|
char * _ushort_to_char(char * s, uint16_t value, uint8_t decimals = 1) {
|
||||||
|
// remove errors or invalid values
|
||||||
|
if (value == EMS_VALUE_USHORT_NOTSET) {
|
||||||
|
strlcpy(s, "?", 10);
|
||||||
|
return (s);
|
||||||
|
}
|
||||||
|
|
||||||
|
// just print
|
||||||
|
if (decimals == 0) {
|
||||||
|
ltoa(value, s, 10);
|
||||||
|
return (s);
|
||||||
|
}
|
||||||
|
|
||||||
|
// do floating point
|
||||||
|
char s2[10] = {0};
|
||||||
|
|
||||||
|
if (decimals == 2) {
|
||||||
|
// divide by 2
|
||||||
|
strlcpy(s, ltoa(value / 2, s2, 10), 10);
|
||||||
|
strlcat(s, ".", 10);
|
||||||
|
strlcat(s, ((value & 0x01) ? "5" : "0"), 10);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
strlcpy(s, ltoa(value / (decimals * 10), s2, 10), 10);
|
||||||
|
strlcat(s, ".", 10);
|
||||||
|
strlcat(s, ltoa(value % (decimals * 10), s2, 10), 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
// takes a signed short value (2 bytes), converts to a fraction
|
||||||
// decimals: 0 = no division, 1=divide value by 10, 2=divide by 2, 10=divide value by 100
|
// decimals: 0 = no division, 1=divide value by 10, 2=divide by 2, 10=divide value by 100
|
||||||
void _renderShortValue(const char * prefix, const char * postfix, int16_t value, uint8_t decimals = 1) {
|
void _renderShortValue(const char * prefix, const char * postfix, int16_t value, uint8_t decimals = 1) {
|
||||||
static char buffer[200] = {0};
|
static char buffer[200] = {0};
|
||||||
@@ -231,6 +264,25 @@ void _renderShortValue(const char * prefix, const char * postfix, int16_t value,
|
|||||||
myDebug(buffer);
|
myDebug(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// takes a unsigned short value (2 bytes), converts to a fraction
|
||||||
|
// decimals: 0 = no division, 1=divide value by 10, 2=divide by 2, 10=divide value by 100
|
||||||
|
void _renderUShortValue(const char * prefix, const char * postfix, uint16_t value, uint8_t decimals = 1) {
|
||||||
|
static char buffer[200] = {0};
|
||||||
|
static char s[20] = {0};
|
||||||
|
strlcpy(buffer, " ", sizeof(buffer));
|
||||||
|
strlcat(buffer, prefix, sizeof(buffer));
|
||||||
|
strlcat(buffer, ": ", sizeof(buffer));
|
||||||
|
|
||||||
|
strlcat(buffer, _ushort_to_char(s, value, decimals), sizeof(buffer));
|
||||||
|
|
||||||
|
if (postfix != NULL) {
|
||||||
|
strlcat(buffer, " ", sizeof(buffer));
|
||||||
|
strlcat(buffer, postfix, sizeof(buffer));
|
||||||
|
}
|
||||||
|
|
||||||
|
myDebug(buffer);
|
||||||
|
}
|
||||||
|
|
||||||
// convert int (single byte) to text value
|
// convert int (single byte) to text value
|
||||||
char * _int_to_char(char * s, uint8_t value, uint8_t div = 1) {
|
char * _int_to_char(char * s, uint8_t value, uint8_t div = 1) {
|
||||||
if (value == EMS_VALUE_INT_NOTSET) {
|
if (value == EMS_VALUE_INT_NOTSET) {
|
||||||
@@ -400,7 +452,7 @@ void showInfo() {
|
|||||||
_renderIntValue("Warm Water desired temperature", "C", EMS_Boiler.wWDesiredTemp);
|
_renderIntValue("Warm Water desired temperature", "C", EMS_Boiler.wWDesiredTemp);
|
||||||
|
|
||||||
// UBAMonitorWWMessage
|
// UBAMonitorWWMessage
|
||||||
_renderShortValue("Warm Water current temperature", "C", EMS_Boiler.wWCurTmp);
|
_renderUShortValue("Warm Water current temperature", "C", EMS_Boiler.wWCurTmp);
|
||||||
_renderIntValue("Warm Water current tap water flow", "l/min", EMS_Boiler.wWCurFlow, 10);
|
_renderIntValue("Warm Water current tap water flow", "l/min", EMS_Boiler.wWCurFlow, 10);
|
||||||
_renderLongValue("Warm Water # starts", "times", EMS_Boiler.wWStarts);
|
_renderLongValue("Warm Water # starts", "times", EMS_Boiler.wWStarts);
|
||||||
if (EMS_Boiler.wWWorkM != EMS_VALUE_LONG_NOTSET) {
|
if (EMS_Boiler.wWWorkM != EMS_VALUE_LONG_NOTSET) {
|
||||||
@@ -413,8 +465,8 @@ void showInfo() {
|
|||||||
|
|
||||||
// UBAMonitorFast
|
// UBAMonitorFast
|
||||||
_renderIntValue("Selected flow temperature", "C", EMS_Boiler.selFlowTemp);
|
_renderIntValue("Selected flow temperature", "C", EMS_Boiler.selFlowTemp);
|
||||||
_renderShortValue("Current flow temperature", "C", EMS_Boiler.curFlowTemp);
|
_renderUShortValue("Current flow temperature", "C", EMS_Boiler.curFlowTemp);
|
||||||
_renderShortValue("Return temperature", "C", EMS_Boiler.retTemp);
|
_renderUShortValue("Return temperature", "C", EMS_Boiler.retTemp);
|
||||||
_renderBoolValue("Gas", EMS_Boiler.burnGas);
|
_renderBoolValue("Gas", EMS_Boiler.burnGas);
|
||||||
_renderBoolValue("Boiler pump", EMS_Boiler.heatPmp);
|
_renderBoolValue("Boiler pump", EMS_Boiler.heatPmp);
|
||||||
_renderBoolValue("Fan", EMS_Boiler.fanWork);
|
_renderBoolValue("Fan", EMS_Boiler.fanWork);
|
||||||
@@ -439,7 +491,7 @@ void showInfo() {
|
|||||||
if (EMS_Boiler.extTemp != EMS_VALUE_SHORT_NOTSET) {
|
if (EMS_Boiler.extTemp != EMS_VALUE_SHORT_NOTSET) {
|
||||||
_renderShortValue("Outside temperature", "C", EMS_Boiler.extTemp);
|
_renderShortValue("Outside temperature", "C", EMS_Boiler.extTemp);
|
||||||
}
|
}
|
||||||
_renderShortValue("Boiler temperature", "C", EMS_Boiler.boilTemp);
|
_renderUShortValue("Boiler temperature", "C", EMS_Boiler.boilTemp);
|
||||||
_renderIntValue("Pump modulation", "%", EMS_Boiler.pumpMod);
|
_renderIntValue("Pump modulation", "%", EMS_Boiler.pumpMod);
|
||||||
_renderLongValue("Burner # starts", "times", EMS_Boiler.burnStarts);
|
_renderLongValue("Burner # starts", "times", EMS_Boiler.burnStarts);
|
||||||
if (EMS_Boiler.burnWorkMin != EMS_VALUE_LONG_NOTSET) {
|
if (EMS_Boiler.burnWorkMin != EMS_VALUE_LONG_NOTSET) {
|
||||||
@@ -470,13 +522,15 @@ void showInfo() {
|
|||||||
_renderShortValue("Bottom temperature", "C", EMS_SolarModule.bottomTemp);
|
_renderShortValue("Bottom temperature", "C", EMS_SolarModule.bottomTemp);
|
||||||
_renderIntValue("Pump modulation", "%", EMS_SolarModule.pumpModulation);
|
_renderIntValue("Pump modulation", "%", EMS_SolarModule.pumpModulation);
|
||||||
_renderBoolValue("Pump active", EMS_SolarModule.pump);
|
_renderBoolValue("Pump active", EMS_SolarModule.pump);
|
||||||
|
if (EMS_SolarModule.pumpWorkMin != EMS_VALUE_LONG_NOTSET) {
|
||||||
myDebug_P(PSTR(" Pump working time: %d days %d hours %d minutes"),
|
myDebug_P(PSTR(" Pump working time: %d days %d hours %d minutes"),
|
||||||
EMS_SolarModule.pumpWorkMin / 1440,
|
EMS_SolarModule.pumpWorkMin / 1440,
|
||||||
(EMS_SolarModule.pumpWorkMin % 1440) / 60,
|
(EMS_SolarModule.pumpWorkMin % 1440) / 60,
|
||||||
EMS_SolarModule.pumpWorkMin % 60);
|
EMS_SolarModule.pumpWorkMin % 60);
|
||||||
_renderShortValue("Energy Last Hour", "Wh", EMS_SolarModule.EnergyLastHour, 1); // *10
|
}
|
||||||
_renderShortValue("Energy Today", "Wh", EMS_SolarModule.EnergyToday, 0);
|
_renderUShortValue("Energy Last Hour", "Wh", EMS_SolarModule.EnergyLastHour, 1); // *10
|
||||||
_renderShortValue("Energy Total", "kWH", EMS_SolarModule.EnergyTotal, 1); // *10
|
_renderUShortValue("Energy Today", "Wh", EMS_SolarModule.EnergyToday, 0);
|
||||||
|
_renderUShortValue("Energy Total", "kWH", EMS_SolarModule.EnergyTotal, 1); // *10
|
||||||
}
|
}
|
||||||
|
|
||||||
// For HeatPumps
|
// For HeatPumps
|
||||||
@@ -633,17 +687,17 @@ void publishValues(bool force) {
|
|||||||
|
|
||||||
if (EMS_Boiler.extTemp != EMS_VALUE_SHORT_NOTSET)
|
if (EMS_Boiler.extTemp != EMS_VALUE_SHORT_NOTSET)
|
||||||
rootBoiler["outdoorTemp"] = (double)EMS_Boiler.extTemp / 10;
|
rootBoiler["outdoorTemp"] = (double)EMS_Boiler.extTemp / 10;
|
||||||
if (EMS_Boiler.wWCurTmp != EMS_VALUE_SHORT_NOTSET)
|
if (EMS_Boiler.wWCurTmp != EMS_VALUE_USHORT_NOTSET)
|
||||||
rootBoiler["wWCurTmp"] = (double)EMS_Boiler.wWCurTmp / 10;
|
rootBoiler["wWCurTmp"] = (double)EMS_Boiler.wWCurTmp / 10;
|
||||||
if (EMS_Boiler.wWCurFlow != EMS_VALUE_INT_NOTSET)
|
if (EMS_Boiler.wWCurFlow != EMS_VALUE_INT_NOTSET)
|
||||||
rootBoiler["wWCurFlow"] = (double)EMS_Boiler.wWCurFlow / 10;
|
rootBoiler["wWCurFlow"] = (double)EMS_Boiler.wWCurFlow / 10;
|
||||||
if (EMS_Boiler.curFlowTemp != EMS_VALUE_SHORT_NOTSET)
|
if (EMS_Boiler.curFlowTemp != EMS_VALUE_USHORT_NOTSET)
|
||||||
rootBoiler["curFlowTemp"] = (double)EMS_Boiler.curFlowTemp / 10;
|
rootBoiler["curFlowTemp"] = (double)EMS_Boiler.curFlowTemp / 10;
|
||||||
if (EMS_Boiler.retTemp != EMS_VALUE_SHORT_NOTSET)
|
if (EMS_Boiler.retTemp != EMS_VALUE_USHORT_NOTSET)
|
||||||
rootBoiler["retTemp"] = (double)EMS_Boiler.retTemp / 10;
|
rootBoiler["retTemp"] = (double)EMS_Boiler.retTemp / 10;
|
||||||
if (EMS_Boiler.sysPress != EMS_VALUE_INT_NOTSET)
|
if (EMS_Boiler.sysPress != EMS_VALUE_INT_NOTSET)
|
||||||
rootBoiler["sysPress"] = (double)EMS_Boiler.sysPress / 10;
|
rootBoiler["sysPress"] = (double)EMS_Boiler.sysPress / 10;
|
||||||
if (EMS_Boiler.boilTemp != EMS_VALUE_SHORT_NOTSET)
|
if (EMS_Boiler.boilTemp != EMS_VALUE_USHORT_NOTSET)
|
||||||
rootBoiler["boilTemp"] = (double)EMS_Boiler.boilTemp / 10;
|
rootBoiler["boilTemp"] = (double)EMS_Boiler.boilTemp / 10;
|
||||||
|
|
||||||
if (EMS_Boiler.wWActivated != EMS_VALUE_INT_NOTSET)
|
if (EMS_Boiler.wWActivated != EMS_VALUE_INT_NOTSET)
|
||||||
@@ -796,13 +850,13 @@ void publishValues(bool force) {
|
|||||||
rootSM[SM_PUMPWORKMIN] = (double)EMS_SolarModule.pumpWorkMin;
|
rootSM[SM_PUMPWORKMIN] = (double)EMS_SolarModule.pumpWorkMin;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EMS_SolarModule.EnergyLastHour != EMS_VALUE_SHORT_NOTSET)
|
if (EMS_SolarModule.EnergyLastHour != EMS_VALUE_USHORT_NOTSET)
|
||||||
rootSM[SM_ENERGYLASTHOUR] = (double)EMS_SolarModule.EnergyLastHour / 10;
|
rootSM[SM_ENERGYLASTHOUR] = (double)EMS_SolarModule.EnergyLastHour / 10;
|
||||||
|
|
||||||
if (EMS_SolarModule.EnergyToday != EMS_VALUE_SHORT_NOTSET)
|
if (EMS_SolarModule.EnergyToday != EMS_VALUE_USHORT_NOTSET)
|
||||||
rootSM[SM_ENERGYTODAY] = EMS_SolarModule.EnergyToday;
|
rootSM[SM_ENERGYTODAY] = EMS_SolarModule.EnergyToday;
|
||||||
|
|
||||||
if (EMS_SolarModule.EnergyTotal != EMS_VALUE_SHORT_NOTSET)
|
if (EMS_SolarModule.EnergyTotal != EMS_VALUE_USHORT_NOTSET)
|
||||||
rootSM[SM_ENERGYTOTAL] = (double)EMS_SolarModule.EnergyTotal / 10;
|
rootSM[SM_ENERGYTOTAL] = (double)EMS_SolarModule.EnergyTotal / 10;
|
||||||
|
|
||||||
data[0] = '\0'; // reset data for next package
|
data[0] = '\0'; // reset data for next package
|
||||||
@@ -1035,7 +1089,7 @@ bool FSCallback(MYESP_FSACTION action, const JsonObject json) {
|
|||||||
EMSESP_Status.led = json["led"];
|
EMSESP_Status.led = json["led"];
|
||||||
EMSESP_Status.led_gpio = json["led_gpio"] | EMSESP_LED_GPIO;
|
EMSESP_Status.led_gpio = json["led_gpio"] | EMSESP_LED_GPIO;
|
||||||
EMSESP_Status.dallas_gpio = json["dallas_gpio"] | EMSESP_DALLAS_GPIO;
|
EMSESP_Status.dallas_gpio = json["dallas_gpio"] | EMSESP_DALLAS_GPIO;
|
||||||
EMSESP_Status.dallas_parasite = json["dallas_parasite"];
|
EMSESP_Status.dallas_parasite = json["dallas_parasite"] | EMSESP_DALLAS_PARASITE;
|
||||||
|
|
||||||
EMS_Thermostat.device_id = json["thermostat_type"] | EMSESP_THERMOSTAT_TYPE;
|
EMS_Thermostat.device_id = json["thermostat_type"] | EMSESP_THERMOSTAT_TYPE;
|
||||||
EMS_Boiler.device_id = json["boiler_type"] | EMSESP_BOILER_TYPE;
|
EMS_Boiler.device_id = json["boiler_type"] | EMSESP_BOILER_TYPE;
|
||||||
@@ -1721,13 +1775,6 @@ void setup() {
|
|||||||
// web custom settings
|
// web custom settings
|
||||||
myESP.setWeb(WebCallback);
|
myESP.setWeb(WebCallback);
|
||||||
|
|
||||||
// serial off as default for fresh installs
|
|
||||||
#ifdef NO_SERIAL
|
|
||||||
myESP.setUseSerial(false);
|
|
||||||
#else
|
|
||||||
myESP.setUseSerial(true);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// start up all the services
|
// start up all the services
|
||||||
myESP.begin(APP_HOSTNAME, APP_NAME, APP_VERSION);
|
myESP.begin(APP_HOSTNAME, APP_NAME, APP_VERSION);
|
||||||
|
|
||||||
|
|||||||
19
src/ems.cpp
19
src/ems.cpp
@@ -269,8 +269,8 @@ void ems_init() {
|
|||||||
|
|
||||||
// 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_SHORT_NOTSET; // Current flow temperature
|
EMS_Boiler.curFlowTemp = EMS_VALUE_USHORT_NOTSET; // Current flow temperature
|
||||||
EMS_Boiler.retTemp = EMS_VALUE_SHORT_NOTSET; // Return temperature
|
EMS_Boiler.retTemp = EMS_VALUE_USHORT_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
|
||||||
@@ -286,14 +286,14 @@ void ems_init() {
|
|||||||
|
|
||||||
// UBAMonitorSlow
|
// UBAMonitorSlow
|
||||||
EMS_Boiler.extTemp = EMS_VALUE_SHORT_NOTSET; // Outside temperature
|
EMS_Boiler.extTemp = EMS_VALUE_SHORT_NOTSET; // Outside temperature
|
||||||
EMS_Boiler.boilTemp = EMS_VALUE_SHORT_NOTSET; // Boiler temperature
|
EMS_Boiler.boilTemp = EMS_VALUE_USHORT_NOTSET; // Boiler temperature
|
||||||
EMS_Boiler.pumpMod = EMS_VALUE_INT_NOTSET; // Pump modulation
|
EMS_Boiler.pumpMod = EMS_VALUE_INT_NOTSET; // Pump modulation
|
||||||
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
|
||||||
|
|
||||||
// UBAMonitorWWMessage
|
// UBAMonitorWWMessage
|
||||||
EMS_Boiler.wWCurTmp = EMS_VALUE_SHORT_NOTSET; // Warm Water current temperature
|
EMS_Boiler.wWCurTmp = EMS_VALUE_USHORT_NOTSET; // Warm Water current temperature
|
||||||
EMS_Boiler.wWStarts = EMS_VALUE_LONG_NOTSET; // Warm Water # starts
|
EMS_Boiler.wWStarts = EMS_VALUE_LONG_NOTSET; // Warm Water # starts
|
||||||
EMS_Boiler.wWWorkM = EMS_VALUE_LONG_NOTSET; // Warm Water # minutes
|
EMS_Boiler.wWWorkM = EMS_VALUE_LONG_NOTSET; // Warm Water # minutes
|
||||||
EMS_Boiler.wWOneTime = EMS_VALUE_INT_NOTSET; // Warm Water one time function on/off
|
EMS_Boiler.wWOneTime = EMS_VALUE_INT_NOTSET; // Warm Water one time function on/off
|
||||||
@@ -312,13 +312,14 @@ void ems_init() {
|
|||||||
EMS_SolarModule.bottomTemp = EMS_VALUE_SHORT_NOTSET; // bottom temp from SM10/SM100
|
EMS_SolarModule.bottomTemp = EMS_VALUE_SHORT_NOTSET; // bottom temp from SM10/SM100
|
||||||
EMS_SolarModule.pumpModulation = EMS_VALUE_INT_NOTSET; // modulation solar pump SM10/SM100
|
EMS_SolarModule.pumpModulation = EMS_VALUE_INT_NOTSET; // modulation solar pump SM10/SM100
|
||||||
EMS_SolarModule.pump = EMS_VALUE_INT_NOTSET; // pump active
|
EMS_SolarModule.pump = EMS_VALUE_INT_NOTSET; // pump active
|
||||||
EMS_SolarModule.EnergyLastHour = EMS_VALUE_SHORT_NOTSET;
|
EMS_SolarModule.EnergyLastHour = EMS_VALUE_USHORT_NOTSET;
|
||||||
EMS_SolarModule.EnergyToday = EMS_VALUE_SHORT_NOTSET;
|
EMS_SolarModule.EnergyToday = EMS_VALUE_USHORT_NOTSET;
|
||||||
EMS_SolarModule.EnergyTotal = EMS_VALUE_SHORT_NOTSET;
|
EMS_SolarModule.EnergyTotal = EMS_VALUE_USHORT_NOTSET;
|
||||||
EMS_SolarModule.device_id = EMS_ID_NONE;
|
EMS_SolarModule.device_id = EMS_ID_NONE;
|
||||||
EMS_SolarModule.model_id = EMS_MODEL_NONE;
|
EMS_SolarModule.model_id = EMS_MODEL_NONE;
|
||||||
EMS_SolarModule.product_id = EMS_ID_NONE;
|
EMS_SolarModule.product_id = EMS_ID_NONE;
|
||||||
EMS_SolarModule.pumpWorkMin = EMS_VALUE_LONG_NOTSET;
|
EMS_SolarModule.pumpWorkMin = EMS_VALUE_LONG_NOTSET;
|
||||||
|
EMS_SolarModule.setpoint_maxBottomTemp = EMS_VALUE_SHORT_NOTSET;
|
||||||
|
|
||||||
// Other EMS devices values
|
// Other EMS devices values
|
||||||
EMS_HeatPump.HPModulation = EMS_VALUE_INT_NOTSET;
|
EMS_HeatPump.HPModulation = EMS_VALUE_INT_NOTSET;
|
||||||
@@ -1480,6 +1481,7 @@ void _process_SM100Energy(_EMS_RxTelegram * EMS_RxTelegram) {
|
|||||||
*/
|
*/
|
||||||
void _process_HPMonitor1(_EMS_RxTelegram * EMS_RxTelegram) {
|
void _process_HPMonitor1(_EMS_RxTelegram * EMS_RxTelegram) {
|
||||||
EMS_HeatPump.HPModulation = _toByte(14); // modulation %
|
EMS_HeatPump.HPModulation = _toByte(14); // modulation %
|
||||||
|
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1488,6 +1490,7 @@ void _process_HPMonitor1(_EMS_RxTelegram * EMS_RxTelegram) {
|
|||||||
*/
|
*/
|
||||||
void _process_HPMonitor2(_EMS_RxTelegram * EMS_RxTelegram) {
|
void _process_HPMonitor2(_EMS_RxTelegram * EMS_RxTelegram) {
|
||||||
EMS_HeatPump.HPSpeed = _toByte(25); // speed %
|
EMS_HeatPump.HPSpeed = _toByte(25); // speed %
|
||||||
|
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1499,7 +1502,7 @@ void _process_ISM1StatusMessage(_EMS_RxTelegram * EMS_RxTelegram) {
|
|||||||
// e.g. B0 00 FF 00 00 03 32 00 00 00 00 13 00 D6 00 00 00 FB D0 F0
|
// e.g. B0 00 FF 00 00 03 32 00 00 00 00 13 00 D6 00 00 00 FB D0 F0
|
||||||
EMS_SolarModule.collectorTemp = _toShort(4); // Collector Temperature
|
EMS_SolarModule.collectorTemp = _toShort(4); // Collector Temperature
|
||||||
EMS_SolarModule.bottomTemp = _toShort(6); // Temperature Bottom of Solar Boiler
|
EMS_SolarModule.bottomTemp = _toShort(6); // Temperature Bottom of Solar Boiler
|
||||||
EMS_SolarModule.EnergyLastHour = _toShort(2) * 10; // Solar Energy produced in last hour
|
EMS_SolarModule.EnergyLastHour = _toShort(2); // Solar Energy produced in last hour - is * 10 and handled in ems-esp.cpp
|
||||||
EMS_SolarModule.pump = _bitRead(8, 0); // Solar pump on (1) or off (0)
|
EMS_SolarModule.pump = _bitRead(8, 0); // Solar pump on (1) or off (0)
|
||||||
EMS_SolarModule.pumpWorkMin = _toLong(10);
|
EMS_SolarModule.pumpWorkMin = _toLong(10);
|
||||||
}
|
}
|
||||||
|
|||||||
17
src/ems.h
17
src/ems.h
@@ -37,8 +37,8 @@
|
|||||||
#define EMS_VALUE_INT_ON 1 // boolean true
|
#define EMS_VALUE_INT_ON 1 // boolean true
|
||||||
#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 unsigned ints/bytes
|
#define EMS_VALUE_INT_NOTSET 0xFF // for 8-bit unsigned ints/bytes
|
||||||
//#define EMS_VALUE_SHORT_NOTSET 0x8000 // for 2-byte signed shorts
|
|
||||||
#define EMS_VALUE_SHORT_NOTSET -32768 // for 2-byte signed shorts
|
#define EMS_VALUE_SHORT_NOTSET -32768 // for 2-byte signed shorts
|
||||||
|
#define EMS_VALUE_USHORT_NOTSET 0xFFFF // 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_THERMOSTAT_WRITE_YES true
|
#define EMS_THERMOSTAT_WRITE_YES true
|
||||||
@@ -188,7 +188,6 @@ typedef struct {
|
|||||||
bool write_supported;
|
bool write_supported;
|
||||||
} _Thermostat_Type;
|
} _Thermostat_Type;
|
||||||
|
|
||||||
|
|
||||||
// for consolidating all types
|
// for consolidating all types
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint8_t product_id;
|
uint8_t product_id;
|
||||||
@@ -209,8 +208,8 @@ typedef struct { // UBAParameterWW
|
|||||||
|
|
||||||
// UBAMonitorFast
|
// UBAMonitorFast
|
||||||
uint8_t selFlowTemp; // Selected flow temperature
|
uint8_t selFlowTemp; // Selected flow temperature
|
||||||
int16_t curFlowTemp; // Current flow temperature
|
uint16_t curFlowTemp; // Current flow temperature
|
||||||
int16_t retTemp; // Return temperature
|
uint16_t 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
|
||||||
@@ -226,14 +225,14 @@ typedef struct { // UBAParameterWW
|
|||||||
|
|
||||||
// UBAMonitorSlow
|
// UBAMonitorSlow
|
||||||
int16_t extTemp; // Outside temperature
|
int16_t extTemp; // Outside temperature
|
||||||
int16_t boilTemp; // Boiler temperature
|
uint16_t boilTemp; // Boiler temperature
|
||||||
uint8_t pumpMod; // Pump modulation
|
uint8_t pumpMod; // Pump modulation
|
||||||
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
|
||||||
|
|
||||||
// UBAMonitorWWMessage
|
// UBAMonitorWWMessage
|
||||||
int16_t wWCurTmp; // Warm Water current temperature:
|
uint16_t wWCurTmp; // Warm Water current temperature
|
||||||
uint32_t wWStarts; // Warm Water # starts
|
uint32_t wWStarts; // Warm Water # starts
|
||||||
uint32_t wWWorkM; // Warm Water # minutes
|
uint32_t wWWorkM; // Warm Water # minutes
|
||||||
uint8_t wWOneTime; // Warm Water one time function on/off
|
uint8_t wWOneTime; // Warm Water one time function on/off
|
||||||
@@ -284,9 +283,9 @@ typedef struct {
|
|||||||
uint8_t pumpModulation; // modulation solar pump
|
uint8_t pumpModulation; // modulation solar pump
|
||||||
uint8_t pump; // pump active
|
uint8_t pump; // pump active
|
||||||
int16_t setpoint_maxBottomTemp; // setpoint for maximum collector temp
|
int16_t setpoint_maxBottomTemp; // setpoint for maximum collector temp
|
||||||
int16_t EnergyLastHour;
|
uint16_t EnergyLastHour;
|
||||||
int16_t EnergyToday;
|
uint16_t EnergyToday;
|
||||||
int16_t EnergyTotal;
|
uint16_t EnergyTotal;
|
||||||
uint32_t pumpWorkMin; // Total solar pump operating time
|
uint32_t pumpWorkMin; // Total solar pump operating time
|
||||||
uint8_t device_id; // the device ID of the Solar Module
|
uint8_t device_id; // the device ID of the Solar Module
|
||||||
uint8_t model_id; // Solar Module
|
uint8_t model_id; // Solar Module
|
||||||
|
|||||||
@@ -207,9 +207,7 @@ const _Other_Type Other_Types[] = {
|
|||||||
|
|
||||||
// heatpump
|
// heatpump
|
||||||
// format is PRODUCT ID, DEVICE ID, DESCRIPTION
|
// format is PRODUCT ID, DEVICE ID, DESCRIPTION
|
||||||
const _HeatPump_Type HeatPump_Types[] = {
|
const _HeatPump_Type HeatPump_Types[] = {{252, EMS_ID_HP, "HeatPump Module"}};
|
||||||
{252, EMS_ID_HP, "HeatPump Module"}
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Known thermostat types and their capabilities
|
* Known thermostat types and their capabilities
|
||||||
|
|||||||
@@ -51,7 +51,8 @@ static const char * TEST_DATA[] = {
|
|||||||
"08 00 E5 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0A", // test 46 - heatpump Enviline
|
"08 00 E5 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0A", // test 46 - heatpump Enviline
|
||||||
"38 10 FF 00 03 2B 00 C7 07 C3 01", // test 47 - heatpump Enviline
|
"38 10 FF 00 03 2B 00 C7 07 C3 01", // test 47 - heatpump Enviline
|
||||||
"08 0B 19 00 00 F7 80 00 80 00 00 00 00 00 03 58 97 0C 7B 1F 00 00 00 06 C4 DF 02 64 48 80 00", // test 48 - outdoor temp check
|
"08 0B 19 00 00 F7 80 00 80 00 00 00 00 00 03 58 97 0C 7B 1F 00 00 00 06 C4 DF 02 64 48 80 00", // test 48 - outdoor temp check
|
||||||
"88 00 19 00 00 DC 80 00 80 00 FF FF 00 00 00 21 9A 06 E1 7C 00 00 00 06 C2 13 00 1E 90 80 00" // test 49 - check max length
|
"88 00 19 00 00 DC 80 00 80 00 FF FF 00 00 00 21 9A 06 E1 7C 00 00 00 06 C2 13 00 1E 90 80 00", // test 49 - check max length
|
||||||
|
"30 00 FF 00 02 8E 00 00 41 82 00 00 28 36 00 00 82 21" // test 50 - SM100
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,5 +6,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define APP_NAME "EMS-ESP"
|
#define APP_NAME "EMS-ESP"
|
||||||
#define APP_VERSION "1.8.1b10"
|
#define APP_VERSION "1.8.1b11"
|
||||||
#define APP_HOSTNAME "ems-esp"
|
#define APP_HOSTNAME "ems-esp"
|
||||||
|
|||||||
Reference in New Issue
Block a user