Skip to content
This repository has been archived by the owner on Mar 2, 2018. It is now read-only.

Custom component for displaying the size (in MB) of files - ADDED TO HA 0.64

License

Notifications You must be signed in to change notification settings

robmarkcole/HASS-filesize-sensor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HASS-filesize-sensor

Custom component for displaying the size of a files. Discussion on this thread.

Motivation

There are quite a few posts where people want to know the size of a file, for example their HA database file. This custom component creates sensors which displays the size of a files in MB. The configured file path, the time the file was last updated, and the file size in bytes, are all available via the sensor attributes.

Usage

Place the custom_components folder in your configuration directory (or add its contents to an existing custom_components folder). Note that folder paths must be added to whitelist_external_dirs. Add absolute paths to your config following:

# On Mac
homeassistant:
  whitelist_external_dirs:
    - /Users/robincole/.homeassistant/

sensor:
  - platform: filesize
    file_paths:
      - /Users/username/.homeassistant/home-assistant_v2.db
      - /Users/username/.homeassistant/home-assistant.log

# On Hassio or Docker (e.g. on a Synology NAS)
sensor:
  - platform: filesize
    file_paths:
      - /config/home-assistant_v2.db