Hvac mode - set tempeature automation help

Hi, so im trying to set a specific tempetaure, when i press, heat, cool etc on my thermostats

But i cant get it to work, any tips? I tried the code under

- id: test
  alias: varmehvac
  trigger:
    platform: device
    device_id: e52ea6894947442a84af8ae8befb3465
    domain: climate
    entity_id: climate.termostat
    type: hvac_mode_changed
  condition:
  - condition: device
    device_id: e52ea6894947442a84af8ae8befb3465
    domain: climate
    entity_id: climate.termostat
    type: is_hvac_mode
    hvac_mode: cool  
  action:
  - service: climate.set_temperature
    data:
      entity_id: climate.termostat
      temperature: 25
      hvac_mode: heat


This works

  action:
    - service: climate.set_temperature
      data:
        entity_id: climate.kitchen
        temperature: 24
        hvac_mode: heat

But i dunno if my trigger and condition is all wrong

from my thermostat

hvac_modes:
  - auto
  - 'off'
  - cool
  - heat
  - dry
  - fan_only
current_temperature: 20
min_temp: 5
max_temp: 30
target_temp_step: 0.5
temperature: 17
friendly_name: Gulvovn     TV-Stue
supported_features: 1

anyone got a tips here? think its easy, but i maybe missing something.

I just want a set temp to be set, when i set cool mode on my thermostat, and anotehr one when i use heat etc

Maby it’s a typo but you write termostat and it is thermostat i think.

You need to manually edit the automatons file (GUI does not work).
In your trigger section add a to field and specify hvac_mode.

to: cool
to: heat
to: 'off' (need quotes)

Where do I need to put the to: part?

alias: New Automation (Duplicate)
description: ''
trigger:
  - platform: device
    device_id: 202118665007cebf9a82e4deb486e0f6
    domain: climate
    entity_id: climate.1e688e13
    type: hvac_mode_changed
  condition:
  - condition: device
    device_id: 202118665007cebf9a82e4deb486e0f6
    domain: climate
    entity_id: climate.1e688e13
    type: is_hvac_mode
    hvac_mode: heat  
action:
  - service: climate.set_temperature
    target:
      entity_id: climate.1e68a3ab
    data:
      temperature: 21
      hvac_mode: heat
     to: heat
mode: single

In the trigger section.

  trigger:
  - platform: device
    device_id: 202118665007cebf9a82e4deb486e0f6
    domain: climate
    entity_id: climate.1e688e13
    to: heat
    type: hvac_mode_changed

You don’t need the condition.