In my HA system, I was calculating dew points using value templates. My sensors were all MQTT and the calculation seemed straight forward to me. A typical calculation entry in the sensors.yaml looked like this:
- unique_id: sense34
platform: mqtt
state_topic: 'airqual_2'
name: 'dew_point_airqual_2'
unit_of_measurement: '°F'
value_template: '{{ (( ((((value_json.Temp | float) * 1.8 ) + 32) ) - (0.36 * (100 - (value_json.RH | float) ))) | round(2)) }}'
I decided to replace my DIY sensors with SONOFF TH01 sensors, for two reasons; they are battery powered, and their packaging is cleaner looking than anything that I can achieve. The SONOFF sensors are Zigbee sensors and I added them using the ZHA integration.
Now, I have no idea how to implement the dew point calculation using the new entities. Can somebody point me in the right direction?