Automation to turn on fan when Temperature is lower than Thermostat target

I’m trying to automate my Garage Attic fan.
I have an ESPhome thermostat running hvac in the garage, a switchbot as external temp sensor, and a shelly v1 switching the attic fan.

I’d like to turn on the fan when external temp is below thermostat target temperature, and off when above (if I can do one, the other is essentially duplicate)
I setup what I thought would work, but it didn’t fire when I expected.

Here is my Yaml for Fan on.

alias: testAtticFanOn
description: ""
trigger:
  - platform: template
    value_template: >-
      {{ (state_attr('climate.garage_thermostat', 'target_temperature_high') |
      float) >= (state('sensor.indoor_outdoor_meter_0669') | float) }}
    for:
      hours: 0
      minutes: 1
      seconds: 0
condition: []
action:
  - type: turn_on
    device_id: 7058023a2087827800342a43ad157d92
    entity_id: 5a8484bba340e3796dcf6d5d7c59aa53
    domain: switch
mode: single

is there an easy way to test whether it’s my trigger, or whether my units are wrong?
I’m quite new at automations and honestly shite at programming.

Go to Developer Tools → Template to test yout trigger template.

Go to developer Tools → States to make sure you have the correct entity_ids and attribute.

Units?

Also regarding your action: Why and how to avoid device_ids in automations and scripts

This is EXACTLY the help I needed!!
Thanks. This community is awesome.

As for units. I guess I meant type (ie float/int/string/etc)