How do you setup your history, recorder, and logbook configurations?

My History and Logbook functions are painfully slow. My DB is 1.4 GB. Might this be the reason?

How do you have yours set up so that your database isn’t so slow? I have some sensors returning values every second, so I suspect that sensor might be causing the large table sizes.

Do you prefer to include everything and exclude specific items, or do you exclude everything and only include what you want to examine?

I exclude things (in history & recorder) I don’t want history for. Here is a sampling of what I use:

history:
  exclude:
    domains:
      - automation
      - camera
      - frl_store
      - group
      - history_graph
      - light_store
      - media_player
      - scan_store
      - script
      - timer
      - updater
      - weather
      - zone
      - zwave
    entities: &exclude_entities
      - sensor.date
      - sensor.time
      - sensor.uptime
      ...

recorder:
  db_url: !secret db_url
  exclude:
    domains:
      - camera
      - frl_store
      - group
      - history_graph
      - light_store
      - media_player
      - scan_store
      - timer
      - updater
      - weather
      - zone
      - zwave
    event_types:
      - component_loaded
      - platform_discovered
      - service_registered
    entities: *exclude_entities

For individual entities, I use that YAML feature that allows you to define something once and use it again later. (I forget what it’s called.) See the &exclude_entities & *exclude_entities. The first defines it, and the second re-uses it.

1 Like

anchors, I think.

1 Like