Need help with configuration.yaml sensors

Hi new to HA and the whole yaml file stuff.
Here what I could use some help with .
I have added a weather under ground addon to the config file and that does show up and work fine but ever time I try to add a new sensor that I and working on to the cofig file I keep getting this that pops up when I check it.
And yes I have looked high and low in here before I come to you all to see if you could lean me a hand in one fixing this so that might work and so that I can understand what I was not doing right? Here is the 2 thing that pop up ever time I try checking the config file after adding the new sensor under the Weather Under ground stuff.

Configuration invalid!

Invalid config for [sensor.template]: required key not provided @ data[‘sensors’]. Got None. (See ?, line ?). Invalid config for [sensor]: required key not provided @ data[‘platform’]. Got None. (See /config/configuration.yaml, line 31).

Next the code.

# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

# Text to speech
tts:
  - platform: google_translate

#http proxies
http:
  use_x_forwarded_for: true
  trusted_proxies:
    - 172.17.0.0/24
    - 192.168.1.0/24


automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

#WeaterUnderGround
wundergroundpws:
  api_key: ******************************
  pws_id: KTXALVOR24

weather:
  - platform: wundergroundpws
sensor:
  - platform: wundergroundpws
    monitored_conditions:
      - dewpt
      - elev
      - heatIndex
      - humidity
      - neighborhood
      - obsTimeLocal
      - precip_1d
      - precip_2d
      - precip_3d
      - precip_4d
      - precip_5d
      - precip_chance_1d
      - precip_chance_1n
      - precip_chance_2d
      - precip_chance_2n
      - precip_chance_3d
      - precip_chance_3n
      - precip_chance_4d
      - precip_chance_4n
      - precip_chance_5d
      - precip_chance_5n
      - precipRate
      - precipTotal
      - pressure
      - solarRadiation
      - stationID
      - temp
      - temp_high_1d
      - temp_high_2d
      - temp_high_3d
      - temp_high_4d
      - temp_high_5d
      - temp_low_1d
      - temp_low_2d
      - temp_low_3d
      - temp_low_4d
      - temp_low_5d
      - today_summary
      - uv
      - weather_1d
      - weather_1n
      - weather_2d
      - weather_2n
      - weather_3d
      - weather_3n
      - weather_4d
      - weather_4n
      - weather_5d
      - weather_5n
      - wind_1d
      - wind_2d
      - wind_3d
      - wind_4d
      - wind_5d
      - windChill
      - winddir
      - windDirectionName
      - windGust
      - windSpeed    
      
  - platform: template
  - name: Feels Like Back Room
    state: >
      {% set T = (states('sensor.temperature_and_humidity_sensor_temperature') | float) %}
      {% set RH = (states('sensor.temperature_and_humidity_sensor_humidity') | float) %}
      {% set C1 = 42.379 | float %}
      {% set C2 = 2.04901523 | float %}
      {% set C3 = 10.14333127 | float %}
      {% set C4 = 0.22475541 | float %}
      {% set C5 = 0.00683783 | float %}
      {% set C6 = 0.05481717 | float %}
      {% set C7 = 0.00122874 | float %}
      {% set C8 = 0.00085282 | float %}  
      {% set C9 = 0.00000199 | float %}        
      {% set heat_index = -C1 + C2*T + C3*RH - C4*T*RH - C5*T**2 - C6*RH**2 + C7*T**2*RH + C8*T*RH**2 - C9*T**2*RH**2 %}      

      {% if (80.0 <= T <= 112.0) and (RH < 13) %}
        {% set A1 = ((13 - RH)/4)*((17-(T-95 |abs)/17)**0.5)  %}
        {% set feels_like = heat_index - A1 |round(1) %}

      {% elif (80.0 <= T <= 87.0) and (RH > 85) %} 
        {% set A1 = (RH - 85)/10 * ((87 - T)/5) %}
        {% set feels_like = heat_index - A1 |round(1) %}

      {% elif (50.0 < T < 80.0) %}
        {% set heat_index = 0.5 * (T + 61.0 + (T - 68)*1.2) + (RH * 0.094) %}
        {% set feels_like = (heat_index) |round(1) %}

      {% endif %} 
      {{ feels_like }} 
    unit_of_measurement: "°F"

