I’m trying out the folder_watcher
integration but I can’t figure out why I’m getting a OSError: Permission denied
error (generated by the listener code, AFAICS). It’s close to the example in the docs for this integration.
As far as I can see, I’ve done everything correctly: The folder (directory) I’m watching is /tmp
and it’s whitelisted and is world-readable.
The only thing I can think of is that the folder watcher only works on relative paths in the HA config directory, but it’s not clear to me from the docs whether that’s the case.
Minimal config:
homeassistant:
...
whitelist_external_dirs:
- /tmp
shell_command:
copy_files: "cp /tmp/test_*.* /home/homeassistant/.homeassistant/www/gallery/"
folder_watcher:
- folder: /tmp/
patterns:
- "test_*.*"
automation:
- alias: Copy New File
initial_state: true
trigger:
platform: event
event_type: folder_watcher
event_data:
event_type: created
action:
service: shell_command.copy_files
Files, directories and permissions:
/tmp $ ls -lah .
total 180K
drwxrwxrwt 10 root root 12K May 22 17:39 .
~/.homeassistant/www/gallery $ ls -lah .
total 3.8M
drwxr-xr-x 2 homeassistant homeassistant 4.0K May 22 17:38 .
I’ve called the copy script from the dev tools and that works.
I can’t see anything wrong. I’d appreciate a bit of help.
PS: I’ve had another automation copying files also from /tmp
but triggered by a motion sensor and that’s been working forever, so I’m quite certain my whitelist and permissions are fine (at least fine enough for that to work).