From 6c02ca79007657b13eaf9177aee8be92cd4451ca Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 14 Jan 2026 14:50:42 -1000 Subject: [PATCH 1/3] Update esphome/components/ezo/ezo.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- esphome/components/ezo/ezo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/ezo/ezo.cpp b/esphome/components/ezo/ezo.cpp index 9c0de136b4..65a27ebc50 100644 --- a/esphome/components/ezo/ezo.cpp +++ b/esphome/components/ezo/ezo.cpp @@ -169,8 +169,8 @@ void EZOSensor::add_command_(const char *command, EzoCommandType command_type, u } void EZOSensor::set_calibration_point_(EzoCalibrationType type, float value) { - // max 20: "Cal,"(4) + type(4) + ","(1) + float(10) + null - char payload[20]; + // max 21: "Cal,"(4) + type(4) + ","(1) + float(11) + null; use 24 for safety + char payload[24]; snprintf(payload, sizeof(payload), "Cal,%s,%0.2f", EZO_CALIBRATION_TYPE_STRINGS[type], value); this->add_command_(payload, EzoCommandType::EZO_CALIBRATION, 900); } From 147d2aa384e5de45abd803a2c4cd5e7cdaab7ec4 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 14 Jan 2026 14:50:54 -1000 Subject: [PATCH 2/3] Update esphome/components/ezo/ezo.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- esphome/components/ezo/ezo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/ezo/ezo.cpp b/esphome/components/ezo/ezo.cpp index 65a27ebc50..6ecea162ca 100644 --- a/esphome/components/ezo/ezo.cpp +++ b/esphome/components/ezo/ezo.cpp @@ -221,7 +221,7 @@ void EZOSensor::set_calibration_point_high(float value) { } void EZOSensor::set_calibration_generic(float value) { - // max 16: "Cal,"(4) + float(10) + null, rounded to 16 + // exact 16 bytes: "Cal," (4) + float with "%0.2f" (up to 11 chars, e.g. "-9999999.99") + null (1) = 16 char payload[16]; snprintf(payload, sizeof(payload), "Cal,%0.2f", value); this->add_command_(payload, EzoCommandType::EZO_CALIBRATION, 900); From f5495e9d933048d86d3802cc66a0c19c7e3a09ce Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 14 Jan 2026 14:52:57 -1000 Subject: [PATCH 3/3] fix --- esphome/components/ezo/ezo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/ezo/ezo.cpp b/esphome/components/ezo/ezo.cpp index 6ecea162ca..e4036021df 100644 --- a/esphome/components/ezo/ezo.cpp +++ b/esphome/components/ezo/ezo.cpp @@ -198,7 +198,7 @@ void EZOSensor::get_slope() { this->add_command_("Slope,?", EzoCommandType::EZO_ void EZOSensor::get_t() { this->add_command_("T,?", EzoCommandType::EZO_T); } void EZOSensor::set_t(float value) { - // max 14: "T,"(2) + float(10) + null, rounded to 16 + // max 14 bytes: "T,"(2) + float with "%0.2f" (up to 11 chars) + null(1); use 16 for alignment char payload[16]; snprintf(payload, sizeof(payload), "T,%0.2f", value); this->add_command_(payload, EzoCommandType::EZO_T);