Folder

Sensor for monitoring the contents of a folder. Note that folder paths must be added to allowlist_external_dirs. Optionally a wildcard filter can be applied to the files considered within the folder. The state of the sensor is the size in MB of files within the folder that meet the filter criteria. The sensor exposes the number of filtered files in the folder, total size in bytes of those files and a comma separated list of the file paths as attributes.

Configuration

To enable the folder sensor in your installation, add the following to your configuration.yamlconfiguration.yaml 文件是 Home Assistant 的主要配置文件。它列出了要加载的集成及其特定配置。在某些情况下,需要直接在 configuration.yaml 文件中手动编辑配置。大多数集成可以在 UI 中配置。 [Learn more] file:

sensor:
  - platform: folder
    folder: /config

Configuration Variables

folder string Required

The folder path

filter string (Optional, default: *)

Filter to apply