Problem with folder_watcher

Anyone else having difficulty using folder_watcher? (Version 0.67.1)
I used the component example:
folder_watcher:

  • folder: /config

but dont load, log: [homeassistant.components.folder_watcher] folder /config is not valid or allowed

Iā€™m guessing you donā€™t have a /config folder on your device. What device are you running Home Assistant on? Try running cd /config in terminal. If the folder doesnā€™t exist then you can do mkdir /config to create the folder for Home Assistant to monitor.

exists, I use hass.io in raspi is this folder where have the homeassistant configuration files. I tested it in the backup folder (which also exists). but it did not work too.

Same here!

2018-04-21 07:52:01 ERROR (SyncWorker_11) [homeassistant.components.folder_watcher] folder /config is not valid or allowed
2018-04-21 07:52:01 ERROR (MainThread) [homeassistant.setup] Setup failed for folder_watcher: Component failed to initialize.

I did some digging for you found that you need to whitelist the filepath. Hereā€™s an example of what you need to include in your configuration.yaml:

homeassistant:
  whitelist_external_dirs:
    - /config

Let me know if that works for you.

donā€™t work :frowning:
error log:
2018-04-21 17:39:19 ERROR (MainThread) [homeassistant.config] Invalid config for [homeassistant]: not a directory @ data[ā€˜whitelist_external_dirsā€™][0]. Got ā€˜/backupā€™. (See /config/configuration.yaml, line 1).
confirm folder exists:
image

my config:

image

2018-04-21 20:45:22 ERROR (MainThread) [homeassistant.bootstrap] Error loading /config/configuration.yaml: while scanning a simple key
in ā€œ/config/configuration.yamlā€, line 16, column 3

Iā€™m tryed - ā€˜/configā€™, did not work too.

Have tried a reboot?

Bugger I didnā€™t mean to delete the last post, the suggestion was to single quote the path

hassio ho reboot serve?

I restarted every possible way

I donā€™t use hassio so I donā€™t know how best to reboot it.

finally I did work, however with the folder / backup does not work. Any idea why?

As noted by @nickrout Iā€™ve identified an issue with whitelists on Hassio. In general I often have to reboot the pi for changes to the config to take effect

I restarted, but only problem is in /backup folder. other folder is working.

I will move the backups to another folder using shell_command, but I wanted to understand this folder does not work

Please double check your logs for relevant warnings - pretty sure you get errors if whitelist/permissions is the problem

the error (in log) is above

OK I donā€™t see why /backup would be giving you a problem. Iā€™m able to monitor /share which is at the same level. My advice is that after every edit of whitelist you reboot the pi

I also can not understand, / share works, / backup as you said this at the same level, and have the same permissions

I have a different problem.

Is there anyway to exclude by pattern?

I just set this up on my device to monitor the /home/homeassistant/.homeassistant folder (which I assume is the exact same as /config in hassio) for files created. The idea being that if I add a new component and it creates a config file (feedreader.pickle for example) I can be alerted and add it to my .gitignore file before committing the changes.

Unfortunately, when I restarted, my notification service got spammed over a hundred times in the first minute with ā€œA new file .homeassistant_v2.db-wal was createdā€ and ā€œA new file .homeassistant_v2.db-shm was createdā€(which is presumably temp files that are created on database writes) and my CPU use shot up to 100% and the frontend froze.

I need to be able to exclude these files otherwise the component is unusable for me (and probably anyone else running normal homeassistant with a standard db).

Any ideas please?

Hi @anon43302295 with this component I didnā€™t anticipate that people would want to monitor the root directory, but rather sub-directories where components/addons would create files. Nevetheless I can see the use case for monitoring the root now.

So as per the docs you can use the pattern [!seq] to exclude seq, as I was able to do for a simple .db filename here. However I encountered a problem when trying to exclude the HA database with '[!home-assistant_v2.db]*' and the issue appears to be the use of - in the filename. I expect with a bit more investigation this can be resolved.

Thanks for the quick reply. :+1:

Iā€™m not near the computer at the moment but would !*[v2.db]* work? Or maybe *[!v2.db]* ?

I did have a look at those docs last night and, Iā€™ll be honest, they may as well be in Swahili (which is probably why Iā€™m struggling so much with trying to learn python, but thatā€™s another story).

1 Like