HA Core -- trying to create a template: light in yaml get error that light is an invalid template

I am running HA core 2024.8.1 with Frontend 20240809.0. I am trying to learn and am new to HA. I have a node that sends periodic data up to HA in the form of temperature. I am able to send down an MQTT publish event to turn on an LED and have it report back it’s value. I would like to have a symbol update and change as an example mdi:led_on and mdi:led_off when the node returns it’s value. I have tried everything but don’t seem to be getting it. Currently I get the error that light is not a template? Can someone tell me what I might be doing incorrectly?

configuration.yaml

When configured in YAML you need to use the legacy format, there are various differences such as it should be under the top level key light not template

light:
  - platform: template
    lights:
      mqtt_write_led:
        friendly_name: "MQTT Write LED"
        value_template: |
          {% if is_state ....

Maybe I need to step back …
It appears HA Core doesn’t have the ability to use add-ons etc. and I have exhausted the fact thru ChatGPT that it does not seem possible to change the color of a light from on to off and vice versa using Core. So the next logical thing would be to change the mdi:led_on to mdi:led_off to represent when an MQTT node published event reveals on and off respectively…Is this possible?

Seems Core is somewhat tricky…Unfortunately I am running on an RPi5 and I have a lorawan network so I do not want to run HA OS as it has not been tested on RPi5.