Control Nest thermostat based on outside temperature

Hello, all.
This is my first post here, so let me know what protocols I may be breaking, please. This post went longer than expected, but I wanted to get all of the details into it from the start.

I have been using HA for a few months now. I was amazed at home much data was already available in my “unsmart” home, and gathering all of this data has mainly been the focus of my HA usage to this point. I have a few very simple automations set up, such as turning on my bedside lamp in the morning, during the work-week, when it isn’t a holiday, or I am on vacation. That works nicely and is my most complex automation to date. I have a few others to notify me when the laser printer is getting low on toner, but so far nothing that really makes my house any “smarter”. That is, until now.

We live in a small Cape-style house in southern New England in the US. As such, we have an oil fired furnace for heat in the winter. We get heat via baseboard hot water. No ducted anything, and the whole house (two floors) is on a single zone. Anyone familiar with this fairly typical setup for this region will know that the upstairs bedrooms are always colder than the first floor.

Just last week, we had Mitsubishi ductless mini-splits installed; two upstairs, two downstairs. I was planning on using their Kumo Cloud until I saw that it was going to be $800 to buy the WiFi adapters, and then the data is housed in their cloud, which is kind of counter to the whole HA spirit. I was please to find this project, using ESP8266, which I have been messing with for a couple of months now for air quality monitoring.

In speaking with the heat-pump installer, I asked him about what the real outside temperature switchpoint should be to failover to the oil furnace. The marketing material says 5F, but I know that that is the theoretical lowest temperature, under ideal, laboratory controlled conditions. The installer was honest about it and gave me 26F as a good rule of thumb for switching over.

I also have an Acurite weather station in the backyard that my father gifted to my son. This transmits data to the display panel via 433MHz, so it is also feeding this data to my HA via a cheap SDR dongle. This was done by following SlackerLabs’ YouTube video on the subject. So I have the outside temperature from the backyard available in HA.

The house already had a Nest thermostat installed when we moved in. I’ve paid my $5 for access to the “official” API, which is up and running fine. Seeing as it is only controlling the oil furnace, it is not as feature-rich as I have seen that others have in various tutorials. The Nest works for our simple needs, so I have not had a need to replace it. At this point, the only reason I could see to do that would be to disconnect this facet of my life from Google. Honestly, it is not that huge of an issue for me at this time.

So now you have the various parameters and background of how I am now here hoping that you are still reading. What I am looking to do build a single automation to handle the heat source failover based on the outside temperature. Last night, I was able to get the Nest to kick up to 66F (where we typically keep the temperature in the house) based on the 12F outdoor temp. I was planning on making a second automation to handle turning down the Nest to 50F when the outdoor temperature is 27F or above, but in reading various posts here and elsewhere, I think that both of these functions can be handled in one automation. I am just not sure how that gets written up in YAML.

Here is my starting point:

- id: "1642626494740"
  alias: Turn Nest/Oil Furnace On
  description: Turn on the oil furnace based on outside temperature
  trigger:
    - platform: time_pattern
      minutes: "15"
  action:
    - service: climate.set_hvac_mode
      data:
        hvac_mode: heat
      target:
        entity_id: climate.hallway
    - service: climate.set_temperature
      target:
        entity_id: climate.hallway
      data:
        temperature: 66
  mode: single

It is heavily based on thatapiguy’s post here:
h t t p s://community.home-assistant.io/t/thermostat-blueprint-help-set-temp-based-on-outside-weather/343130/6
What I am looking to do may involve something like this, as well. I am sorry that I have lost the OP for this snippet.

trigger:
  - platform: numeric_state
    entity_id: YOUR TEMPERATURE ENTITY_ID 
    below: 3
  - platform: numeric_state
    entity_id: YOUR TEMPERATURE ENTITY_ID
    above: 3
action:
  service: "switch.turn_{{ 'on' if states('YOUR TEMPERATURE ENTITY_ID')|float < 3 else 'off' }}"
  entity_id: YOUR RELAY ENTITY_ID 

And, just because why not, I would like notifications on the switchover events, if possible. I messed around with this a bit last night, but wound up ripping out that section due to getting notifications every 15 mins telling me that the oil furnace was engaged, as we are currently under a polar blast. One notice would be plenty, not one every time the script runs and there is no actual change in the heat source.

Eventually, I would like to grow this automation to include controlling the head-units via the ESP8266, too, but I am not sure if I am asking for too much out of HA’s automation capability at this point. It doesn’t seem like that would be the case, so I think it is just my lack of experience with writing YAML for HA. If this was a Python script, I could probably get something working. I can see this further expanding to include cooling from the mini-splits, as well, based on outside temperature.

Any and all assistance, advice, and guidance will be greatly appreciated.
Let me know if I am trying to reinvent the wheel here, but so far I have not found anything that fits the bill.

Thanks,
Matt

1 Like

Matt, (@ matthannan)
Did you get anywhere with this?

I am a neophyte and launched a similar project, but focused on the mini splits and shutting them down in the extreme cold. My oil furnace is controlled by two BayWeb EMS thermostats - they have a published API and I hope to figure out how to write an integration to pull it all together.

