#Energy dashboard not showing battery charge/discharge

1 messages · Page 1 of 1 (latest)

restive beacon
#

I have a Solis inverter and a Seplos kit battery (JK BMS, Seplos battery monitor). The Solis has really coarse (1kWh) energy total measurements over Modbus, so I'd like to pull the readings from the Seplos power monitor into HA's Energy Dashboard.

I've put this together in config.yml and while I can add the integral sensors to the Energy dashboard, it doesn't show the battery charging and discharging.

The integration sensors work fine in the History view but not the Energy Dashboard. What am I doing wrong?

homeassistant:
  customize_glob:
    sensor.*_energy:
      last_reset: '1970-01-01T00:00:00+00:00'
      device_class: energy
      state_class: measurement

# Templates for photovoltaic system -- battery power
template:
  - sensor:
      - name: "PV Battery Discharge Instant"
        unit_of_measurement: "W"
        device_class: power
        state_class: measurement
        state: >
          {% if states('sensor.esp_solar_inverter_battery_power')|float <= 0 %}
            {{ (-1 * states('sensor.esp_solar_inverter_battery_power')|float) }}
          {% else %}
            0
          {% endif %}

      - name: "PV Battery Charge Instant"
        unit_of_measurement: "W"
        device_class: power
        state_class: measurement
        state: >
          {% if states('sensor.esp_solar_inverter_battery_power')|float >= 0 %}
            {{ states('sensor.esp_solar_inverter_battery_power')|float }}
          {% else %}
            0
          {% endif %}

sensor:
  - platform: integration
    name: "PV battery discharge energy"
    source: sensor.pv_battery_discharge_instant
    method: left

  - platform: integration
    name: "PV battery charge energy"
    source: sensor.pv_battery_charge_instant
    method: left  
kind galleon
#

this looks chatgpt generated

#

state_class: measurement for an energy device is wrong