Esphome + SCT-013 - sensor not showing up in Energy Dashboard

I feel like I’ve looked at every tutorial out there for how to set this up so my SCT-013 sensors will show as “Grid consumption” sources in the Energy Dashboard, but I’m obviously still missing something because they won’t show up in the list despite an evening of troubleshooting and being fairly positive I’ve set everything up as per another tutorial that does this :confused:

Does anything jump out at anyone with the below config? It’s turned into a hodgepodge of a few different tutorials at this point unfortunately so I’m not opposed to major changes if needed anywhere.

time:
  - platform: sntp
    id: homeassistant_time

# Power Monitor
# Example configuration entry
sensor:
  - platform: ct_clamp
    sensor: adc_sensorM1
    id: sensorM1
    internal: true
    name: "Current - Mains 1"
    update_interval: 10s
    filters:
      - calibrate_linear:
          - 0.00161 -> 0
          - 0.12040 -> 11.61
          - 0.050 -> 6.23
          - 0.074 -> 7.07
          - 0.039 -> 3.88
          - 0.01803 -> 1.60
          - 0.00953 -> 0.9
  
# This sensor is the one that gets seen by HA, if the reading is below 0.1A then it reports 0, keeps your 0 at 0
  - platform: template
    name: "Mains 1 - Current"             # 
    id: templated_sensor_mains_1
    lambda: |-
      if (id(sensorM1).state > 0.1){
        return (id(sensorM1).state);
      } else {
        return 0.0;
      }
    device_class: current
    update_interval: 10s
    accuracy_decimals: 2
    unit_of_measurement: A

# This sensor converts the Amps to Watts (this is assuming that your voltage is 230, if not change the 230 accordingly)
  - platform: template
    name: "Mains 1 - Watts"
    id: watts_mains_1
    lambda: |-
      return id(templated_sensor_mains_1).state * 120;
    accuracy_decimals: 2
    update_interval: 10s
    device_class: power
    unit_of_measurement: W

# This sensor will give you a Daily kW reading
  - platform: total_daily_energy
    name: "Mains 1 - Daily Energy"
    unit_of_measurement: kWh
    power_id: watts_mains_1
    state_class: total_increasing
    filters:
      - multiply: 0.001
    device_class: energy

  # Sensor Sources
  - platform: adc
    pin: GPIO36
    attenuation: auto
    id: adc_sensorM1

  # Sensors with general information.
  # Uptime sensor.
  - platform: uptime
    name: power-monitor Uptime

  # WiFi Signal sensor.
  - platform: wifi_signal
    name: power-monitor WiFi Signal
    update_interval: 60s

binary_sensor:
  - platform: status
    name: "power-monitor Status" 

What does the kWh sensor look like under Developer Tools – States?

By the way, I’d highly recommend going with a PZEM-004T instead of just a CT. It will give you a MUCH more accurate and meaningful measurement (plus a lot of extra useful info about your mains power). And it’s pretty inexpensive. I have 2 (one for each phase coming into my house) and have been very happy with them.

Here’s a snapshot of the states page:

Thanks for the tip on the PZEM approach! I had seen some of those in tutorials but always with the closed ring, so I had ignored them as an idea as I don’t want to have the meter to the house pulled to install it. I just did more searching and realized they also make a clamp-on style PZEM. I will be ordering a couple this evening after work now! Gotta love starting Phase 2 before Phase 1 even goes to production haha

I don’t see any red flags with the states view. I had a similar weird issue with my gas meter; ended up using a template sensor to get around it. I ultimately figured it out months later, but I can’t remember what the issue was. Ha

Here’s the exact one I bought (obviously there are cheaper ones):

It was pretty easy to setup, but feel free to reach out if you run into any issues.