Fixing my Yaml

I am new to Home assistant, I have been using the easy version of creating automations. I really want to learn YAML. I Have been working on an automation to turn a smart plug on that is wired to my doorbell camera when the battery level goes below 50%, then to turn off when the battery is at 100% I think my coding looked good but i keep getting extra keys not allowed error. can someone please help me and teach me what i did wrong. Thanks so much.

name: Turn on charger when doorbell battery is low
description:
automations:

  • trigger:

    • type: device.state.Battery
      device: sensor.doorbell_battery_percentage
      state: batteryLevel
      is: 50
      actions:
    • type: switch.turn_on
      devices:
      • switch.bedroom_soundbar
  • starters:

    • type: device.state.Battery
      device: sensor.doorbell_battery_percentage
      state: batteryLevel
      is: 100
      actions:
    • type: switch.turn_off
      devices:
      • switch.bedroom_soundbar

Hello zellers260,
Welcome to the Home Assistant Forum!

Thanks for coming here and asking a question.
Would you be so kind as to adjusting the format of your code so that we can read it properly & check the YAML spacing, etc. Editing your original is the preferred way. It is very hard for us to tell what is what when the text formatter jumbles everything like that.
You can use the </> button like this… How to format your code in forum posts
OR… Here is an example of how to fix it from the site FAQ Page.
How to help us help you - or How to ask a good question.

If the code you posted is supposed to be YAML for an automation, then it’s understandable why you got “extra keys” errors. Very little in that example is valid.

I recommend you create the automation in the Automation Editor in Visual mode, then switch it to YAML mode and observe the resulting code. It will provide you with a practical example of properly composed YAML code.