diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index de1847d08..bcb1413b1 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -162,7 +162,6 @@ Thermostat::Thermostat(uint8_t device_type, uint8_t device_id, uint8_t product_i for (uint8_t i = 0; i < set_typeids.size(); i++) { EMSESP::send_read_request(set_typeids[i], device_id); - EMSESP::send_read_request(set_typeids[i], device_id, 0x1B); } for (uint8_t i = 0; i < summer_typeids.size(); i++) { diff --git a/src/emsesp.cpp b/src/emsesp.cpp index 4b9fa303c..13a60dfe6 100644 --- a/src/emsesp.cpp +++ b/src/emsesp.cpp @@ -790,6 +790,10 @@ void EMSESP::incoming_telegram(uint8_t * data, const uint8_t length) { txservice_.send_poll(); // close the bus txservice_.reset_retry_count(); tx_successful = true; + // if telegram is longer read next part with offset + 25 for ems+ + if (length == 32) { + txservice_.read_next_tx(); + } } } diff --git a/src/telegram.cpp b/src/telegram.cpp index 7ae63d7eb..1819882fc 100644 --- a/src/telegram.cpp +++ b/src/telegram.cpp @@ -567,6 +567,12 @@ void TxService::retry_tx(const uint8_t operation, const uint8_t * data, const ui tx_telegrams_.emplace_front(tx_telegram_id_++, std::move(telegram_last_), true); } +void TxService::read_next_tx() { + // add to the top of the queue + uint8_t message_data[1] = {EMS_MAX_TELEGRAM_LENGTH}; // request all data, 32 bytes + add(Telegram::Operation::TX_READ, telegram_last_->dest, telegram_last_->type_id, telegram_last_->offset + 25, message_data, 1, true); +} + // checks if a telegram is sent to us matches the last Tx request // incoming Rx src must match the last Tx dest // and incoming Rx dest must be us (our ems_bus_id) diff --git a/src/telegram.h b/src/telegram.h index ebcb7f1aa..ed12c2fb8 100644 --- a/src/telegram.h +++ b/src/telegram.h @@ -284,6 +284,7 @@ class TxService : public EMSbus { void retry_tx(const uint8_t operation, const uint8_t * data, const uint8_t length); bool is_last_tx(const uint8_t src, const uint8_t dest) const; uint16_t post_send_query(); + void read_next_tx(); uint8_t retry_count() const { return retry_count_;