From 92f0305f940168af2fbab036bf91e0f45fe65c40 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Tue, 25 Feb 2025 21:22:37 -0500 Subject: [PATCH] Add temperature offset support Allows user configuration of a temperature offset for the BME680 sensor, to help mitigate the effects of external heating from the ESP32, an encosure, or other factors. A range of -7 to 3 is provided to permit flexibility while recognizing that in *most* cases, it will be negative. --- supersensor.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/supersensor.yaml b/supersensor.yaml index 6f2d17c..6803208 100644 --- a/supersensor.yaml +++ b/supersensor.yaml @@ -75,6 +75,11 @@ globals: restore_value: yes initial_value: "200" + - id: temperature_offset + type: float + restore_value: yes + initial_value: "0.0" + - id: pir_hold_time type: int restore_value: yes @@ -531,6 +536,8 @@ sensor: name: "BME680 Temperature" id: bme680_temperature oversampling: 16x + filters: + - offset: !lambda return id(temperature_offset); pressure: name: "BME680 Pressure" id: bme680_pressure @@ -730,6 +737,7 @@ switch: - switch.turn_on: voice_support_active on_turn_off: - switch.turn_off: voice_support_active + # Active voice support flag/switch - platform: template name: "Voice Support Active" @@ -781,6 +789,20 @@ number: id: gas_resistance_ceiling value: !lambda 'return int(x);' + - platform: template + name: "Temperature Offset" + id: temperature_offset_setter + min_value: -7 + max_value: 3 + step: 0.1 + lambda: |- + return id(temperature_offset); + set_action: + then: + - globals.set: + id: temperature_offset + value: !lambda 'return float(x);' + # PIR Hold Time: # The number of seconds after motion detection for the PIR sensor to remain held on - platform: template