How to Add Custom Sensor to Energy Dashboard

Hey everyone, I’ve been working on a project to monitor my home’s energy consumption more effectively. I created a sensor template that sums up energy usage from multiple sockets, which is crucial for managing my heating system. The goal was to integrate this sensor into the Energy Dashboard for a clearer overview, but I’ve run into a bit of a snag. The sensor doesn’t show up in the list of available devices, even though all the sockets are recognized individually.

Here’s the code I’m using for the sensor:
yaml
sensor:

  • platform: template
    sensors:
    energy_total_heating:
    friendly_name: ‘Heating Energy Usage’
    value_template: “{{ (states(‘sensor.socket1_energy_total’)|float + states(‘sensor.socket2_energy_total’)|float) }}”
    unit_of_measurement: kWh
    device_class: energy

I’ve tried adding it to the Energy Dashboard under devices, but it just doesn’t appear. I’m wondering if there’s a specific configuration or setting I’m missing that would allow custom sensors to be included. Any insights or tips would be greatly appreciated! Let’s see if we can crack this together. Thanks in advance for your help! :pray: