The only thing that should be in the State template
field is:
{{ state_attr('weather.forecast_dom', 'temperature') }}
And you will want to select Measurement
for the State class
field.
Make sure you remove the configuration you posted earlier from wherever you pasted it (ESPHome) since it will likely cause issues down the line.