Nextcloud client

Hello,

Is there any addon/setting for Home Assistant to be Nextcloud CLIENT please ?

I’ve tried rclone but it’s not bidirectional and real time :confused:

What do you want to achieve?
Nextcloud is multi-faceted…

I’ve Calibre synced on multiple computers (Win & Linux) via a Newtcloud instance and i’d want to share my ebook library with phones/tablets (FBreader app) on my home network via my HAOS instance on rpi3 + HA COPS addon.

The obvious answer would be to have your Calibre library located on a NFS share, as that is allowed by HA as network storage, supported by the COPS addon and available to Nextcloud as External storage.

How feasible depends on how/where your nextcloud instance is hosted, though…

My Nextcloud is on OVH server.

As a bare-metal/VPS?
Then no problems that I can see.

  • Create a NFS share on your server
  • Move your calibre library from NC to the NFS
  • Create an external storage in NC pointing to the NFS local location
  • in HA, create a books “media” network storage and points to the NFS share (that’s what the addon asks for)

I can’t create NFS with my subscription :confused:

Ok, then you are basically stuck with WebDAV on the NC side, and HA doesn’t support it.

Maybe vote for

I found a solution for using Nextcloud or WebDAV as a media source in Home Assistant:

You can use the shell_command configuration. Just add the following lines to your configuration.yaml:

shell_command:
  instal_davfs: apk add davfs2
  echo_secrets: echo "https://url.to.webdav	username	password" >> /etc/davfs2/secrets
  deactivate_locks: echo "use_locks       0" >> /etc/davfs2/davfs2.conf
  mount_nextcloud: mount -t davfs https://url.to.webdav /media/nextcloud

Replace https://url.to.webdav with the URL of your Nextcloud WebDAV interface (you can find it in the “File Settings”).
You also need to change the username and password to the credentials for the Nextcloud user.

Now you can execute these commands as a service in the Developer tab. The commands must be executed from top to bottom.
With an automation triggered at boot or a script with a button, you can also run the last command as a service and mount the WebDAV directory automatically after a reboot or when necessary.

I’m not sure if re-executing the first three commands is necessary, as these changes are not lost when Home Assistant restarts. However, an update might require running the first three commands again. I still need to investigate this further.

The only limitation is that the files mounted in this way are only available within Home Assistant and cannot be accessed by any add-on.