bphermansson / EspSparsnasGateway

Reads data from Ikea Sparsnäs energy meter and publish via Mqtt.
MIT License
39 stars 27 forks source link

Example code will not work out-of-the-box with energy dashboard in HA #64

Open lellky opened 1 year ago

lellky commented 1 year ago

In the example code we have the following

  - state_topic: "EspSparsnasGateway/valuesV2"
    name: "House energy usage"
    unit_of_measurement: "kWh"
    value_template: "{{ float(value_json.total) | round(0)  }}"
    icon: mdi:flash-circle
    state_class: measurement
    device_class: energy

But when this sensor is added as the "Grid consumption" sensor, home assistant complains about "The following entities have state class 'measurement' but 'last_reset' is missing".

Changing state_class to total seems to (maybe) fix the problem.