Can't get Energy Cost sensor to show up or work

Completely new to Home Assistant and YAML, but in just the past two weeks, I’ve picked it up pretty quickly. Apologies if I’m not including something in the post needed to help troubleshoot.

I created a sensor with my current energy cost per kWh. But it doesn’t show up anywhere. The sensor is referenced by my energy dashboard but even when viewing the energy consumption config, an error shows that the sensor is not defined. I’ve created other sensors and they all show up just fine, so I have a feeling I’m doing something wrong here inside my configuration.yaml file. Any ideas? Here’s what I have:

sensor:
  - platform: template
    sensors:
      energy_price_kwh:
        friendly_name: "Energy Price per kWh"
        unit_of_measurement: "USD/kWh"
        value_template: "{{ 0.4267 }}"