Turn Fan on When temp of 1st sensor is lower than temp of 2nd sensor

I’m attempting to set up ventilation in my garage. I have 2 sensors:

  1. sensor.outside_temperature
  2. sensor.garage_temperature

I have a shutter fan attached to a Kasa smart outlet:

  • switch.garage_ventilation_fan

My goal is to turn the fan on and draw cool air in when it’s cooler outside than it is in the garage. I have looked at the generic thermostat, but I don’t believe it meets my needs because I’m not trying to achieve a specific temperature in the garage. I just want the fan to run whenever it’s cooler outside than inside the garage (once this is working, I may add in a 3 degree difference). This is what I’ve tried so far:

- id: "1689129656297"
  alias: Garage Vent On Summer
  description:
    When the Garage is 3 degrees hotter than the outside temp the vent
    turns on
  trigger:
    - platform: template
      value_template: "{{ states('sensor.garage_temperature')|float > (states('sensor.outside_temperature')|float) }}"
  condition:
    - condition: template
      value_template: "' '"
  action:
    - service: switch.turn_on
      data: {}
      target:
        entity_id: switch.garage_ventilation_fan
  mode: single
- id: "1689175984298"
  alias: Garage Vent Off Summer
  description:
    When the Garage is 3 degrees cooler than the outside temp the vent
    turns off
  trigger:
    - platform: template
      value_template: "{{ states('sensor.garage_temperature')|float < (states('sensor.outside_temperature')|float) }}"
  condition:
    - condition: template
      value_template: "' '"
  action:
    - service: switch.turn_off
      data: {}
      target:
        entity_id: switch.garage_ventilation_fan
  mode: single

The switch never turns on, nor does it turn off if the garage becomes cooler than outside. I’m probably missing something obvious, but I can’t find it. Thanks!

Delete this from both automations.

That worked! Is there a better way to accomplish this though? I copied most of this from another forum post on a similar solution.

I think if you just refactor the three condition lines to this you should be good since you have no conditions.

condition: []