Now mind you if I remove the template one out there it fine and happy why can’t I get that one added to it without HA trying to drag me through IT h3ll? Thanks for any help and taking your time to try to help guid me out of the weeds.

You have mixed legacy format and current format. It’s mostly the current format except the current format does not use sensor as its top-level key or declare a platform.

# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

# Text to speech
tts:
  - platform: google_translate

#http proxies
http:
  use_x_forwarded_for: true
  trusted_proxies:
    - 172.17.0.0/24
    - 192.168.1.0/24


automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

#WeaterUnderGround
wundergroundpws:
  api_key: ******************************
  pws_id: KTXALVOR24

weather:
  - platform: wundergroundpws
sensor:
  - platform: wundergroundpws
    monitored_conditions:
      - dewpt
      - elev
      - heatIndex
      - humidity
      - neighborhood
      - obsTimeLocal
      - precip_1d
      - precip_2d
      - precip_3d
      - precip_4d
      - precip_5d
      - precip_chance_1d
      - precip_chance_1n
      - precip_chance_2d
      - precip_chance_2n
      - precip_chance_3d
      - precip_chance_3n
      - precip_chance_4d
      - precip_chance_4n
      - precip_chance_5d
      - precip_chance_5n
      - precipRate
      - precipTotal
      - pressure
      - solarRadiation
      - stationID
      - temp
      - temp_high_1d
      - temp_high_2d
      - temp_high_3d
      - temp_high_4d
      - temp_high_5d
      - temp_low_1d
      - temp_low_2d
      - temp_low_3d
      - temp_low_4d
      - temp_low_5d
      - today_summary
      - uv
      - weather_1d
      - weather_1n
      - weather_2d
      - weather_2n
      - weather_3d
      - weather_3n
      - weather_4d
      - weather_4n
      - weather_5d
      - weather_5n
      - wind_1d
      - wind_2d
      - wind_3d
      - wind_4d
      - wind_5d
      - windChill
      - winddir
      - windDirectionName
      - windGust
      - windSpeed    
      
template:
  - sensor:
    - name: Feels Like Back Room
      state: >
        {% set T = (states('sensor.temperature_and_humidity_sensor_temperature') | float) %}
        {% set RH = (states('sensor.temperature_and_humidity_sensor_humidity') | float) %}
        {% set C1 = 42.379 %}
        {% set C2 = 2.04901523%}
        {% set C3 = 10.14333127 %}
        {% set C4 = 0.22475541 %}
        {% set C5 = 0.00683783 %}
        {% set C6 = 0.05481717 %}
        {% set C7 = 0.00122874 %}
        {% set C8 = 0.00085282 %}  
        {% set C9 = 0.00000199 %}        
        {% set heat_index = -C1 + C2*T + C3*RH - C4*T*RH - C5*T**2 - C6*RH**2 + C7*T**2*RH + C8*T*RH**2 - C9*T**2*RH**2 %}      

        {% if (80.0 <= T <= 112.0) and (RH < 13) %}
          {% set A1 = ((13 - RH)/4)*((17-((T-95) |abs)/17)**0.5)  %}
          {% set feels_like = heat_index - A1 |round(1) %}

        {% elif (80.0 <= T <= 87.0) and (RH > 85) %} 
          {% set A1 = (RH - 85)/10 * ((87 - T)/5) %}
          {% set feels_like = heat_index - A1 |round(1) %}

        {% elif (50.0 < T < 80.0) %}
          {% set heat_index = 0.5 * (T + 61.0 + (T - 68)*1.2) + (RH * 0.094) %}
          {% set feels_like = (heat_index) |round(1) %}

        {% endif %} 
        {{ feels_like }} 
      unit_of_measurement: "°F"
      availability: |-
        {{ 'sensor.temperature_and_humidity_sensor_temperature'|has_value and 'sensor.temperature_and_humidity_sensor_humidity'|has_value}}

Okay thanks for pointing that out to me make a bit more sense now to me no.

Here some home work