Sm100 fixes

This commit is contained in:
proddy
2019-05-04 10:04:29 +02:00
parent 7dcf19c59f
commit e6aede8396
2 changed files with 11 additions and 8 deletions

View File

@@ -1323,12 +1323,10 @@ void _process_SM10Monitor(_EMS_RxTelegram * EMS_RxTelegram) {
* SM100Monitor - type 0x0262 EMS+ * SM100Monitor - type 0x0262 EMS+
*/ */
void _process_SM100Monitor(_EMS_RxTelegram * EMS_RxTelegram) { void _process_SM100Monitor(_EMS_RxTelegram * EMS_RxTelegram) {
if (EMS_RxTelegram->data_length > 2) { // only process the complete telegram, not partial
if (EMS_RxTelegram->offset == 0) {
EMS_Other.SMcollectorTemp = _toShort(0); // collector temp from SM100, is *10 EMS_Other.SMcollectorTemp = _toShort(0); // collector temp from SM100, is *10
EMS_Other.SMbottomTemp = _toShort(2); // bottom temp from SM100, is *10 EMS_Other.SMbottomTemp = _toShort(2); // bottom temp from SM100, is *10
} else {
// only one value sent, assume its the collector temp
EMS_Other.SMcollectorTemp = _toShort(0); // collector temp from SM100, is *10
} }
EMS_Other.SM = true; EMS_Other.SM = true;
@@ -1336,7 +1334,7 @@ void _process_SM100Monitor(_EMS_RxTelegram * EMS_RxTelegram) {
} }
/* /*
* SM100Status - type 0x0264 EMS+ * SM100Status - type 0x0264 EMS+ for pump modulation
*/ */
void _process_SM100Status(_EMS_RxTelegram * EMS_RxTelegram) { void _process_SM100Status(_EMS_RxTelegram * EMS_RxTelegram) {
EMS_Other.SMpumpModulation = _toByte(9); // modulation solar pump EMS_Other.SMpumpModulation = _toByte(9); // modulation solar pump
@@ -1346,10 +1344,14 @@ void _process_SM100Status(_EMS_RxTelegram * EMS_RxTelegram) {
} }
/* /*
* SM100Status2 - type 0x026A EMS+ for pump on/off * SM100Status2 - type 0x026A EMS+ for pump on/off at offset 0x0A
*/ */
void _process_SM100Status2(_EMS_RxTelegram * EMS_RxTelegram) { void _process_SM100Status2(_EMS_RxTelegram * EMS_RxTelegram) {
if (EMS_RxTelegram->data_length == 1) { // check for complete telegram
if (EMS_RxTelegram->offset == 0) {
EMS_Other.SMpump = _bitRead(9, 2); // 03=off 04=on at offset 10 which is byte 9
} else if (EMS_RxTelegram->offset == 0x0A) {
// or short telegram with a single byte at offset 0A
EMS_Other.SMpump = _bitRead(0, 2); // 03=off 04=on EMS_Other.SMpump = _bitRead(0, 2); // 03=off 04=on
} }

View File

@@ -42,7 +42,8 @@ static const char * TEST_DATA[] = {
"10 48 F9 00 FF 01 6D 08", // test 37 - F9 "10 48 F9 00 FF 01 6D 08", // test 37 - F9
"10 00 F7 00 FF 01 B9 35 19", // test 38 - F7 "10 00 F7 00 FF 01 B9 35 19", // test 38 - F7
"30 00 FF 00 02 62 00 E7 01 AE 80 00 80 00 80 00 80 00 80 00 80 00 80 00 80 00 80 00 80 00", // test 39 - SM100 "30 00 FF 00 02 62 00 E7 01 AE 80 00 80 00 80 00 80 00 80 00 80 00 80 00 80 00 80 00 80 00", // test 39 - SM100
"30 00 FF 00 02 62 00 E4" // test 40 - SM100 "30 00 FF 00 02 62 00 E4", // test 40 - SM100
"10 48 F7 00 FF 01 A5 DF FF F7 7F 1F" // test 41 - gateway
}; };