Recorder exclusion list isn't excluding anything

Hey, I’m getting some weird behavior from the recorder.

For every single one of these entities, I still see new data coming in the history page. (After restarting HA within developer tools)

Here’s my config:

recorder:
  #db_url:
  purge_keep_days: 14
  commit_interval: 10
  exclude:
    entity_globs:
      - automation.prese*
      - sensor.uptimekuma*
      - binary_sensor.uptimekuma*
      - sensor.*_controller_action
      - sensor.valetudo_dreame_current*
      - sensor.valetudo_dreame_main*
      - button.valetudo_dreame_reset_*
      - input_text.*_controller_helper
      - input_text.*_button_helper
      - sensor.*_beacon
      - script.security_*_to_position*
      - input_boolean.*_previous_*
      - input_number.*_previous_*
    entities:
      - sensor.valetudo_dreame_fan
      - sensor.valetudo_dreame_map_data
      - camera.valetudo_dreame_map_data
      - select.valetudo_dreame_operation_mode
      - sensor.valetudo_dreame_right_brush
      - button.valetudo_dreame_trigger_auto_empty_dock
      - select.valetudo_dreame_water_grade
      - binary_sensor.valetudo_dreame_water_tank_attachment
      - input_text.spotify_prevous_volume

The time is 6:01:16 PM.

It’s hard to tell anything from your screenshot, but excluding an entity does not purge existing data. That still happens automatically each night. Come back tomorrow and see what it looks like.

You can purge the database manually in Developer Tools → Services. Repack too while you are at it.

I don’t mind the existing data, what I’m trying to say is that new data is actively being logged, even though the entities are excluded from the recorder.

From my understanding, excluding entities from the recorder should stop logging for those entities completely, and then the purge task should clean up data older than 14 days (based on my config).

It will still show the current state. Which is all I can see in your screenshot.

The colored line shows that it’s still logging previous states.

Here’s the history from today:

That should be covered by recorder.exclude.entity_globs: sensor.*_beacon, but it is not.

Do you have any includes or is that your entire recorder config?

That is the entire config.

Hmm. Looks like a bug to me then.

There were a few bugs with glob excludes in the past but they have all been fixed.

You should open a new issue here:

@Mariusthvdb are your entity_globs excludes still working?

uhm, as far as I can see yes, all good here.

not sure if OP is using excludes too, but it might be worth checking this setting in excluded_entities

##########################################################################################
# uncomment domains sensor and device_tracker below, to be able to use
# include_globs in included_entities.yaml
# domains person and switch are included in included_entities.yaml
##########################################################################################

domains:
  - alarm_control_panel
  - alert
  - automation
#  - binary_sensor
  - button
  - camera
  - climate
  - counter
  - cover
#  - device_tracker
  - geo_location
  - group
  - input_boolean
  - input_datetime
  - input_number
  - input_select
  - input_text
  - light
  - media_player
  - number
#  - person
  - proximity
  - remote
  - scene
  - script
#  - sensor
  - sun
#  - switch
  - timer
  - updater
  - variable
  - weather
  - zone

it was the only peculiarity I had to iron out at that time

Yeah they’re only excluding entity_globs and entities, no domains, no includes.

@TurfFiber do the explicitly defined entity_ids (e.g. sensor.valetudo_dreame_fan) get excluded form the recorder?

No, nothing is excluded. Seems like the exclude list is completely ignored.

Where did you put this recorder: config?

Are there any relevant errors in your logs?

ok, I just checked all I have excluded, and they are in fact all excluded, be it entity_globs, entities, domains or event_types

otoh, I also have a carefully curated included_entities list.

Top level in configuration.yaml, no error logs.

1 Like

Well that is very odd. My explicit excludes are working, however I use MariaDB. So maybe it could be an issue with the default SQLite database?

You definitely restarted HA rather than reloading YAML?

What core version are you on?

Also tried removing the #db_url comment from the config, didn’t help.

2023.09.2

I started configuring the recorder because I was planning on switching to mariaDB, but that will take me a couple of days to configure.

fwiw, I moved from MariaDB to builtin SQLite, and use this in the recorder config:

# db_url: !secret db_url
purge_keep_days: 5

# https://www.home-assistant.io/integrations/recorder/#configure-filter
exclude:
  !include excluded_entities.yaml

include:
  !include included_entities.yaml

the paste from above is from my excluded_entities.yaml

got to add this whole recorder config is from way back, when MariaDB was still the main suggestion/recommendation to use for DB. As it stands, current SQLite is supposed to have improved so much, that we dont need to bother ourselves with that anymore, and, depending on the amount of entities, probably dont even have to in/exclude anything at all.

I have a huge amount of entities, so try to keep that number down, but you might not need it in the first place.

1 Like

Ok so it is something specific to TurfFiber’s install.

Just had a thought. TurfFiber, try clearing your web browser cache or try using private/incognito mode in your browser.

No dice, history also shows on my phone app, it’s not the cache.

What’s a huge number, and how could I get my total number of entities?