Thermostat Blueprint Help Set Temp based on Outside Weather

I need help making a blueprint that would adjust the tempature of my thermostat based on outside tempature

I have done the math and this is how it needs to be.
at 65 Degrees outside, The thermostat would start out at 72
then at 51.7 I need the thermostat to go up 0.75 degrees, so at 38.4 it would need to be 73.5
for every -14.4 degreese outside, the temp goes up 0.75.

I live in a mobile home and they dont insulate these homes as good as a real house. It was -15 degrees last winter here and I was rocking 77 on my thermostat. I would like to have this automated.

The real math is for every 1 degree drop in tempature the thermostat must go up 0.06944444 degrees but it would need to be a absolute value without decimal’s.

Anyone be able to help me with this. I would also like to have a link to a field input on a lovelace card to specifiy this offset instead of it beeing hard programmed into a blueprint.

PLEASE HELP!!!

Thalia Montreux

Template for your thermostat setpoint:

{{((-0.0625 * state_attr('weather.home','temperature')) + 76.0625) | round (0)}}

Does it need to be a blueprint or will an automation do ?

blueprint would be awesome. maybe allow inputting the temperatures as well if possible so people can customize it for drafty houses.

I’m kind of new to home assistant. I want to be able to set up a couple helpers, for input fields. one for the comfort temperature I prefer. then the difference based on the outside temperature, as it drops it increases and as it rises it decreases the thermostat temperature. only by little fractional amounts at a time,

how would I use your current template as a automation ?

I am a newbie myself, however, I would think you can set up an automation with the time pattern as the trigger and make it run every 5 minutes or something and the action would be to “Call Service” to set thermostat temperature. For the value you could use that formula.

So, here’s my automation. Mine is in celcius so I had to make some math changes.

alias: Thermostat | Set Temperature based on weather
description: ''
trigger:
  - platform: time_pattern
    minutes: /5
condition: []
action:
  - service: climate.set_temperature
    target:
      entity_id: climate.first_floor
    data:
      hvac_mode: heat_cool
      target_temp_high: >-
        {{((-0.125 * state_attr('weather.home','temperature')) + 24.8) | round
        (0)}}
      target_temp_low: >-
        {{((-0.125 * state_attr('weather.home','temperature')) + 23.0) | round
        (0)}}
mode: single

Having the trigger as the state of weather.home would ensure that the set temp was updated whenever the outside temperature changed.