Necessary corrections to the local data of a PurpleAir Flex

Dear All,

I am a new user of HA.

I would like to use the local data of the station in HA. For this it says in the documentation of the station:

“The temperature and humidity data are for the sensor itself and are not meant to reflect environmental readings. Heat generated by the WiFi module causes an increase in temperature and a decrease in humidity within the housing. We’ve found that a correction of -8°F correlates closely to the ambient temperature, while a 4% correction correlates closely to the ambient humidity. We have adjusted these values on the PurpleAir map to reflect this.”

How can I make such a correction in HA? Currently, I have entered in the configuration.yaml for the two values:

- name: "Temperature"
        value_template: "{{ value_json['current_temp_f_680'] }}"
        device_class: temperature
        unit_of_measurement: '°F'
- name: "Humidity"
        value_template: "{{ value_json['current_humidity_680'] }}"
        device_class: humidity
        unit_of_measurement: '%'

Kind regards

I found in a third-party forum, that I have to adjust f. e. the temperature with

value_template: "{{ value_json['current_temp_f_680'] -8 }}"