From e128ea1b276d2bdd8d5a0025b7a2da38eab94dec Mon Sep 17 00:00:00 2001 From: Brandon Harvey <8107750+bharvey88@users.noreply.github.com> Date: Thu, 26 Feb 2026 07:24:38 -0600 Subject: [PATCH 1/3] feat: apply DPS310 pressure offset in filter lambda --- Integrations/ESPHome/Core.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 46f25ce..1ce12c0 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -343,6 +343,10 @@ sensor: - lambda: |- static float last_reported_value = -6.0; float current_value = x; + float offset = id(dps310_pressure_offset).state; + if (!isnan(offset)) { + current_value += offset; + } // Check if the reduce_db_reporting switch is on if (id(reduce_db_reporting).state) { @@ -560,6 +564,10 @@ sensor: - lambda: |- static float last_reported_value = -21.0; float current_value = x; + float offset = id(dps310_pressure_offset).state; + if (!isnan(offset)) { + current_value += offset; + } // Check if the reduce_db_reporting switch is on if (id(reduce_db_reporting).state) { @@ -583,6 +591,10 @@ sensor: - lambda: |- static float last_reported_value = -21.0; float current_value = x; + float offset = id(dps310_pressure_offset).state; + if (!isnan(offset)) { + current_value += offset; + } // Check if the reduce_db_reporting switch is on if (id(reduce_db_reporting).state) { @@ -609,6 +621,10 @@ sensor: - lambda: |- static float last_reported_value = -6.0; float current_value = x; + float offset = id(dps310_pressure_offset).state; + if (!isnan(offset)) { + current_value += offset; + } // Check if the reduce_db_reporting switch is on if (id(reduce_db_reporting).state) { From 796b4f916732c15f7fa8049e66ebd19cd0f09cdc Mon Sep 17 00:00:00 2001 From: Brandon Harvey <8107750+bharvey88@users.noreply.github.com> Date: Thu, 26 Feb 2026 07:24:39 -0600 Subject: [PATCH 2/3] feat: add DPS310 Pressure Offset configurable number entity --- Integrations/ESPHome/Core.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 1ce12c0..0a2fe43 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -145,6 +145,21 @@ number: name: g8 still threshold + - platform: template + name: "DPS310 Pressure Offset" + id: dps310_pressure_offset + disabled_by_default: true + restore_value: true + initial_value: 0.0 + min_value: -100.0 + max_value: 100.0 + entity_category: "CONFIG" + unit_of_measurement: "hPa" + optimistic: true + update_interval: never + step: 0.1 + mode: box + - platform: template name: DPS Temperature Offset id: dps310_temperature_offset From 3fb5fba7d5e3a509070f9f884883b5d8dc7206be Mon Sep 17 00:00:00 2001 From: Brandon Harvey Date: Sun, 1 Mar 2026 13:11:50 -0600 Subject: [PATCH 3/3] Fix: remove pressure offset from non-DPS310 sensor lambdas dps310_pressure_offset was incorrectly applied to three sensors that have no relation to barometric pressure: ESP internal temperature, LTR390 light, and LTR390 UV Index. The offset is now applied only in the DPS310 pressure sensor lambda where it belongs. Co-Authored-By: Claude Sonnet 4.6 --- Integrations/ESPHome/Core.yaml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 0a2fe43..313442d 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -358,10 +358,6 @@ sensor: - lambda: |- static float last_reported_value = -6.0; float current_value = x; - float offset = id(dps310_pressure_offset).state; - if (!isnan(offset)) { - current_value += offset; - } // Check if the reduce_db_reporting switch is on if (id(reduce_db_reporting).state) { @@ -579,10 +575,6 @@ sensor: - lambda: |- static float last_reported_value = -21.0; float current_value = x; - float offset = id(dps310_pressure_offset).state; - if (!isnan(offset)) { - current_value += offset; - } // Check if the reduce_db_reporting switch is on if (id(reduce_db_reporting).state) { @@ -606,10 +598,6 @@ sensor: - lambda: |- static float last_reported_value = -21.0; float current_value = x; - float offset = id(dps310_pressure_offset).state; - if (!isnan(offset)) { - current_value += offset; - } // Check if the reduce_db_reporting switch is on if (id(reduce_db_reporting).state) {