Folder Watcher not triggering on mounted network storage

Hello Everyone,

I have been testing folder_watcher for an automation workflow I need. I setup a NAS storage in Settings > System > Storage:

image

The share works well both from the NAS side and from HASS side:

HASS NETWORK STORAGE (HNS):

NAS “REAL” FOLDER (NRF):

Once done, if I create a file on the HASS side (for instance, copying a file straight to the HNS screenshot folder above), the folder_watcher triggers upon file creation and the related automation runs as expected. However, if I create a file on the NAS side (for instance, copying a file straight to the NRF screenshot folder above), the foder_watcher is not triggered.

From my point of view, if the folder_watcher process was just monitoring the path for files, it should trigger regardless of how the file is getting into the folder. How does it work in the background? Is there anyway for this work as I need? I would like to detect the files which are being created in such folder by a camera surveillance software (Synology Surveillance Station), something that it is happening in the NAS side. Thanks.

One would need more details about the specific protocol used and such (but I won’t pretend to know all of them; just saying it matters).

I haven’t paid a lot of attention to the new built-in HA functionity for shares, but suffice to say you’ll probably not be able to tweak any settings.

Remember, since it’s network storage, the remote host might not be maintaining a constant connection — or at least, it might not be notified of changes. File watchers in general work best with local storage.

If you’re running HAOS I’d say you luck is out. If not, you can set up the mount yourself for better control, but I suspect you won’t get it working.

I am using samba and HASS OS…

I don’t think this is a network share related issue. Maybe it has something to do with users/permissions, although I am not sure. Just tried to sync folders with Syncthing addon instead of using network shares and result is the same: folder_watcher is not triggered if the file is copied through Syncthing but it is triggered if I copy a file manually ot just duplicate one.

Well… the truth is that I guess that Syncthing also works with a kind of network shares in the background…

I can’t figure out how to make it work. :frowning:

Finally, I setup the workflow the other way around and it works fine. I mean, instead of mounting the NAS folder in HASS, I setup the remote HASS folder in Synology Surveillance Station as the main storage for every camera. For whatever reason I still don’t understand, file closing triggering works this way. It works for the purpose, although it would be great to know the background on how Folder Watcher really works and what the specific limitations are.

1 Like

I told you why: changes may not propagate reliably to the clients. Local file changes will work the most reliable. Turning your situation around is a good idea.

Since we now know it’s Samba:

https://www.google.co.za/search?q=watching+file+changes+samba+share