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
if (EMS_Other.SM10) {
_renderIntValue("SM10 modulation pump", "%", EMS_Other.SM10modulationSolarPump);
_renderFloatValue("SM10 collector temperature", "C", EMS_Other.SM10collectorTemp);
_renderBoolValue("SM10 pump", EMS_Other.SM10pumpOn);
myDebug(" SM10 uptime: %d days %d hours %d minutes",
EMS_Other.SM10Uptime / 1440,
(EMS_Other.SM10Uptime % 1440) / 60,
EMS_Other.SM10Uptime % 60);
_renderFloatValue("SM10 bottom temperature", "C", EMS_Other.SM10bottomTemp);
_renderIntValue("SM10 pump", "%", EMS_Other.SM10pumpModulation);
}
myDebug(""); // newline

View File

@@ -236,9 +236,8 @@ void ems_init() {
// Other EMS devices values
EMS_Other.SM10collectorTemp = EMS_VALUE_FLOAT_NOTSET; // collector temp from SM10
EMS_Other.SM10modulationSolarPump = EMS_VALUE_INT_NOTSET; // modulation solar pump
EMS_Other.SM10pumpOn = EMS_VALUE_INT_NOTSET; // SM10 pump on/off
EMS_Other.SM10Uptime = EMS_VALUE_LONG_NOTSET; // SM10 uptime
EMS_Other.SM10bottomTemp = EMS_VALUE_FLOAT_NOTSET; // bottom temp from SM10
EMS_Other.SM10pumpModulation = EMS_VALUE_INT_NOTSET; // modulation solar pump SM10
// calculated values
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));
} else if (src == EMS_Thermostat.type_id) {
strlcpy(output_str, "Thermostat", sizeof(output_str));
} else if (src == EMS_ID_SM10) {
strlcpy(output_str, "SM10", sizeof(output_str));
} else {
strlcpy(output_str, "0x", 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) {
strlcat(output_str, "Boiler", sizeof(output_str));
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) {
strlcat(output_str, "Thermostat", sizeof(output_str));
strlcpy(color_s, COLOR_MAGENTA, sizeof(color_s));
@@ -1330,9 +1334,8 @@ void _ems_setThermostatModel(uint8_t thermostat_modelid) {
void _process_SM10Monitor(uint8_t type, uint8_t * data, uint8_t length) {
// TODO: polish off
EMS_Other.SM10collectorTemp = _toFloat(2, data); // collector temp from SM10
EMS_Other.SM10modulationSolarPump = data[4]; // modulation solar pump
EMS_Other.SM10pumpOn = bitRead(data[6], 1); // SM10 pump on/off
EMS_Other.SM10Uptime = _toLong(8, data); // SM10 uptime
EMS_Other.SM10bottomTemp = _toFloat(5, data); // bottom temp from SM10
EMS_Other.SM10pumpModulation = data[4]; // modulation solar pump
}

View File

@@ -20,8 +20,8 @@
#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
#define EMS_MAX_TELEGRAM_LENGTH 40
// max length of a telegram, including CRC, for Rx and Tx.
#define EMS_MAX_TELEGRAM_LENGTH 32
// default values
#define EMS_VALUE_INT_ON 1 // boolean true
@@ -230,9 +230,8 @@ typedef struct {
// SM10 Solar Module - SM10Monitor
bool SM10; // set true if there is a SM10 available
float SM10collectorTemp; // collector temp from SM10
uint8_t SM10modulationSolarPump; // modulation solar pump
uint8_t SM10pumpOn; // SM10 pump on/off
uint32_t SM10Uptime; // SM10 uptime
float SM10bottomTemp; // bottom temp from SM10
uint8_t SM10pumpModulation; // modulation solar pump
} _EMS_Other;
// Thermostat data