I am unclear on how to upload to a post, so here is a cut and paste of the automation:

id: '1645603971061'
alias: 'Exterior Temperature sets HVAC Modes (1.2) '
description: ''
trigger:
  - platform: homeassistant
    event: start
  - platform: time_pattern
    minutes: '1'
condition: []
action:
  - repeat:
      count: '1'
      sequence:
        - choose:
            - conditions:
                - condition: and
                  conditions:
                    - condition: not
                      conditions:
                        - condition: state
                          entity_id: input_select.heat_pump_status
                          state: 'Off'
                    - condition: numeric_state
                      entity_id: sensor.openweathermap_temperature
                      below: input_number.heat_pumps_low_temperature_cut_off
              sequence:
                - service: script.heat_pump_shutdown
                  data: {}
            - conditions:
                - condition: and
                  conditions:
                    - condition: not
                      conditions:
                        - condition: state
                          entity_id: input_select.heat_pump_status
                          state: Heat
                    - condition: numeric_state
                      entity_id: sensor.openweathermap_temperature
                      above: input_number.heat_pumps_low_temperature_cut_off
                      below: input_number.heat_pumps_heating_range_cutoff
              sequence:
                - service: script.heat_pumps_heat_mode_on
                  data: {}
            - conditions:
                - condition: and
                  conditions:
                    - condition: not
                      conditions:
                        - condition: state
                          entity_id: input_select.heat_pump_status
                          state: 'Off'
                    - condition: numeric_state
                      entity_id: sensor.openweathermap_temperature
                      above: input_number.heat_pumps_heating_range_cutoff
                      below: input_number.heat_pumps_cooling_range_lower_cuttoff
              sequence:
                - service: script.heat_pump_shutdown
                  data: {}
            - conditions:
                - condition: and
                  conditions:
                    - condition: not
                      conditions:
                        - condition: state
                          entity_id: input_select.heat_pump_status
                          state: Cool
                    - condition: numeric_state
                      entity_id: sensor.openweathermap_temperature
                      above: input_number.heat_pumps_cooling_range_lower_cuttoff
              sequence:
                - service: script.heat_pumps_cool
                  data: {}
          default: []
        - service: counter.increment
          data: {}
          target:
            entity_id: counter.1_hvac_settings_bypass_loop
  - choose:
      - conditions:
          - condition: and
            conditions:
              - condition: time
                after: input_datetime.great_room_heating_time
                before: input_datetime.great_room_setback_time
              - condition: numeric_state
                entity_id: climate.greatroom
                attribute: temperature
                below: input_number.heating_temprature
        sequence:
          - service: climate.set_temperature
            data:
              temperature: 65
            target:
              entity_id: climate.greatroom
      - conditions:
          - condition: and
            conditions:
              - condition: time
                after: input_datetime.great_room_setback_time
                before: input_datetime.great_room_heating_time
              - condition: numeric_state
                entity_id: climate.greatroom
                attribute: temperature
                above: input_number.heating_setback_temperature
        sequence:
          - service: climate.set_temperature
            data:
              temperature: 50
            target:
              entity_id: climate.greatroom
      - conditions:
          - condition: and
            conditions:
              - condition: time
                after: input_datetime.upstairs_bed_room_heating_time
                before: input_datetime.guest_room_setback_time
                weekday:
                  - mon
                  - tue
                  - wed
                  - thu
                  - fri
              - condition: numeric_state
                entity_id: climate.guest_bedroom
                attribute: temperature
                below: input_number.heating_temprature
        sequence:
          - service: climate.set_temperature
            data:
              temperature: 65
            target:
              entity_id: climate.guest_bedroom
      - conditions:
          - condition: time
            after: input_datetime.guest_room_setback_time
            before: input_datetime.upstairs_bed_room_heating_time
          - condition: numeric_state
            entity_id: climate.guest_bedroom
            above: input_number.heating_setback_temperature
        sequence:
          - service: climate.set_temperature
            data:
              temperature: 50
            target:
              entity_id: climate.guest_bedroom
      - conditions:
          - condition: time
            after: input_datetime.upstairs_bed_room_heating_time
            before: input_datetime.boys_bed_room_setback_time
          - condition: numeric_state
            entity_id: climate.kids_bedroom
            below: input_number.heating_temprature
        sequence:
          - service: climate.set_temperature
            data:
              temperature: 65
            target:
              entity_id: climate.kids_bedroom
      - conditions:
          - condition: time
            after: input_datetime.boys_bed_room_setback_time
            before: input_datetime.upstairs_bed_room_heating_time
          - condition: numeric_state
            entity_id: climate.kids_bedroom
            above: input_number.heating_setback_temperature
        sequence:
          - service: climate.set_temperature
            data:
              temperature: 50
            target:
              entity_id: climate.kids_bedroom
    default: []
  - delay:
      hours: 0
      minutes: 1
      seconds: 0
      milliseconds: 0
  - service: automation.turn_on
    data: {}
    target:
      entity_id:
        - automation.exterior_temperature_sets_hvac_modes_1_2
mode: queued
max: 10

Dan

1 Like