How to set a the value in an automation from the trigger obje

Here is the code. I have tried many different things without success. If I just set a constant value like ‘77’ is works so I just can’t get the value from the trigger sensor

- id: '1652112411457'
  alias: Set temp slider
  trigger:
    entity_id: sensor.thermostat_target_temperature
    platform: state
  action:
    service: input_number.set_value
    data_template:
      entity_id: input_number.target_temp
      value: "{% sensor.thermostat_target_temperature.state %}"

And tried this doesnt’ and many others does not work?
value: "{{ trigger.value }}"

- id: '1652112411457'
  alias: Set temp slider
  trigger:
    entity_id: sensor.thermostat_target_temperature
    platform: state
  action:
    service: input_number.set_value
    data_template:
      entity_id: input_number.target_temp
      value: "{{ states('sensor.thermostat_target_temperature') }}"

Or

value: "{{ trigger.to_state.state|float }}"

Thanks that worked.