Recorder domain exclusion doesn't seem to work

I am still seeing mqtt events showing up in event log. I am sending a heartbeat to sensors so this adds a ton of events to the events table. Below is my config:

HA 0.93.1

recorder:
purge_keep_days: 365
db_url: postgresql://127.0.0.1/home-assistant
exclude:
domains:
- automation
- mqtt
entities:
- sun.sun
- sensor.last_boot
- sensor.date

Domains are light, switch, automation, lock, etc.

mqtt is a platform not a domain.

You can exclude specific event_types from being recorded. See this post:

aaah… The event listed mqtt as domain – so this definitely has fooled me.

Thank you for this link! 65k events per day is a bit much… :slight_smile:

Because you can’t use globbing to indicate multiple entries outside of a complete domain, I’ve used this gem extensively in the template dev tool to generate a list of entities:

 {% for i in states.switch if 'keypad' in i.entity_id %}
    - {{ i.entity_id }}
{% endfor %}

{% for i in states.switch if i.entity_id.startswith('foo') %}
    - {{ i.entity_id }}
{% endfor %}

Then you can just copy/paste the list.

I get this error in template tool with that code?
Error rendering template: TemplateSyntaxError: unexpected char ‘‘’ at 149

Somehow the quotes in the second one got replaced by the wrong kind. I’ll update the original one, but you can swap them manually. These are just examples of what you can do.

1 Like