SM10 changes

This commit is contained in:
proddy
2019-03-20 18:10:18 +01:00
parent a72276d244
commit 5079a3914f
3 changed files with 19 additions and 21 deletions

View File

@@ -392,13 +392,9 @@ void showInfo() {
// For SM10 Solar Module // For SM10 Solar Module
if (EMS_Other.SM10) { if (EMS_Other.SM10) {
_renderIntValue("SM10 modulation pump", "%", EMS_Other.SM10modulationSolarPump);
_renderFloatValue("SM10 collector temperature", "C", EMS_Other.SM10collectorTemp); _renderFloatValue("SM10 collector temperature", "C", EMS_Other.SM10collectorTemp);
_renderBoolValue("SM10 pump", EMS_Other.SM10pumpOn); _renderFloatValue("SM10 bottom temperature", "C", EMS_Other.SM10bottomTemp);
myDebug(" SM10 uptime: %d days %d hours %d minutes", _renderIntValue("SM10 pump", "%", EMS_Other.SM10pumpModulation);
EMS_Other.SM10Uptime / 1440,
(EMS_Other.SM10Uptime % 1440) / 60,
EMS_Other.SM10Uptime % 60);
} }
myDebug(""); // newline myDebug(""); // newline

View File

@@ -235,10 +235,9 @@ void ems_init() {
EMS_Boiler.pump_mod_min = EMS_VALUE_INT_NOTSET; // Boiler circuit pump modulation min. power EMS_Boiler.pump_mod_min = EMS_VALUE_INT_NOTSET; // Boiler circuit pump modulation min. power
// Other EMS devices values // Other EMS devices values
EMS_Other.SM10collectorTemp = EMS_VALUE_FLOAT_NOTSET; // collector temp from SM10 EMS_Other.SM10collectorTemp = EMS_VALUE_FLOAT_NOTSET; // collector temp from SM10
EMS_Other.SM10modulationSolarPump = EMS_VALUE_INT_NOTSET; // modulation solar pump EMS_Other.SM10bottomTemp = EMS_VALUE_FLOAT_NOTSET; // bottom temp from SM10
EMS_Other.SM10pumpOn = EMS_VALUE_INT_NOTSET; // SM10 pump on/off EMS_Other.SM10pumpModulation = EMS_VALUE_INT_NOTSET; // modulation solar pump SM10
EMS_Other.SM10Uptime = EMS_VALUE_LONG_NOTSET; // SM10 uptime
// calculated values // calculated values
EMS_Boiler.tapwaterActive = EMS_VALUE_INT_NOTSET; // Hot tap water is on/off EMS_Boiler.tapwaterActive = EMS_VALUE_INT_NOTSET; // Hot tap water is on/off
@@ -712,6 +711,8 @@ void _ems_processTelegram(_EMS_RxTelegram EMS_RxTelegram) {
strlcpy(output_str, "Boiler", sizeof(output_str)); strlcpy(output_str, "Boiler", sizeof(output_str));
} else if (src == EMS_Thermostat.type_id) { } else if (src == EMS_Thermostat.type_id) {
strlcpy(output_str, "Thermostat", sizeof(output_str)); strlcpy(output_str, "Thermostat", sizeof(output_str));
} else if (src == EMS_ID_SM10) {
strlcpy(output_str, "SM10", sizeof(output_str));
} else { } else {
strlcpy(output_str, "0x", sizeof(output_str)); strlcpy(output_str, "0x", sizeof(output_str));
strlcat(output_str, _hextoa(src, buffer), sizeof(output_str)); strlcat(output_str, _hextoa(src, buffer), sizeof(output_str));
@@ -729,6 +730,9 @@ void _ems_processTelegram(_EMS_RxTelegram EMS_RxTelegram) {
} else if (dest == EMS_Boiler.type_id) { } else if (dest == EMS_Boiler.type_id) {
strlcat(output_str, "Boiler", sizeof(output_str)); strlcat(output_str, "Boiler", sizeof(output_str));
strlcpy(color_s, COLOR_MAGENTA, sizeof(color_s)); strlcpy(color_s, COLOR_MAGENTA, sizeof(color_s));
} else if (dest == EMS_ID_SM10) {
strlcat(output_str, "SM10", sizeof(output_str));
strlcpy(color_s, COLOR_MAGENTA, sizeof(color_s));
} else if (dest == EMS_Thermostat.type_id) { } else if (dest == EMS_Thermostat.type_id) {
strlcat(output_str, "Thermostat", sizeof(output_str)); strlcat(output_str, "Thermostat", sizeof(output_str));
strlcpy(color_s, COLOR_MAGENTA, sizeof(color_s)); strlcpy(color_s, COLOR_MAGENTA, sizeof(color_s));
@@ -1329,10 +1333,9 @@ void _ems_setThermostatModel(uint8_t thermostat_modelid) {
*/ */
void _process_SM10Monitor(uint8_t type, uint8_t * data, uint8_t length) { void _process_SM10Monitor(uint8_t type, uint8_t * data, uint8_t length) {
// TODO: polish off // TODO: polish off
EMS_Other.SM10collectorTemp = _toFloat(2, data); // collector temp from SM10 EMS_Other.SM10collectorTemp = _toFloat(2, data); // collector temp from SM10
EMS_Other.SM10modulationSolarPump = data[4]; // modulation solar pump EMS_Other.SM10bottomTemp = _toFloat(5, data); // bottom temp from SM10
EMS_Other.SM10pumpOn = bitRead(data[6], 1); // SM10 pump on/off EMS_Other.SM10pumpModulation = data[4]; // modulation solar pump
EMS_Other.SM10Uptime = _toLong(8, data); // SM10 uptime
} }

View File

@@ -20,8 +20,8 @@
#define EMS_MIN_TELEGRAM_LENGTH 6 // minimal length for a validation telegram, including CRC #define EMS_MIN_TELEGRAM_LENGTH 6 // minimal length for a validation telegram, including CRC
// max length of a telegram, including CRC, for Rx and Tx. Data size is 32, so reserving 40 to be safe // max length of a telegram, including CRC, for Rx and Tx.
#define EMS_MAX_TELEGRAM_LENGTH 40 #define EMS_MAX_TELEGRAM_LENGTH 32
// default values // default values
#define EMS_VALUE_INT_ON 1 // boolean true #define EMS_VALUE_INT_ON 1 // boolean true
@@ -228,11 +228,10 @@ typedef struct { // UBAParameterWW
*/ */
typedef struct { typedef struct {
// SM10 Solar Module - SM10Monitor // SM10 Solar Module - SM10Monitor
bool SM10; // set true if there is a SM10 available bool SM10; // set true if there is a SM10 available
float SM10collectorTemp; // collector temp from SM10 float SM10collectorTemp; // collector temp from SM10
uint8_t SM10modulationSolarPump; // modulation solar pump float SM10bottomTemp; // bottom temp from SM10
uint8_t SM10pumpOn; // SM10 pump on/off uint8_t SM10pumpModulation; // modulation solar pump
uint32_t SM10Uptime; // SM10 uptime
} _EMS_Other; } _EMS_Other;
// Thermostat data // Thermostat data