Nest Trigger Mode to trigger Tasmota plug to turn on

I would like to turn a fan hooked to a Tasmota plug when the mode changes to Cool but can’t seem to get it to work. GUI automation was throwing errors of data to or for on my attempts. I tried another post where they were doing something with heat mode and adapt it for me but not working. Here is what I have tried:

description: ""
mode: single
trigger:
  - platform: device
    device_id: 1eae55210c6e6b21a16b27186e29da24
    domain: climate
    entity_id: climate.hallway_2
    type: hvac_mode_changed
    to: cool
condition: []
action:
  - service: switch.turn_{{ 'ON' if trigger.to_state.state == 'cool' else 'OFF' }}
    data: {}
    target:
      entity_id: switch.endtable3

This has nothing to do with blueprints…