Where and how to put in this sensor in config

hello

so I have tested this in the template tester

sensor:
  - platform: template
    sensors:
      climate_temp:
        friendly_name: "Climate Temperature"
        unit_of_measurement: '°C'
        value_template: {{ states.climate.room_12_garage.attributes.current_humidity }}

it is working but now I need to put this in the configuration file but just paste do not work what im I missing?

i want to be able to call this new sensor to use in a graph.

If you’re putting it in configuration.yaml you must have only one top-level (left-aligned) sensor: heading; and you’ll need to restart or reload template entities.

Also, your value_template line is wrong. Single-line templates need to be surrounded in quotes, and it’s recommended to use this format rather than the states object:

value_template: "{{ state_attr('climate.room_12_garage', 'current_humidity') }}"

(see IMPORTANT TEMPLATE RULES, rule 1; and the Warning box a bit further down).

Thanks I have now tried this exactly like picture still get errors

and I only have one Sensor:

Invalid config for [sensor.template]: expected dictionary for dictionary value @ data['sensors']. Got None extra keys not allowed @ data['Friendly_name']. Got 'Akf Garage' extra keys not allowed @ data['climate_garage']. Got None extra keys not allowed @ data['unit_of_measurement']. Got '%' extra keys not allowed @ data['value_template']. Got "{{ state_attr('climate.room_12_garage', 'current_humidity') }}". (See ?, line ?).

the picture above does not look like the indentation syntax of the original post.

if you change the syntax (indentation) of the above to match the indentation of your first post and leave the quotation marks then it should work.

THANK You all got it now

I also installed Visual studio code which gives me
help with the syntax and level how to place the lines.