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.
This commit is contained in:
2025-02-25 21:22:37 -05:00
parent 110b0e9c66
commit 92f0305f94

View File

@ -75,6 +75,11 @@ globals:
restore_value: yes restore_value: yes
initial_value: "200" initial_value: "200"
- id: temperature_offset
type: float
restore_value: yes
initial_value: "0.0"
- id: pir_hold_time - id: pir_hold_time
type: int type: int
restore_value: yes restore_value: yes
@ -531,6 +536,8 @@ sensor:
name: "BME680 Temperature" name: "BME680 Temperature"
id: bme680_temperature id: bme680_temperature
oversampling: 16x oversampling: 16x
filters:
- offset: !lambda return id(temperature_offset);
pressure: pressure:
name: "BME680 Pressure" name: "BME680 Pressure"
id: bme680_pressure id: bme680_pressure
@ -730,6 +737,7 @@ switch:
- switch.turn_on: voice_support_active - switch.turn_on: voice_support_active
on_turn_off: on_turn_off:
- switch.turn_off: voice_support_active - switch.turn_off: voice_support_active
# Active voice support flag/switch # Active voice support flag/switch
- platform: template - platform: template
name: "Voice Support Active" name: "Voice Support Active"
@ -781,6 +789,20 @@ number:
id: gas_resistance_ceiling id: gas_resistance_ceiling
value: !lambda 'return int(x);' 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: # PIR Hold Time:
# The number of seconds after motion detection for the PIR sensor to remain held on # The number of seconds after motion detection for the PIR sensor to remain held on
- platform: template - platform: template