I am getting the differential drop across my air handler filter with some new hardware I built. The sensor returns the value in Pascals.
My ultimate goal is to have the pressure drop, in inches of water, with a rolling 5 minutes average on a dashboard. I’ve been failing to make any progress using statistics or filter.
This is the sensor that esphome is exposing:
This has been working
- sensor:
- name: "Pressure Differential in Inches of Water"
unique_id: pressure_differential_inches_of_water
unit_of_measurement: 'inH2O'
state: "{{ (states('sensor.press_diff_pressure') | float / 248.84) | round(2) }}" # Conversion factor from pascals to inches of water
For statistics filter you forgot to specify what type of statistics you wanted. For the filter sensor, the docs state that time_simple_moving_average requires a time window.
I’m not sure which sensor isn’t working now. You should also add a unique_id to both of your sensors (and also make them differently). Without the unique_id every time you reload the yaml config HA will create a new sensor instead of modifying the existing one. So you might be looking at the wrong sensor.
The problem is your template sensor. Your template sensor has an inline comment which means your state is a string.
Do this instead.
- sensor:
- name: "Pressure Differential in Inches of Water"
unique_id: pressure_differential_inches_of_water
unit_of_measurement: 'inH2O'
# Conversion factor from pascals to inches of water
state: "{{ (states('sensor.press_diff_pressure') | float / 248.84) | round(2) }}"
Also, that unit of measurement is just… not correct. It should be some unit of measurement that represents a volume. But this isn’t causing your problem, the inline comment is.
FYI here’s a valid list of volumes that HA understands
Your other 2 sensors that feed off your template are correct, they are not the problem.