From 72f1cdc59b8a80890d8be55c11e54d953d953e34 Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 23 Feb 2018 19:38:00 +0000 Subject: [PATCH] Adds folder sensor (#4588) * Adds folder sensor * Update Configuration variables Updates Configuration variables to address requested changes * Update sensor.folder.markdown * Add ref to whitelise * Update sensor.folder.markdown * Update sensor.folder.markdown * Update sensor.folder.markdown * Minor changes * Fix --- source/_components/sensor.folder.markdown | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 source/_components/sensor.folder.markdown diff --git a/source/_components/sensor.folder.markdown b/source/_components/sensor.folder.markdown new file mode 100644 index 00000000000..c2b7ae330f0 --- /dev/null +++ b/source/_components/sensor.folder.markdown @@ -0,0 +1,36 @@ +--- +layout: page +title: "Folder sensor" +description: "Sensor for monitoring the contents of a folder." +date: 2018-02-21 14:00 +sidebar: true +comments: false +sharing: true +footer: true +logo: file.png +ha_category: Sensor +ha_iot_class: "Local Polling" +ha_release: 0.64 +--- + +Sensor for monitoring the contents of a folder. Note that folder paths must be added to [whitelist_external_dirs](https://home-assistant.io/docs/configuration/basic/). Optionally a [wildcard filter]((http://tldp.org/LDP/GNU-Linux-Tools-Summary/html/x11655.htm)) 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 number of filtered files in the folder and total size in bytes of those files are exposed as attributes. + +To enable the `folder` sensor in your installation, add the following to your `configuration.yaml` file: + +```yaml +sensor: + - platform: folder + folder: /config +``` + +{% configuration %} +folder: + description: The folder path + required: true + type: string +filter: + description: Filter to apply + required: false + default: "`*`" + type: string +{% endconfiguration %}