diff --git a/src/devices/solar.cpp b/src/devices/solar.cpp index 3f314cc97..07e32b89e 100644 --- a/src/devices/solar.cpp +++ b/src/devices/solar.cpp @@ -188,7 +188,7 @@ void Solar::process_SM100Status(std::shared_ptr telegram) { * SM100Status2 - type 0x036A EMS+ for pump on/off at offset 0x0A - for SM100 and SM200 * e.g. B0 00 FF 00 02 6A 03 03 03 03 01 03 03 03 03 03 01 03 * byte 4 = VS2 3-way valve for cylinder 2 : test=01, on=04 and off=03 - * byte 10 = PS1 Solar circuit pump for collector array 1: test=01, on=04 and off=03 + * byte 10 = PS1 Solar circuit pump for collector array 1: test=b0001(1), on=b0100(4) and off=b0011(3) */ void Solar::process_SM100Status2(std::shared_ptr telegram) { telegram->read_bitvalue(valveStatus_, 4, 2); // on if bit 2 set diff --git a/src/telegram.h b/src/telegram.h index c574e1497..550c73c67 100644 --- a/src/telegram.h +++ b/src/telegram.h @@ -85,7 +85,7 @@ class Telegram { return; // out of bounds } - value = (uint8_t)(((message_data[index]) >> (bit)) & 0x01); + value = (uint8_t)(((message_data[index - offset]) >> (bit)) & 0x01); } // read values from a telegram. We always store the value, regardless if its garbage diff --git a/src/test/test.cpp b/src/test/test.cpp index 221ae5dbb..241487032 100644 --- a/src/test/test.cpp +++ b/src/test/test.cpp @@ -205,6 +205,15 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & command) { EMSESP::show_values(shell); EMSESP::send_raw_telegram("B0 00 FF 18 02 62 80 00 B8"); + + uart_telegram("30 00 FF 0A 02 6A 04"); // SM100 pump on 1 + + EMSESP::rxservice_.loop(); + EMSESP::show_values(shell); + + uart_telegram("30 00 FF 0A 02 6A 03"); // SM100 pump off 0 + + EMSESP::rxservice_.loop(); EMSESP::show_values(shell); }