diff --git a/esphome/components/api/api_connection.cpp b/esphome/components/api/api_connection.cpp index a936df4379..f59fa5d751 100644 --- a/esphome/components/api/api_connection.cpp +++ b/esphome/components/api/api_connection.cpp @@ -1814,6 +1814,8 @@ void APIConnection::process_batch_() { this->proto_write_buffer_.resize(this->proto_write_buffer_.size() + this->helper_->frame_footer_size()); } + ESP_LOGD(TAG, "Sending batch: %zu messages, %zu total bytes", processed_count, this->proto_write_buffer_.size()); + APIError err = this->helper_->write_protobuf_packets(batch_buffer, packet_info); if (err != APIError::OK && err != APIError::WOULD_BLOCK) { on_fatal_error(); diff --git a/esphome/components/api/api_connection.h b/esphome/components/api/api_connection.h index 01177da667..6b1c81ef46 100644 --- a/esphome/components/api/api_connection.h +++ b/esphome/components/api/api_connection.h @@ -610,7 +610,7 @@ class APIConnection : public APIServerConnection { }; DeferredBatch deferred_batch_; - static constexpr uint32_t BATCH_DELAY_MS = 50; + static constexpr uint32_t BATCH_DELAY_MS = 100; static constexpr size_t MAX_BATCH_SIZE_BYTES = 1360; // MTU - 100 bytes safety margin // Batch mode state for capturing message types