Nest - trying to automate using average temperature sensor

I’m nearing the end of the latest work - adding HVAC automation to HA. The annoying part is that I have Nest and I feel pretty limited by it. The location and the way the Nest pucks work really aren’t conducive to balancing the household temperatures.

So, I added sensors in all the key rooms and created an average sensor. I’m trying to figure out how to have the average sensor turn on the A/C (or Heat) until it reaches the desired temperature via the average sensor and not the Nest sensor.

Below are current code samples for summer, sprince/fall, and winter (no average sensor in it) out of the several that I have. Each season has a handful that adjust based upon outside temperature during the day to adjust the inside temperature, and then a set general temperature for the night hours.

Summer:

- id: 'da21086a-351c-11ee-be56-0242ac120002'
  alias: HVAC temps Summer 1945 - 0759 to 74
  trigger:
  - platform: time
    at: '19:45:51'
  - platform: time
    at: '20:35:00'
  - platform: time
    at: '02:35:15'
  - platform: time
    at: '06:35:15'
  - platform: state
    entity_id: climate.entryway
    attribute: preset_mode
    to: 'none'
  condition:
    condition: and
    conditions:
    - condition: state
      entity_id: climate.entryway
      attribute: preset_mode
      state: 'none'
    - condition: or
      conditions:
      - condition: time
        before: '07:59'
      - condition: time
        after: '19:45:01'
    - condition: template
      value_template: "{{ (6, 10) <= (now().month, now().day) <= (9, 15) }}"
    - condition: or
      conditions:
      - condition: zone
        entity_id: device_tracker.pixel_7_pro_3
        zone: zone.local_area
      - condition: zone
        entity_id: device_tracker.pixel_7_pro_3
        zone: zone.home
      - condition: zone
        entity_id: device_tracker.gaby_pixel_7_pro
        zone: zone.local_area
      - condition: zone
        entity_id: device_tracker.gaby_pixel_7_pro
        zone: zone.home
  action:
  - service: climate.set_hvac_mode
    data:
      hvac_mode: cool
    target:
      area_id: entryway
  - service: climate.set_temperature
    data:
      hvac_mode: cool
      temperature: 74.2
    target:
      area_id: entryway

Spring/Fall:

- id: 'da21096e-351c-11ee-be56-0242ac120002'
  alias: HVAC temps Spring and Fall 1945 - 0800 to 74 and 71
  trigger:
  - platform: time
    at: '19:45:51'
  - platform: time
    at: '20:35:00'
  - platform: time
    at: '02:35:15'
  - platform: time
    at: '06:35:15'
  - platform: state
    entity_id: climate.entryway
    attribute: preset_mode
    to: 'none'
  condition:
    condition: and
    conditions:
    - condition: state
      entity_id: climate.entryway
      attribute: preset_mode
      state: 'none'
    - condition: or
      conditions:
      - condition: time
        before: '07:59'
      - condition: time
        after: '19:45:01'
    - condition: or
      conditions:
      - condition: template
        value_template: "{{ (4, 10) <= (now().month, now().day) <= (6, 9) }}"
      - condition: template
        value_template: "{{ (9, 16) <= (now().month, now().day) <= (11, 15) }}"      
    - condition: or
      conditions:
      - condition: zone
        entity_id: device_tracker.pixel_7_pro_3
        zone: zone.local_area
      - condition: zone
        entity_id: device_tracker.pixel_7_pro_3
        zone: zone.home
      - condition: zone
        entity_id: device_tracker.gaby_pixel_7_pro
        zone: zone.local_area
      - condition: zone
        entity_id: device_tracker.gaby_pixel_7_pro
        zone: zone.home
  action:
  - service: climate.set_hvac_mode
    data:
      hvac_mode: heat_cool
    target:
      area_id: entryway
  - service: climate.set_temperature
    data:
      hvac_mode: heat_cool
      target_temp_low: 70
      target_temp_high: 74.2
    target:
      area_id: entryway

Winter:

