Folder sensor custom component

Hi all, I have published a custom component for monitoring the contents of a folder. The state of the sensor is the time that the most recently modified file in a folder was modified. The use case is detecting when a file in a folder is created or updated. For example, I have a USB camera attached to my HA instance that saves a timestamped photo when motion is detected. This sensor allows me to detect when another image is saved, and exposes the name of that new image file. The number of files in the folder and the names of those files are exposed as attributes. Optionally you can filter the files that are monitored, for example specifying filter: '*.txt' to monitor only .txt files.
Cheers

10 Likes

Great component! I need it for the same as you.

¿Can you please share a few snippets about how do you capture the name of the last created file to execute an action with that?

Thanks!

That image might be out of date now, please use the folder_watcher component for file paths

ok, thanks!

1 Like

Is it possible to use an external folder e.g. via SMB/samba?

Limited to folders in the whitelist. Your request would be a new component