I wanted a sensor that is just the calculated absolute humidity from relative humidity and temp, to provide a value that can be charted and used like any other weather value for automation and display.
It has been asked here and online a few times but the answer is either overcomplicated blueprints, the comfort sensors from that store/addon thing I don’t want or just out of date.
So if you are looking for a simple answer like me, here is what you do:
Settings → Devices & Services → Helpers (up top)
+Create Helper (bottom right)
Choose “Template”
Choose “Sensor”
Fill in
- Name: shed absolute humidity
- State:
{% set T = float(states('sensor.my_shed_sensor_temperature')) %}
{% set rh = float(states('sensor.my_shed_sensor_humidity')) %}
{% set aH = (6.112 * e**((17.67*T) / (T+243.5)) * rh * 2.1674) / (273.15+T) %}
{{ aH|round(2) }}
- Unit of measurement: g/m3
- Device Class: Absolute Humidity
- State Class: Measurement (not sure what this one does TBH)
- don’t bother with the rest and then press Submit, done!
Hopefully this will help anyone who also just wants a simple sensor, and save them 2 hours searching, figuring out how jinja works and the basics of weather science.