-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Additional Sensor Ideas/Info #2
Comments
Amazing thanks! When I have some time I’ll sit down and take a proper look at this but I’d be keen to add these |
I'm excited to start using ABS and this home assistant integration looks great. I haven't read too far into the API documents so I'm not sure what's possible and what's not. I think it would be really cool if you could call a Service to "Continue playing last audio book on XYZ media player". On top of that I'm looking forward to using this kind of stuff with Voice commands in home assistant. |
Okay folks, I did not know what I was doing so I have basically rewritten the integration from scratch to do it a bit better. I have push v0.1.1-pre which is a pre-release version to add some library sensing stuff. To actually add dynamically created and removed library sensors was proving too difficult for my small non-pythonic brain so I have opted to add the details in an attribute on the Library sensor instead. I'm still going to clean it up and improve the attributes but this is what it looks like on that release: The re-implementation does not support adding the integration from the UI (I hope to get to that) so for now it is from
Y'all are welcome to give it a go and let me know if there are any major problems but no stress if not. I'll post here again when I have something more complete. |
Just curious if this is still being actively developed. |
@lhassell I would like to continue but haven't found time or motivation for it in a while unfortunately |
Oops, I didn't mean to close this. I have finally had some time to sit down and rewrite how I do the sensors and included a way to add sensors for libraries. It's far from perfect so I'll reopen this issue and if there are any specific things missing I can track them in here. |
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
The text was updated successfully, but these errors were encountered: