Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect state_class #130610

Open
c0mplex1 opened this issue Nov 14, 2024 · 0 comments
Open

Incorrect state_class #130610

c0mplex1 opened this issue Nov 14, 2024 · 0 comments

Comments

@c0mplex1
Copy link

The problem

I created a template sensor to calculate how much power I use to charge my electric car.

The sensor.elektrische_auto entity has the "state_class: total_increasing" attribute, because the sensor reading drops to zero between charges.

When I change state_class to "state_class: total" as suggested, I have negative values ​​in the energy dashboard under the individual devices section.

What version of Home Assistant Core has the issue?

core-2024.11.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

https://developers.home-assistant.io/docs/core/entity/sensor/#available-state-classes

Diagnostics information

Logger: homeassistant.components.sensor.recorder
Source: components/sensor/recorder.py:317
integration: Sensor (documentation, issues)
First occurred: 04:35:10
Last logged: 04:35:10

Entity sensor.elektrische_auto from integration template has state class total_increasing, but its state is not strictly increasing. Triggered by state 25.552 (26.056) with last_updated set to 2024-11-14T03:33:42.051403+00:00. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+template%22

Example YAML snippet

template:
  sensor:
    - name: "Elektrische auto"
      unique_id: 13c4c9dc-289a-4653-97f8-4dbebe5177f9
      unit_of_measurement: "kWh"
      state: "{{ states('sensor.zaptec_go_totale_laadsessie')|float(0) }}"
      device_class: energy
      state_class: total_increasing
      icon: mdi:lightning-bolt

Anything in the logs that might be useful for us?

No response

Additional information

afbeelding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant