Assistance with Wunderground configuration

I wonder if someone can assist. From a basic install (that works and boots up) my first thing
was trying to setup the weather module. Should be fairly easy, but when
I follow the directions of just copying an pasting, my HA instance
doesn’t start anymore. I really don’t understand if I should repeat
“sensor:” or “platform:” or I should include all the hyphens before each
items. Can someone assist with this Wunderground setup?
Here is my entry in configuration.yaml

 # Weather Prediction
sensor:
  - platform: yr
  
  - platform: wunderground
      - api_key: !secret wu_api
      - monitored_conditions:
      - alerts
      - dewpoint_f
      - dewpoint_string
      - feelslike_f
      - feelslike_string
      - heat_index_c
      - heat_index_f
      - heat_index_string
      - elevation
      - location
      - observation_time
      - precip_1hr_in
      - precip_1hr_metric
      - precip_1hr_string
      - precip_today_in
      - precip_today_metric
      - precip_today_string
      - pressure_in
      - pressure_mb
      - pressure_trend
      - relative_humidity
      - station_id
      - solarradiation
      - temperature_string
      - temp_c
      - temp_f
      - UV
      - visibility_km
      - visibility_mi
      - weather
      - wind_degrees
      - wind_dir
      - wind_gust_kph
      - wind_gust_mph
      - wind_kph
      - wind_mph
      - wind_string

Can anyone explain or point to an explanation of how and when to indent or not indent? Should “platform:” be repeated or not?

Thanks

Here is part of my sensor section as an example

sensor:
  - platform: time_date
    display_options:
      - 'date'
      - 'time'
  - platform: wunderground
    api_key: xxxxxxxxxxxxxxxxx
    monitored_conditions:
      - temp_f
      - weather
      - precip_1hr_in
      - wind_mph
      - observation_time
      - location
      - UV
      - relative_humidity
      - wind_dir
      - feelslike_string
  - platform: nest
    monitored_conditions:
      - 'last_ip'
      - 'local_ip'

platform should be repeated each time you have a new type of sensor in that section. the “-” characters are basically saying here is another one of the same kind of thing. I think of them kind of like continuation statements. Indention, each level of code gets another couple of characters of indent (most of the time), indents sometimes trip me up, but now it’s more the exception of when not to indent that cause me problems.

Thanks for taking the time to reply and provide an example for me. Your explanation made sense as well.
I’ll try to mimic your setup to see if it will make any difference and will bring back my API Key in this main config file until I get it working.

Thanks again Turboc … I was able to get a weather display from Wunderground.
It seemed simple enough, so not sure what I had wrong in my setup but glad you chimed in and lowered my level of frustration.

Happy to help

Hi Guys,

What to do? I use Weather Display and upload data to Wunderground. I get “Key does not exist” and i am using the new API key. Any knowledge of how to fix that? Wunderground support thinks that the integration still uses the old API.

BR
Stephan