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.

OK, newb trying to duplicate what you guys have going on here. Seem to be struggling with something.

Just a couple known devices, their Integration, and their entities:

Thermostat: randk-downstairs-hvac-nativezone
Integration: Nexia/American Standard/Trane
Device ID: climate.randk_downstairs_hvac_nativezone

Weather Station: randk-ambient-weather-station
Thermostat: randk-ambient-weather-station_Temp
Integration: Ambient Weather Station
Device ID: sensor.weather_station_temp

Hereā€™s the automation:

alias: randk-hvac-temp-weather
description: ā€˜ā€™
trigger:

  • platform: time_pattern
    minutes: /5
    condition: []
    action:
  • service: climate.set_temperature
    data:
    hvac_mode: heat_cool
    target_temp_high: >-
    {{((-0.0625 * state_attr(ā€˜weather.homeā€™,ā€˜temperatureā€™)) + 76.0625) | round (0)}}
    target_temp_low: >-
    {{((-0.0625 * state_attr(ā€˜weather.homeā€™,ā€˜temperatureā€™)) + 66.0625.0) | round (0)}}
    target:
    entity_id: climate.randk_downstairs_hvac_nativezone
    mode: single

Here are the errors I am receiving:

Logger: homeassistant.components.automation.new_automation_5
Source: components/automation/init.py:519
Integration: Automation (documentation, issues)
First occurred: 7:14:31 PM (1 occurrences)
Last logged: 7:14:31 PM

Error while executing automation automation.new_automation_5: Error rendering data template: TypeError: state_attr() missing 1 required positional argument: ā€˜nameā€™

Logger: homeassistant.components.automation.new_automation_5
Source: helpers/script.py:1397
Integration: Automation (documentation, issues)
First occurred: 7:14:31 PM (1 occurrences)
Last logged: 7:14:31 PM

randk-hvac-temp-weather: Error executing script. Error for call_service at pos 1: Error rendering data template: TypeError: state_attr() missing 1 required positional argument: ā€˜nameā€™

Any help would be appreciated, thank you!

Can someone help me understand the purpose of this? Honestly. In my mind, the entire purpose of a thermostat is to make the house that temperature, regardless of the outdoor temperature. If itā€™s colder outside, the furnace just works harder to heat the house until the thermostat says it has reached the desired temperature. Soā€¦ Under what circumstances would you need to adjust the thermostat higher based on the outdoor temp? If you want the house at 70, then set it at 70 and let the system work the way its designed. What am I missing?

2 Likes

I believe that this would be for two reasons.

The first being to save on energy consumption. If itā€™s 100 degrees outside, you donā€™t want the thermostat set to 68, like you might in the winter.

The second being of similar deduction is that if itā€™s 50 degrees outside, you will most likely be wearing heavier clothing and can keep the temperatures inside the house lower.

That doesnā€™t explain why OP wants to do what they said they are trying to do.

if you have an older large house, and the thermostat is in the middle, the extremities will be vastly different temperature than what the center is up to 10 degrees, rather than going through the hassle of getting sensors all over the house set up and programming them to give an average, this is easier.

OP did you ever figure this out, i have an automation set up in a similar way, but putting it into a blueprint is causing me a headache

I created a blueprint that does things a little differently, you input the temperatures you want based on the forecast. you just repeat making automations for different times of day.

Thermostat based on outdoor temperature - Blueprints Exchange - Home Assistant Community (home-assistant.io)

Youā€™re correct for this question. OP was trying to say that that the insulation is bad and therefore a thermostat setting of 70 will only keep it 70 next to the thermostat while the rest of the house gets too cold. In that case if it is set a degree higher it will keep the house at 70.

I am looking at this post because I would like to use a different method for heating/cooling my house based on outside temperature. If the thermostat is set to 70, but the outside temp is 40, the heat pump does not work well and consumes massive amounts of energy. I will switch to geothermal and solar heaters.

Ah. Then in that case, OP should do what I did and get a T9. It has remote sensors and I can tell it which one to pay attention to and change that based on time of day. Works REALLY well.

Use the ā€˜sunā€™ plugin instead of ā€˜timeā€™ with your weather conditions. The sunā€™s position and length of day (sun angle > 0) is the fundamental force that your hvac is countering. This will simplify things because you can leverage the empirical relationship between sun angle and outside temp specific to your unique home (your thermostat). Then, you may use other weather conditions such as cloud cover and precipitation to fine tune your logic without additional inputs.

The lag time between min/max sun angle and min/max outside temp allows you to determine how long it takes your home to heat/cool for any given day/season.

At a very high level, from a ā€œrelatively speakingā€ point of view, that is accurate. However, it doesnā€™t account for actual conditions. Sometimes, itā€™ll be 90 here during the day, and 60 at night. Other times, itā€™ll be 90 during the day, and still 80 overnight.

Having an accurate outside temp will be much better for evaluating environmental conditions for interior comfort.

You are making the point that a home with poor thermal efficiency responds more so to local weather than to sun intensity. I am making the point that weather is driven by the sun. While both points are correct, sun-first logic provides the ability to manage extreme temperature swings during the days and nights. Your hottest days will require full sun (no clouds), and these will lend to hot evenings. Your coolest evenings will require a cooler day (clouds/rain). As such, weather acts to minimize the summer temperature extremes. The closer the outside temp is to your target temp, the less logic required to manage the thermostat.

In the case of a home having poor thermal efficiency, adding cloud cover as a secondary condition to sun angle will provide the necessary triggers to manage target temperature effectively. It is critical to provide a geographic location in your setup for this to work effectively.

Except that is not true - at all. Bluebird days, with no clouds and LOTS of sun, are hot - but they generally tend to make for colder nights since there is no cloud cover to hold the heat and humidity in place once the sun has gone down.

The most miserable days in this part of the world are high 80s, high humidity, and overcast all day - and then that temperature simply doesnā€™t go down when the sun does.

Again, as a general idea, your idea is correct, as I mentioned previously. But it fails to account for many other factors.

Further, your proposed idea fails to account for many other factors - such as a week of 70 degree temperatures in March when it is supposed to be in the middle 30s. The sun angle didnā€™t change, and yet suddenly itā€™s ā€œhotā€ out.

You can try to be creative all you want, but a simple $10 aqara sensor placed outside somewhere dry (under the eaves? Under the porch?) will still yield FAR better results - and make for way easier automations.

Hey now, mine is a data-driven, empirical result for my location and has saved my HVAC (which needed to be rebuilt after a hyperactive thermostat approach) and my wallet over the last few yearsā€¦ not a creative proposal. I respect your position but also respect data. Could you please post a few days of your local temperature sensor history and the sun angle for the same time span (sensor.sun_solar_elevation from the native sun integration).