HandyHat/ha-hildebrandglow-dcc

State class for tariff standing & rate sensors are not set

markcocker opened this issue · 2 comments

Describe the bug

HA statistics page reports that the state class of the following entities are not supported:

  • DCC Sourced smart electricity meter Standing charge (sensor.electric_tariff_standing)
  • DCC Sourced smart electricity meter Rate (sensor.electric_tariff_rate)
  • DCC Sourced smart gas meter Standing charge (sensor.gas_tariff_standing)
  • DCC Sourced smart gas meter Rate (sensor.gas_tariff_rate)

To Reproduce

  1. Go to Developer Tools > Statistics /developer-tools/statistics
  2. See error.

Expected behaviour
HA to report no issues.

Screenshots
Screenshot 2023-01-03 at 12 32 53

Version
1.0.2

Hey @markcocker, does this cause any problems elsewhere?
The reason this issue is being reported is that these sensors used to have a state class of measurement and thus have long-term statistics calculated for them. However, looking at the docs (https://developers.home-assistant.io/docs/core/entity/sensor/#available-state-classes), I don't think they should have done as they aren't a measurement of anything, so I removed the state class.

It should be safe to remove the long term statistics by clicking fix issue, remove.

Thanks for the update.
I have clicked "fix issue" on each of the sensors, restarted, and not seen any other problems.