Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion Integrations/ESPHome/Core.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
substitutions:
name: apollo-msr-2
version: "25.8.6.1"
version: "26.1.7.1"
device_description: ${name} made by Apollo Automation - version ${version}.

esp32:
Expand Down Expand Up @@ -157,6 +157,34 @@ number:
update_interval: never
step: 0.1
mode: box
- platform: template
name: SCD40 Temperature Offset
id: scd40_temperature_offset
restore_value: true
initial_value: 18.86
min_value: -70.0
max_value: 70.0
entity_category: "CONFIG"
unit_of_measurement: "°C"
optimistic: true
update_interval: never
step: 0.1
mode: box
disabled_by_default: true
- platform: template
name: SCD40 Humidity Offset
id: scd40_humidity_offset
restore_value: true
initial_value: 0
min_value: -70.0
max_value: 70.0
entity_category: "CONFIG"
unit_of_measurement: "%"
optimistic: true
update_interval: never
step: 0.1
mode: box
disabled_by_default: true
Comment on lines +174 to +187
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Constrain the humidity offset range to prevent invalid values.

The offset range of -70.0 to 70.0% could produce invalid humidity readings outside the valid 0-100% range. For example, a 50% humidity reading with a -70% offset would result in -20%, or an 80% reading with a +70% offset would produce 150%.

Consider reducing the range to -50.0 to 50.0 (or even -30.0 to 30.0) to minimize the possibility of invalid values.

♻️ Suggested range adjustment
   - platform: template
     name: SCD40 Humidity Offset
     id: scd40_humidity_offset
     restore_value: true
     initial_value: 0
-    min_value: -70.0
-    max_value: 70.0
+    min_value: -50.0
+    max_value: 50.0
     entity_category: "CONFIG"
     unit_of_measurement: "%"
     optimistic: true
     update_interval: never
     step: 0.1
     mode: box
     disabled_by_default: true
🤖 Prompt for AI Agents
In @Integrations/ESPHome/Core.yaml around lines 174 - 187, The humidity offset
sensor (platform: template, name: SCD40 Humidity Offset, id:
scd40_humidity_offset) allows an excessively large range; change its min_value
and max_value to safer bounds (e.g., set min_value to -50.0 and max_value to
50.0, or -30.0/+30.0 if you prefer stricter limits) so offsets cannot produce
humidity readings outside 0–100%; keep all other properties (restore_value,
initial_value, unit_of_measurement, step, mode, disabled_by_default) unchanged.

# Setting start of zone 1 occupancy
- platform: template
name: "Radar Zone 1 Start"
Expand Down Expand Up @@ -364,6 +392,18 @@ sensor:
co2:
name: "CO2"
id: "co2"
temperature:
name: "SCD40 Temperature"
id: scd40_temperature
disabled_by_default: true
filters:
- lambda: return x - id(scd40_temperature_offset).state;
humidity:
name: "SCD40 Humidity"
id: scd40_humidity
disabled_by_default: true
filters:
- lambda: return x - id(scd40_humidity_offset).state;
automatic_self_calibration: false
update_interval: 60s
measurement_mode: "periodic"
Expand Down