Calculate absolute humidity between two sensors?

Hello!

I’m very new to HA. I have 2 temperature/humidity sensors, yesterday I tried to find a way of calculating “absolute humidity”. Then I found “Thermal Comfort” and installed it through HACS.

Now the problem, I want a guage on my dashbord that equals sensor1-sensor2. This is to get an estimate of ventilation in the area. How do I do this? I tried to create a helper:

template:
  - sensor:
      - name: Difference
        state: "{{ states('sensor.sensor1_absolute_humidity') | float(0) - states('sensor.sensor2_absolute_humidity') | float(0) }}"

The preview says:
template: - sensor: - name: Difference state: “1.9404962058890103”

The value seems correct. But then when I create the gauge in my dashboard it says: “Entity is non-numeric:”

Add a unit to your sensor.

unit_of_measurement: "%"
1 Like

I cant get that to work, (the correct unit is g/m3)

I try different settings in Template Sensor, always the same error in dashboard.

If you are using the UI the only thing you enter into the state template input box is:

{{ states('sensor.sensor1_absolute_humidity') | float(0) - states('sensor.sensor2_absolute_humidity') | float(0) }}

Remove all of this:

template:
  - sensor:
      - name: Difference
        state:

And the quotes too (I think).,

1 Like