nordpool icon indicating copy to clipboard operation
nordpool copied to clipboard

16k attribute limitation

Open koopee opened this issue 4 months ago • 0 comments

Hello @Hellowlol @Teme-V

Could this issue be solved by not storing the heavy list attributes in the database at all? That way the attributes would remain usable, and as far as I can tell we’d at least avoid exceeding the 16384-byte limit. I can’t think of a reason the lists need to be written to the database, so perhaps those could simply be omitted. This might be one possible solution.

I have this kind of workaround at the moment and looks like it works.

Under sensor.py

class NordpoolSensor(SensorEntity):
    "Sensors data"

    _attr_device_class = SensorDeviceClass.MONETARY
    _attr_suggested_display_precision = None
    _attr_state_class = SensorStateClass.TOTAL
    # Do not write list attributes to database.
    _unrecorded_attributes = frozenset({"raw_today", "raw_tomorrow", "today", "tomorrow"})

Originally posted by @sippe2 in https://github.com/custom-components/nordpool/issues/491#issuecomment-3395354974

koopee avatar Oct 13 '25 17:10 koopee