Open ildar170975 opened 4 months ago
@ildar170975 are you still seeing this problem?
I think I might be suffering from the same or a similar bug.
I saw that a number of sensors are going to LTS, which I didn't configure, so the state class must be set by the integration. To use one example, I'm using OpenWeatherMap, and basically all the sensors go to LTS. While LTS doesn't take that much space, I still don't want this.
I've set my overrides in my customize
section, but it will not respect it.
customize_glob:
"sensor.openweathermap_*":
state_class: null
In the above, I have it set as null
, but I have None
before that seemed to work (no quotes, so not a string).
List of sensors, for reference:
sensor.openweathermap_cloud_coverage: measurement
sensor.openweathermap_daily_cloud_coverage: measurement
sensor.openweathermap_daily_dew_point: measurement
sensor.openweathermap_daily_feels_like_temperature: measurement
sensor.openweathermap_daily_humidity: measurement
sensor.openweathermap_daily_pressure: measurement
sensor.openweathermap_daily_rain: measurement
sensor.openweathermap_daily_snow: measurement
sensor.openweathermap_daily_temperature: measurement
sensor.openweathermap_daily_uv_index: measurement
sensor.openweathermap_daily_visibility: measurement
sensor.openweathermap_daily_wind_bearing: measurement
sensor.openweathermap_daily_wind_speed: measurement
sensor.openweathermap_dew_point: measurement
sensor.openweathermap_feels_like_temperature: measurement
sensor.openweathermap_humidity: measurement
sensor.openweathermap_pressure: measurement
sensor.openweathermap_rain: measurement
sensor.openweathermap_snow: measurement
sensor.openweathermap_temperature: measurement
sensor.openweathermap_uv_index: measurement
sensor.openweathermap_visibility: measurement
sensor.openweathermap_wind_bearing: measurement
sensor.openweathermap_wind_speed: measurement
Pieter, I will be able to check in ~10 days! Keep in touch.
@parautenbach My test:
Initial state:
Stat graph is available:
Then the state_class
was set to none
:
homeassistant:
customize:
sensor.weather_home_openweathermap_pressure:
state_class: none
After HA reboot (just in case) we see a changed state:
And the issue with a useless message "state class not supported":
And it is possible to delete LTS data:
I have not pressed "Delete" and have no idea about if this data are actually deleted from DB...
The problem
There is some sensor created by some integration. When the integration entry was added & the sensor was created, I specified a "state_class":
Then some LTS data have been stored. Later I realized that "total_increasing" is more suitable for the sensor - and changed it:
But the "state_class" has not been changed then - it is still "measurement":
No messages in Log. No "issues" in Dev tools -> Statistics.
Earlier in similar cases I had to:
Probably I cannot just change "state_class" from "measurement" -> "total(-increasing)" and keep having a previously stored LTS. In DB data are stored in a "statistics" table which contains columns for "mean", "max", "min", "state", "sum". But old "mean/max/min" data become meaningless with a new "state_class". Based on this speculation, a more logical way after changing "state_class" would be:
Otherwise currently there is no any notification of a user that "state_class" is not set as it was defined by the user.
What version of Home Assistant Core has the issue?
2024.6.4
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
No response
Link to integration documentation on our website
No response
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response