New Add-on: Minimal Calibre Library HA COPS 📚

icon HA COPS eBook Library

I wanted to make my Calibre library easily available in my home, so my kids and vistors can browse my ebook collection and download any books they want to read. Since my HA server is always up and running, it felt like the right place to host the library.

The Add-on is based on COPS, a lightweight Calibre library web application built using PHP. You can browse your collection by author, title or tag through a web browser or an OPDS feed reader such as Moon+ or Librera and directly download them onto your ebook reader. You can also read ePub format books through an embedded web reader.

To keep things small and simple, the add-on uses the PHP built in web-server. In order to make it easier to get the library files onto the HA server, it also includes rsync. This is then used to copy the Calibre library folder into the /media folder on the HA server (seemed appropriate).

This is my first Home Assistant Add-on so I would really appreciate feedback and suggestions.

Add my repository
Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.
Install the Add-on
Open your Home Assistant instance and show the dashboard of a Supervisor add-on.

You can also go directly to the add-on code in my repository.

Thanks to Sébastien Lucas who wrote the original COPS.

Thanks also to Mike’s Pub Organisation for updating COPS for compatibility with PHP 8, as well as rounding up various bug fixes and improvements made by other contributors.

1 Like

Neat. This is a lighter version of the calibre-web application Alex converted? This has been on my list for a while to setup.

Yes - it is lighter weight than the full Calibre-web, which was the original motivation for Seb Lucas in creating COPS. It uses very little resource and most eBooks are very small compared to video or audio. I have 314 books in my library so far, including a few comic books which are larger - takes up 1.7 Gb. Probably better suited if your data drive is not an SD card.

I just released a new version of this add-on (well, actually several since my last post).

With the addition of support for Network Storage in Home Assistant 2023.5 it is now easy to access your library through this addon if it is stored on network attached storage.

You can still use library files stored on the Home Assistant server as before.

I have also made some improvements, and integrated recent bug fixes and improvements made to COPS by Mike’s Pub Organisation.

If you like reading books, please try out this add-on!

1 Like

I just released a new version (1.9) that allows sending ePub’s via email directly from the server. This gives another way to get books onto Kindle (using Kindle email addresses) amongst other things.

Version 1.10 is now released, adding some minor fixes and incorporating upstream changes to COPS.

Version 1.11 now released. This adds a new template - bootstrap5 - and upstream improvements particularly to OPDS feeds.

Version 1.12 released today, which incorporates the most recent COPS release (1.4.5) as well as some template tweaks to bootstrap5 (need a better name!).

Version 1.13 released today. This incorporates a massive update to the backend code for COPS, and improvements to the bootstrap5 template, and fixes for functionality on Kindle eInk readers through the “Experimental” web browser.

Click this link to upgrade if you already installed
Open your Home Assistant instance and show the dashboard of a Supervisor add-on.

Follow the instructions in the first post to install.

All feedback very welcome!

Version 1.14 just released.

  • Ability to download all books by an author or in a series as a zip file in either MOBI or EPUB format (as long as you have those formats).
  • Improvements to search and sorting
  • Some tweaks for accessing library through Kindle Experimental Web Browser
  • Many backend improvements to COPS

Click this link to upgrade if you already installed
Open your Home Assistant instance and show the dashboard of a Supervisor add-on.

Follow the instructions in the first post to install.

As usual, please give feedback if you find this useful or you would like to see improvements.

Only a day later, and 1.15 is out. I fixed a bug where the customisation page was not working on Kindle experimental browser and also made the radio and check boxes larger on the kindle.

For users of Kindle Paperwhite, I recommend switching to the Default theme and Kindle style for easier usage.

1 Like

Version 1.16 just released.

  • Update to COPS 2.2.1
    • Support display settings for custom columns
    • Add Japanese translations
    • Use server side rendering for Kobo as well as Kindle
    • Add bootstrap2 kindle style - much easier to use on Kindle if you use this Template and Theme
    • General improvements when viewing COPS with the Kindle Experimental Web Browser
    • Updated Bootstrap5 template to use Bootstrap 5.3.2

Note that some pihole filterlists are now blocking - if bootstrap5 template looks odd, you may need to whitelist

Thnxs for this wunderfull integration. Wishlist: ingress support

I’m so happy that this add-on is useful to you!

I did look into Ingress support when I first made the add-on. Two things held me back:

  • I really wanted to be able to access my library from my Kindle. Kindle cannot handle the Home Assistant web page so it needs direct access, and Ingress only allows access via the internal home assistant IP address - not external clients.
  • The add-on includes an rsync server for copying your Calibre library into the HA server’s media folder - I wanted to store my library there rather than keep my laptop on all the time. Again, this is prevented by the Ingress requirement to only allow internal network communication.

There may well be workarounds for these things. I just wasn’t compelled to seek them out yet.

If you let me know why you want Ingress I will take another look and see if I can figure it out.

Version 1.17 just released, incorporating bug fixes and improvements in COPS 2.3.1.