Manually integrating energy sensors

Hi all,

I have a Sol-Ark 12K based solar system integrated into my HA instance by a custom WiFi interface. I am posting data from the Sol-Ark and displaying it on my Power Station dashboard. That’s all working well.

I would like to use that data on the Energy dashboard, but I don’t see the entities in the Grid Consumption, Solar Production, etc. drop-downs.

My Sol-Ark data is defined as MQTT sensors as shown below. What am I missing here? Do I need to use a special device_class or something to make it show up in the list?

sensor:
  - name: "Battery Charge"
    unique_id: batt_soc
    state_topic: "SolArk/batt_soc"
    value_template: "{{ value_json.batt_soc }}"
    device_class: battery
    unit_of_measurement: "%"

  - name: "Battery Power"
    unique_id: batt_w
    state_topic: "SolArk/batt_w"
    value_template: "{{ value_json.batt_w }}"
    device_class: power
    unit_of_measurement: "W"

  - name: "Battery Voltage"
    unique_id: batt_v
    state_topic: "SolArk/batt_v"
    value_template: "{{ value_json.batt_v }}"
    device_class: voltage
    unit_of_measurement: "V"

  - name: "Grid Power"
    unique_id: grid_w
    state_topic: "SolArk/grid_w"
    value_template: "{{ value_json.grid_w }}"
    device_class: power
    unit_of_measurement: "W"

  - name: "Load Power"
    unique_id: load_w
    state_topic: "SolArk/load_w"
    value_template: "{{ value_json.load_w }}"
    device_class: power
    unit_of_measurement: "W"

  - name: "Inverter Power"
    unique_id: inv_w
    state_topic: "SolArk/inv_w"
    value_template: "{{ value_json.inv_w }}"
    device_class: power
    unit_of_measurement: "W"

  - name: "Solar Power"
    unique_id: pv_w
    state_topic: "SolArk/pv_w"
    value_template: "{{ value_json.pv_w }}"
    device_class: power
    unit_of_measurement: "W"

  - name: "Grid Voltage"
    unique_id: grid_v
    state_topic: "SolArk/grid_v"
    value_template: "{{ value_json.grid_v }}"
    device_class: voltage
    unit_of_measurement: "V"

Thanks,

Bill

Those are power sensors (W or kW). The energy dashboard uses energy sensors (Wh or kWh). Two different things.

If your device does not provide energy sensors you can incorporate via mqtt then you can create them from your power sensors using this (the integral of power with respect to time is energy):

Take particular note of the “method” option. For more accurate tracking in most cases this needs to be “left” not the default “trapezoidal”.