Run Nest fan on temperature difference

Hi HA community,

I’m new to HA and have been trying to read up on different aspects of how HA works and searching the web for an answer to avoid posting unnecessary questions. Some automations I’ve managed to figure out myself but this one I can’t seem to get right and I’m not sure what I am doing wrong.

The aim of the automation is to start the fan associated with my Nest thermostat when the temperature difference between my Nest thermostat and a LG split system AC (added to HA via HACS ‘SmartThinQ LGE Sensors integration’) exceeds say 3 degrees Celsius.

This is the code I am using (this is inside the automations.yaml file):

- id: 'turn nest fan on when temperature difference'
  alias: Turn Nest fan off on temperature difference
  trigger:
  - platform: template
    value_template: "{{ abs(states.sensor.guest_room_ac_room_temperature -states.sensor.living_room_thermostat_temperature) >= 3 }}"
  action:
    entity_id: climate.living_room_thermostat
    service: climate.set_fan_mode
    data:
      fan_mode: 'on'

I don’t believe there is an issue with the action part of the script because if I change the trigger to a time based trigger, the automation works.

Any help is most appreciated.

Kind regards
Ulf

Any luck with Nest thermostat to set_fan_mode? I’ve tried several different examples. I’m trying to use Alexa to turn on the HVAC fan with “alexa turn on circulate”. This is all working except fan wont turn on.

alias: Circulate HVAC
description: ""
trigger:
  - platform: state
    entity_id:
      - input_boolean.circulate
    to: "on"
condition: []
action:
  - service: climate.set_fan_mode
    target:
      entity_id: climate.thermostat
    data:
      fan_mode: "on"
  - delay:
      hours: 0
      minutes: 0
      seconds: 30
      milliseconds: 0
  - service: input_boolean.turn_off
    target:
      entity_id: input_boolean.circulate
    data: {}
mode: single

I also tried this (old?):

  - entity_id: climate.thermostat
    service: climate.set_fan_mode
    data:
      fan_mode: "on"

I was able to turn Nest off in place of the set_fan_mode action. Once I get that working I’ll need to set it off/auto after the (longer) delay.