Making a template value available to an integration - Will not validate

Intent:
Make a system calculated value available to the Mold Integration.
Issue:
It will not validate.

Background
The Mold Integration has a 'calibration factor" that is the result of a calculation. I don’t want to use a one time calculation for that factor and have created templates to calculate it based on current conditions. The template that is generating that factor is:

  - platform: template
    sensors:
      mold_upstairs_bathroom_calibration_factor:
        friendly_name: "Mold - Upstairs Bathroom Calibration Factor"
        value_template: '{{ ((states("sensor.bw_upstairs_inside_air_temp") | float | round(2) - states("sensor.bw_outside_air_temperature") | float | round(2)) | round(2)) / ((states("sensor.lumi_lumi_weather_90e0ed07_temperature") | float | round(2) - states("sensor.bw_outside_air_temperature") | float | round(2)) | round(2)) }}' 

The templates are producing a number:

However when I use that templated value in the configuration:

sensor:
  - platform: mold_indicator
    name: Mold - Upstairs Bathroom
    indoor_temp_sensor: sensor.lumi_lumi_weather_90e0ed07_temperature
    indoor_humidity_sensor: sensor.lumi_lumi_weather_90e0ed07_humidity
    outdoor_temp_sensor: sensor.davis_vantage_pro_air_temp_outside
    calibration_factor: {{(states("sensor.mold_upstairs_bathroom_calibration_factor") | float(0))}}

It will not pass the Configuration Validation:

What have I misformatted to make this work? Thanks in advance.

The calibration factor does not accept templates.

Unless a configuration option explicitly states that it does accept templates, then it does not.

e.g.

Screenshot 2022-09-23 at 22-22-31 RESTful

compared to

Screenshot 2022-09-23 at 22-23-58 Mold Indicator

“float” = floating point number (or integer) only. No templates.

Thanks again.

I guess I need to make the request that it be opened up to templates. I am seeing some variation in the calculated calibration factor that will affect the integrations accuracy.

Yep write up a feature request.

Just FYI, I taped a temperature sensor to my aluminium window frame and compared it to a temperature sensor outside.

The calibration factor wandered all over the place but did average about 2.

I’ve been thinking of putting that temperature sensor back on the window and using it as the critical temperature for these calculations: core/sensor.py at 7c460cc641f16077943585473be40a416783b924 · home-assistant/core · GitHub instead of calculating the critical temp from the calibration factor, indoor and outdoor temps.

I have a number of UEI XHS2-UE Door/Window Sensors that return a temperature that can be used for that critical temp.

Feature request here.