erlendsellie/priceanalyzer

State attributes for sensor.priceanalyzer exceed maximum size of 16384 bytes.

jreidel opened this issue · 2 comments

Error from today:
State attributes for sensor.priceanalyzer exceed maximum size of 16384 bytes. This can cause database performance issues; Attributes will not be stored

Logger: homeassistant.components.recorder.db_schema
Source: components/recorder/db_schema.py:491
Integration: Recorder (documentation, issues)
First occurred: 15:16:35 (21 occurrences)
Last logged: 16:00:00

Home Assistant 2023.3.0
Supervisor 2023.01.1
Operating System 9.5
Frontend 20230301.0 - latest

PriceAnalyzer v 1.3

Thanks, didn't catch this myself after upgrading.

This is probably a new, more strict check in Home Assistant 2023.3 with the recorder.
The raw today and raw tomorrow attributes is pretty large. I don't really want to make those smaller by removing data from them, so i'll look at a way to remove it from the recorder as a default in the integration, to avoid the warning. There is really not a reason for storing those attributes over time in the state_attributes table anyway.

I'm not sure if there's a way for an integration to tell Home Assistant to exclude attributes from the recorder.
While i find out what to do about this, this warning can be avoided by excluding the sensor in the recorder like this:

recorder:
  exclude:
    entities:
      - sensor.priceanalyzer

Keep in mind that this will also exlude the enitity from statistics.
Remember that this warning is just a warning. But i'll keep looking at a way to exclude from an integration-level.