HRV ventilation efficiency

i have made and ESP32 HRV efficiency calculator with 4 Dallas DS18B20 temperature sensors, all calibrated at 0.0 and 65 degree Celsius

esphome:
  name: test-temp
  friendly_name: test temp

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:
  level: DEBUG

one_wire:
  - platform: gpio
    pin: GPIO32
    id: sensor1
  - platform: gpio
    pin: GPIO25
    id: sensor2
  - platform: gpio
    pin: GPIO26
    id: sensor3
  - platform: gpio
    pin: GPIO27
    id: sensor4


# Enable Home Assistant API
api:
  encryption:
    key: "HD4SKx+uVqdRHuS0ZK3##############"

ota:
  - platform: esphome
    password: "c1d531b8871cac0#############"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Test-Temp Fallback Hotspot"
    password: "90rbQ#########"

captive_portal:
   

sensor:
  - platform: dallas_temp
    address: 0x6f000000bfd57228
    one_wire_id: sensor1
    name: sensor1
    update_interval: 5s
    accuracy_decimals: 4
    filters:
    - calibrate_linear:
        # Map 0.0 (from sensor) to 0.0 (true value)
        - 0.350 -> 0.000
        - 64.774 -> 65.000

  - platform: dallas_temp
    address: 0xa0000000bb342928
    one_wire_id: sensor2
    name: sensor2
    update_interval: 5s
    accuracy_decimals: 4
    filters:
    - calibrate_linear:
        # Map 0.0 (from sensor) to 0.0 (true value)
        - 0.303 -> 0.000
        - 64.967 -> 65.000

  - platform: dallas_temp
    address: 0x4a000000bf54cd28
    one_wire_id: sensor3
    name: sensor3
    update_interval: 5s
    accuracy_decimals: 4
    filters:
    - calibrate_linear:
        # Map 0.0 (from sensor) to 0.0 (true value)
        - 0.400 -> 0.000
        - 64.719 -> 65.000

  - platform: dallas_temp
    address: 0x03000000be324528
    one_wire_id: sensor4
    name: sensor4
    update_interval: 5s
    accuracy_decimals: 4
    filters:
    - calibrate_linear:
        # Map 0.0 (from sensor) to 0.0 (true value)
        - 0.712 -> 0.000
        - 64.744 -> 65.000

and with this helper template i get a % result but i need help finding out how i limit this number between 30 and 100 since when the fans are off and the wind forces air around it might go to plus or minus 1000% my graph is limited to 0 to 100 but the history value isn`t

{% set eta = states('sensor.test_temp_sensor4') | float | round(2) %}
{% set eha = states('sensor.test_temp_sensor2') | float | round(2) %}
{% set oda = states('sensor.test_temp_sensor1') | float | round(2) %}
{{ ((eta - eha) / (eta - oda) ) |round(2) |multiply(100)  }}
  • eta : ‘extracted air’
  • eha : ‘exhausted air’
  • sup : ‘supply air’
  • oda : ‘outdoor air’

sensor 1 oda
sensor 2 eha
sensor 3 sup
sensor 4 eta

My first ever project and coding that wasn`t a complete failure

1 Like