Most efficient way to determine what is using so much storage?

My HA installation’s storage needs have been growing at an impractical rate and I would like to be able to get some perspective on the cause. This should be a relatively simple situation to sort out, but when I start looking into how to troubleshoot this on a HA system it starts looking quite complicated :woozy_face:.

Below is the outline of my configuration, can someone suggest a relatively efficient way to tackle a task like this based on my config?

HA Supervisor installed in a Promox VM

  • MariaDB

  • InfluxDB/Grafana (for occasional sensor visualization)

  • 2x Emporia Vue2 Energy Monitors

  • ~ 5x ESP32 microcontrollers w/ various sensors

  • Current storage space used ~ 43GB

Perhaps the simple tool like Scanner (if you use Windows) or Daisy Disk (for Mac, available from AppStore). Might require Samba add-on and mapping folders to drive letters, but as result you can get nice charts showing details of disc usage and then you can drill down to find where the most of used space goes to. Here is example of my config folder from my instance of HA:
image

I have a sensor to track the disck usage of my HA folder but it is strongly locked to my specific folder structure

in configuration.yaml

sensor:
  - platform: command_line
    name: ha_space
    command: >
      cd /home/homeassistant/.homeassistant && echo -n "{";du -k --max-depth=1 | sed "s|\./||g" | grep -v recycle | while read a b; do echo -n \"$b\": \"$a\",; done | sed "s|,$|}|g" | sed "s|\"\.\"|\"homeassistant\"|g"
    value_template: "{{ value_json['homeassistant'] }}"
    json_attributes:
      - ".cloud"
      - ".storage"
      - "downloads"
      - "netdaemon"
      - "deps"
      - ".git"
      - "home"
      - "ui_lovelace_minimalist"
      - "blueprints"
      - "www"
      - "esphome"
      - "custom_templates"
      - ".vscode"
      - "tts"
      - "backups"
      - "custom_components"
      - ".storage.old"
    command_timeout: 30
    scan_interval: 600

In customize.yaml

sensor.ha_space:
  icon_template: mdi:harddisk
  device_class: disk
  friendly_name: HA Disk Usage
  unit_of_measurement: "KB"

And it gives me something like that:

Where sensor state is the total size of the .homeassistant directory, the detail is in the attributes of the sensor.

I’m not using it but you can graph the values and see if there is something running out of control.

EDIT:

You can also use the trend on my sensor

And create automations on the trend binary sensors :slight_smile: