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