Statistic card using sensor supplying energy data via Modbus

I’m trying to display a simple daily “energy delivered” statistic in lovelace, supplied from an EV charger which is sending data to HA via Modbus.
The sensor is providing data with Wh delivered from when the charger was first powered on (no idea how to reset it)and is defined in configuration.yaml with device class (energy), state class (total_increasing ) and units of measurement (Wh) and works fine, when displayed as a sensor. The statistics card sees the sensor ok but doesn’t display any data on the card itself regardless of the period of time I use.
I basically need to see what the charger “delivered” on daily basis,( not total since installation) - if anyone has idea how to achieve the final result in a different way, any help will be appreciated

Code for the sensor:

      - name: "Wallbox - Real Energy Consumed Phase Sum"
        unique_id: wallbox_real_energy_consumed_phase_sum
        scan_interval: 10
        address: 1692
        count: 2
        data_type: uint32
        device_class: energy
        state_class: total_increasing
        unit_of_measurement: Wh

Did you check in Developer tools > Statistics? You may need to fix an issue with this sensor.

I think that you may achieve this using a utility meter. You can set up one in Devices and Services > Helpers

Many thanks.

Did you check in Developer tools > Statistics? You may need to fix an issue with this sensor.

I did, showing no problems.

I think that you may achieve this using a utility meter. You can set up one in Devices and Services > Helpers

I actually had no idea this existed. Configured already but showing no data. No sure if will use the historical data or just from the moment it’s created?

You need to wait a day. From the documentation:

The first cycle for each sensor will be incomplete; a sensor tracking daily usage will start to be accurate the next day after the integration was activated. A sensor tracking monthly usage will present accurate data starting the first of the next month after being added to Home Assistant.

Much appreciated. Will report back.

Anything in HA logs regarding your sensor?

Anything in HA logs regarding your sensor?

Nothing…

Should have checked the documentation :man_facepalming: - both the meter and the statistic card started working after roughly 12 hours. Thanks for the help!

1 Like