- id: 'da210b76-351c-11ee-be56-0242ac120002'
  alias: HVAC temps Winter 0800 - 1759 to 71
  trigger:
  - platform: time
    at: '08:00:51'
  - platform: time
    at: '10:35:00'
  - platform: time
    at: '12:35:15'
  - platform: time
    at: '13:35:15'
  - platform: time
    at: '14:35:15'
  - platform: time
    at: '15:35:15'
  - platform: time
    at: '16:35:15'
  - platform: time
    at: '17:35:15'
  - platform: state
    entity_id: climate.entryway
    attribute: preset_mode
    to: 'none'
  condition:
    condition: and
    conditions:
    - condition: state
      entity_id: climate.entryway
      attribute: preset_mode
      state: 'none'
    - condition: time
      before: '18:00'
      after: '08:00:00'
    - condition: or
      conditions:
      - condition: template
        value_template: "{{ (1, 1) <= (now().month, now().day) <= (4, 9) }}"
      - condition: template
        value_template: "{{ (11, 16) <= (now().month, now().day) <= (12, 31) }}"      
    - condition: or
      conditions:
      - condition: zone
        entity_id: device_tracker.pixel_7_pro_3
        zone: zone.local_area
      - condition: zone
        entity_id: device_tracker.pixel_7_pro_3
        zone: zone.home
      - condition: zone
        entity_id: device_tracker.gaby_pixel_7_pro
        zone: zone.local_area
      - condition: zone
        entity_id: device_tracker.gaby_pixel_7_pro
        zone: zone.home
  action:
  - service: climate.set_hvac_mode
    data:
      hvac_mode: heat
  - service: climate.set_temperature
    data:
      hvac_mode: heat
      temperature: 71
    target:
      area_id: entryway

I’ve seen an example here of someone’s setup: Automations:alias: "Furnace Automation: Heating - When Average Temp Less Tha - Pastebin.com

But, I’m a little lost. I get the platform trigger grabs the thermostat’s temperature and then compares it to the average sensor, causing it to turn if it’s off by 1 degree. However, I’m not understanding how the temperature adjustments are to be made and how it’s to stop the action when it reaches the target on the average sensor. And this isn’t even getting into the two targets for Spring/Fall.

Happy to send beer money if someone wants to sort me out. LOL

Okay, I think I may have a solution after a lot of reviewing and blending other solutions into what I need.
But I don’t want to nuke my HA. I’d appreciate any input on if this makes sense.

  1. I’ll drop the spring/fall schedules because I cannot figure out a workaround for two target temperatures of the heat/cool mode.
  2. The below would be for the heat portion. Cooling is basically the same. The idea is that it triggers for both a change in the climate.entryway temperature vs. the sensor group -and- if there’s a manual change in the target temperature for when my daily scheduled target temperature changes occur.
automation:
  - id: entryway_temperature_change
    alias: "Furnace Automation: Heating - When Average Temp Less Than Target"
    trigger:
      - platform: state
        entity_id: climate.entryway
  - platform: template
    value_template: >-
      {{ states( 'sensor.avg_main_and_upstairs_temp') | float >= (state_attr(
      'climate.entryway', 'temperature') | float - 1) }}
    action:
      - service: script.turn_on
        target:
          entity_id: script.adjust_furnace_temperature

Script to call:

script:
  adjust_furnace_temperature:
    sequence:
      - condition: state
        entity_id: climate.entryway
        state: heat
      - condition: template
        value_template: >-
          {{ (as_timestamp(now()) -
          as_timestamp(state_attr('automation.entryway_temperature_change',
          'last_triggered'))) | int(0) > 300 }}
      - condition: state
        entity_id: input_boolean.furnace_override_active
        state: "off"
      - condition: state
        entity_id: climate.entryway
        attribute: hvac_action
        state: idle
      - service: input_boolean.turn_on
        target:
          entity_id: input_boolean.furnace_override_active
      - service: input_datetime.set_datetime
        target:
          entity_id: input_datetime.furnace_override_reset
        data:
          timestamp: "{{ now().timestamp() + 900 }}"
      - service: input_number.set_value
        data:
          value: "{{ state_attr( 'climate.entryway', 'temperature') }}"
        target:
          entity_id: input_number.previous_target_temp
      - service: climate.set_temperature
        data_template:
          entity_id: climate.entryway
          target_temp_high: >-
            {% if states('input_number.previous_target_temp') | float + 2 > states('climate.entryway.attributes.temperature') | float %}
              {{ states('input_number.previous_target_temp') | float + 2 }}
            {% else %}
              {{ states('climate.entryway.attributes.temperature') | float }}
            {% endif %}

Where am I going off the rocker?