Bettapro / Solar-Tracer-Blynk-V3

Connect the EPSolar/EPEver Tracer A/B Series (RS-485 Modbus) to an ESP8266/ESP32 and monitor using Blynk /Homeassistant/MQTT... .
GNU General Public License v3.0
51 stars 11 forks source link

Home Assistant Energy Dashboard - Long-term Statistics #74

Open MidnightLink opened 1 year ago

MidnightLink commented 1 year ago

Describe the bug The MQTT integration doesn't report any usable device energy statistics in Home Assistant

To Reproduce Steps to reproduce the behavior:

  1. Set up device with SolarTracerBlynk_3.0.9_esp32dev_mqttHA

Expected behavior Add device statistics to Energy Dashboard in Home Assistant

Screenshots mqttdata

Additional context Device is configured and data is coming through but I'm unable to add to the energy dashboard as shown on the HA config page

Seems that the individual sensors are also not showing up in Developer Tools -> Statistics, which explains why it's not showing up in the energy dashboard as an option

Bettapro commented 1 year ago

Are you still unable to selected energy readings? as far as I know the UOM (Kwh) should be enought. If not please provide some more details like your config.h and your HA config page (screenshot)

MidnightLink commented 1 year ago

config.h hasn't been changed as I'm using the default esp32dev_mqttHA file

Anything in particular you'd like a screenshot of? Like MQTT?

Bettapro commented 1 year ago

I double check my setup, home assistant requires those value to be state_class=total_increasing. The mqtt-HA library cannot specify this..... 😞

You can do so by:

  1. Editing yaml file of your HA, adding something like:
    sensor.energy_generated:
    state_class: total_increasing
  2. Creating a "utility meter" helper like: image
MidnightLink commented 1 year ago

I'm getting an invalid domain error when trying to add it to my yaml config. Do you have it under sensors?

Bettapro commented 1 year ago

Here the complete entry:

homeassistant:
  customize:
    sensor.solartracer1_solartracer_energy_generated:
      state_class: total_increasing

You can refer to HASS docs: https://www.home-assistant.io/docs/configuration/customizing-devices/#manual-customization