Recorder Config with Include and Exclude Entity Globs

Hi All,

Reading the documentation, it seems like this should work for me, but it doesn’t look like it is…

I have the following set up in the recorder config (simplified to relevant items only):

  include:
    domains:
      - sensor     
    entity_globs:
      - sensor.oscar_*temperature*
    entities:
      ...
  exclude:
    domains:
      - automation
      - device_tracker
    entity_globs:
      - sensor.oscar_*
    entities:
      ...
      - sensor.watertanks_pump_uptime
      - sensor.watertanks_pump_runtime
      ...

I’m using Open Hardware Monitor, and I want to record only the temperature values in my SQL Database.

I’m trying to exclude all sensor.oscar_*, but include only the sensor.oscar_*temperature* sensors.

I’ve also tried to include a specific entity too, instead of using the include glob. That doesn’t work either. It looks like Home Assistant just ignores it if it matches an exclude entity glob, and doesn’t see if it’s explicitly included.

Here is the relevant documentation around this (and link for convenience):

Both includes and excludes:

  1. Include domain and/or glob patterns specified
    1.1 If domain is included, and entity not excluded or match exclude glob pattern, pass
    1.2 If entity matches include glob pattern, and entity does not match any exclude criteria (domain, glob pattern or listed), pass
    1.3 If domain is not included, glob pattern does not match, and entity not included, fail
  2. Exclude domain and/or glob patterns specified and include does not list domains or glob patterns
    2.1 If domain is excluded and entity not included, fail
    2.2 If entity matches exclude glob pattern and entity not included, fail
    2.3 If entity does not match any exclude criteria (domain, glob pattern or listed), pass
  3. Neither include or exclude specifies domains or glob patterns
    3.1 If entity is included, pass (as #2 above)
    3.2 If entity include and exclude, the entity exclude is ignored

The way I understand it is, my situation is 2.2 where I have an exclude glob, but entity is included.

Any ideas?

Thanks for your time!

Anybody come across this?

TL;DR - yes, I have.

For the life of me I can’t remember if I had created a GitHub issue or a forum post about it. Ultimately I changed how I was including and excluding entities and domains. I’m on mobile right now so I’ll have to post my recorder YAML later and see if I can find where I posted about this issue.

Please remember to post your YAML config for me :stuck_out_tongue:

This is where I ran into the excludes and includes issue:

There’s plenty of posts after mine that talk about the excludes/includes.

Here’s the thread I created about the issue I was experiencing: