Giter VIP home page Giter VIP logo

hass-audiobookshelf's Introduction

Audiobookshelf

GitHub Release GitHub Activity License

pre-commit Black

hacs_badge Project Maintenance BuyMeCoffee

This component will set up the following platforms.

Entity Description
binary_sensor:connectivity Show whether the server is connected
sensor:open_sessions Show number of open audio sessions

Installation

Manual installation

  1. Using the tool of choice open the directory (folder) for your HA configuration (where you find configuration.yaml).
  2. If you do not have a custom_components directory (folder) there, you need to create it.
  3. In the custom_components directory (folder) create a new folder called audiobookshelf.
  4. Download all the files from the custom_components/audiobookshelf/ directory (folder) in this repository.
  5. Place the files you downloaded in the new directory (folder) you created.
  6. Restart Home Assistant
  7. In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Audiobookshelf"

Configuration

Getting an access token

  1. Log in as the admin user
  2. Go to Settings > Users
  3. Click on the account
  4. Copy the API Token from beneath the user's name

For more info on what the token can be used for see: https://api.audiobookshelf.org/#introduction

Setting up via the UI

Config in UI

Credits

This project was generated from @oncleben31's Home Assistant Custom Component Cookiecutter template.

Code template was mainly taken from @Ludeeus's integration_blueprint template


hass-audiobookshelf's People

Contributors

dependabot[bot] avatar wolffshots avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hass-audiobookshelf's Issues

Adding "Now playing" data a la spotify/sonos

This is awesome integration, thank you. If it's possible I would love to be able to pull the cover of the audiobook I'm listening to, like how Spotify or Sonos show the album art when an entity is playing.

Additional Sensor Ideas/Info

Hi,
Firstly, great work!

I thought I'd share the details of some other AudioBookShelf sensors I've added to HA as rest sensors, in case you wanted to add them to this integration also. Some of which I have found really useful, especial being able to track when a new podcast episode is available and when the size of my podcasts is getting too big and I should think about pruning them.

Using the api path http(s)://[URL]/api/libraries/[LIBRARY_ID]/stats gets you stats on a library as detailed below.

The [LIBRARY_ID] is in the format "abcdef12-4567-890a-bcdef1234567". I originally found it by taking it from the URL when viewing the library in the AudioBookShelf UI so you could get users to add them as part of the config flow but ideally you can list them from the API using http(s)://[URL]/api/libraries which would obviously be better.

Audiobooks
Number of books - value_json.totalItems
Number of authors - value_json.totalAuthors
Total Duration (hours) - ( value_json.totalDuration / 60 / 60 ) | round(0)
Total Size (GB) - ( value_json.totalSize / 1024 / 1024 / 1024 ) | round(2)

Podcasts
Number of podcasts (not episodes) - value_json.totalItems
Number of podcast episodes - value_json.numAudioTracks
Total Duration (hours) - ( value_json.totalDuration / 60 / 60 ) | round(0)
Total Size (GB) - ( value_json.totalSize / 1024 / 1024 / 1024 ) | round(2)

Hope that's useful!
Matt

What's the Access Token and where do i find it?

Thank you for your integration!

But I've got a questeion: What's the Access Token and where do i find it?
I assume it could be generated somewhere within audiobookshelf, but i can't find any option on v2.5.0 for this token, an api key or something similar.

Thanks in advance :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.