[SOLVED]How to completely disable Recorder, History and Logbook

Hey guys,

I am using an installation of hassio on an RPi as a slave that just controls the rpi’s gpios.
My main HA is on an Asus Tinker Board but i still have not figured out how to use its gpios.

I want to completely disable the Recorder, History and Logbook components on the slave HA, in order to reduce load on the sd card and anyway, everything is recorded on the main HA.

I went to comment out the recorder: and history: parts form configuration.yaml but i noticed that they are now missing on a new installation.

How would i go about disabling them now?

Thanks in advance,
k.

2 Likes

Not sure, but i think they belong to the Default Config
Maybe disable the default_config?

Ah, and that would create a new configuarion.yaml where things will be visible?
Sounds reasonable, will try it and report back.

Although from the documentation it seems that recorder is not included there, but ill check it anyways

logbookand history are in the default configuration.
I do not know about recorder either. I doubt you need map or mobile_app from the default either.

EDIT: Would expanding on this slightly modified example work?

# Example configuration.yaml entry with exclude
recorder:
  purge_keep_days: 0
  db_url: sqlite:////home/user/.homeassistant/test
  exclude:
    domains:
      - automation
      - weblink
      - updater
    entities:
      - sun.sun # Don't record sun data
      - sensor.last_boot # Comes from 'systemmonitor' sensor platform
      - sensor.date

Based on https://www.home-assistant.io/components/recorder/

1 Like

history: and logbook: will automatically load the recorder: component even if not explicitly called out in your configuration. best way to disable all of them is to only load the components you need and check their manifest.json on github to see what other components they may load. There could be other components that rely on the recorder and load it as a dependency. You can always set the recorder options with a blank include: section to force it to exclude everything and not include anything in the recorder database.

That sounds like a failproof option.

The configuration.yaml code would be something like this:

recorder:
  include:
    domains:
    entities:

Though I haven’t tried it so don’t quote me on it.

I was under the impression, that if i commented all three components out, it would not load them at all.
The argument that some random component might call the recorder is valid though.

This seems like it would do the job but it would still create a DB file right?

Would a very small db file (0 byte?) be an issue?

Not at all! I have not tried it yet but im absolutely happy if it works like this.

But for the sake of correctness, this is a work-around to what im trying to achieve, start the recorder and have it do nothing.

According to this, completely disabling the recorder should create no db file at all.

Rename “default_config” to “frontend”
Frontend: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/frontend/manifest.json

Then, do not include recorder (nor components which load the recorder) in the yaml and no DB will be created

Thanks for the details, will try it when i get home.

Correct. The database file would be created, but with nothing in it. Yes it’s a workaround, but if there’s a component you use that relies on the recorder and loads it as a dependency, there’s not much you can do except make a custom component so it doesn’t use the recorder, or create an empty database.

Hmm no, when changing default_config to frontend, it will only load a small amount of required components (such as api and auth).
It will not load recorder, logger and such. Effectively not creating a database, I am using this setup :slight_smile:

If your response was to me, my response was to the OP regarding setting up the recorder but not putting anything in the include:. The workaround I described is if they are forced to load the recorder component because some other component loads it. That work around would still create a database, albeit an empty one. In your case, yes you’re right, only loading specific components that do not load the recorder component would mean the database is never created.

1 Like

Sorry about that, I misread your post

1 Like

My understanding is the only way to change default_config is to comment it out and add only wat you want. Here is its current list:

“automation”,
“cloud”,
“config”,
“frontend”,
“history”,
“logbook”,
“map”,
“mobile_app”,
“person”,
“script”,
“ssdp”,
“sun”,
“system_health”,
“updater”,
“zeroconf”

Well, renaming default_config to frontend is essentially the same as comment out default_config and adding frontend.
Frontend is required for having a, errr, frontend :smiley:
The rest is optional.

1 Like

Removed default_config:
and enabled the following instead.

frontend:
config:
hassio:
updater:
system_health:

The full list of components called with default_config can be found here
Works great, thanks a lot everyone!

2 Likes

Is that a valid config entry? What does it do? It is not in default_config.