seanbuff 840 Posted January 3, 2023 Share Posted January 3, 2023 (edited) 3 hours ago, WORMUTHS said: The counts look off when I did this. I think the value_template: '{{ value_json ["MovieCount"] }} is counting all kinds of movies. Home Videos, etc... It's not broken out by library, which I'd prefer. I suppose I need to know what the API endpoints are. Right now, it seems as though it adds my videos in "Home Movies" to the total "Movie" count, but they are separate things. I noticed the same thing, it's counting all the media in my Documentaries library also (and others), which adds quite a bit. So while probably not the correct way of doing it, but as the library item count service supports specific a UserId's library access, i created a separate user with access only to my "Movies" library Update the resource endpoint string to include the UserId like so: http://<Emby_IP>:8096/emby/Items/Counts?UserId=<user_Id>&api_key=<api_key> To get the UserId, just click on the user in your settings, and grab the end of the URL string ...and the counts are much more accurate. Bit of a hack, but it does the job until we can find the proper way Edited January 3, 2023 by seanbuff 1 Link to comment Share on other sites More sharing options...
HouseOfCards 70 Posted January 3, 2023 Share Posted January 3, 2023 3 hours ago, seanbuff said: http://<Emby_IP>:8096/emby/Items/Counts?UserId=<user_Id>&api_key=<api_key> I think maybe I am formatting this wrong. When I add the User ID all the sensors show no values, like they are unavailable. Is it supposed to be a double "&&" or something. Studio Code Server is highlighting the ampersand like the URL has got bad formatting or something. Link to comment Share on other sites More sharing options...
seanbuff 840 Posted January 3, 2023 Share Posted January 3, 2023 (edited) 9 minutes ago, WORMUTHS said: I think maybe I am formatting this wrong. When I add the User ID all the sensors show no values, like they are unavailable. Is it supposed to be a double "&&" or something. Studio Code Server is highlighting the ampersand like the URL has got bad formatting or something. No double '&&' You can use the Swagger link at the bottom of your Dashboard to help build the string Click the 'Try it out' button and add the UserId to the optional field Edited January 3, 2023 by seanbuff more info Link to comment Share on other sites More sharing options...
HouseOfCards 70 Posted January 3, 2023 Share Posted January 3, 2023 (edited) I get a "Failed to load API definition" error when I click API on my dashboard... Grrrr.... I'm just using the Static View... Edited January 3, 2023 by WORMUTHS Link to comment Share on other sites More sharing options...
Spaceboy 2493 Posted January 3, 2023 Share Posted January 3, 2023 (edited) 14 minutes ago, WORMUTHS said: I get a "Failed to load API definition" error when I click API on my dashboard... Grrrr.... I'm just using the Static View... you have to load the api from a https connection edit - localhost also works. local remote through ip address will result in "Failed to load API definition" Edited January 3, 2023 by Spaceboy Link to comment Share on other sites More sharing options...
HouseOfCards 70 Posted January 3, 2023 Share Posted January 3, 2023 15 hours ago, seanbuff said: No double '&&' So I did it correctly... Copying between my text editor and VS Code was copying an "invisible character" and breaking the URL. I updated and rebooted, now I need to see if they update the counts correctly. Link to comment Share on other sites More sharing options...
Cheesegeezer 3086 Posted January 3, 2023 Share Posted January 3, 2023 2 hours ago, WORMUTHS said: So I did it correctly... Copying between my text editor and VS Code was copying an "invisible character" and breaking the URL. I updated and rebooted, now I need to see if they update the counts correctly. To follow on from the api dev request. Just getting the counts will probably yield undesirable returns. So as i states you will probably need to create stricter filters in the requests and so it per library also. The calls are inexpensive in terms of time, 10-20ms as you don’t need images but you would need to create some logic also to specify if the library is ofType movie then apply includeitemtypes “movie”, etc. Link to comment Share on other sites More sharing options...
HouseOfCards 70 Posted January 3, 2023 Share Posted January 3, 2023 Right now, these sensors would be alright with me as a starting point. It is accurately counting items, although it doesn't break them out by library. It's not a dealbreaker. I still get an accurate count of movies I have, even if it is a total of three separate libraries. I can live with that for now. I only have one issue to sort out. This is what the counts show... They are all correct except for "Music Tracks". That is showing 1,445 more tracks than I have, and I have no idea where it's pulling those additional totals from. Almost seems like a bug in the API. 1 Link to comment Share on other sites More sharing options...
HouseOfCards 70 Posted January 4, 2023 Share Posted January 4, 2023 1 hour ago, WORMUTHS said: Almost seems like a bug in the API. It's a bug with me. LOL It's counting podcasts from the Podcast plug-in as music files. 1 Link to comment Share on other sites More sharing options...
coreyjohnson75 1 Posted January 7, 2023 Share Posted January 7, 2023 On 1/1/2023 at 2:34 AM, seanbuff said: There's currently {{ states("sensor.emby_users_watching") }} active Emby session(s) How are you doing this? And in the same card that shows the Active Sessions? I tried adding to the Title but keep getting just the text/state-sensor itself, not the data. Is there an additional card mod? Link to comment Share on other sites More sharing options...
seanbuff 840 Posted January 7, 2023 Share Posted January 7, 2023 7 minutes ago, coreyjohnson75 said: How are you doing this? And in the same card that shows the Active Sessions? I tried adding to the Title but keep getting just the text/state-sensor itself, not the data. Is there an additional card mod? Two separate cards. I'm using a Mushroom Title card for the text above the active sessions card. HTH. 1 Link to comment Share on other sites More sharing options...
seanbuff 840 Posted January 7, 2023 Share Posted January 7, 2023 On 02/01/2023 at 23:53, Spaceboy said: something around the emby pc performance at the OS level. i have a sensor for power used by monitoring a smart plug into which the emby pc is plugged and i have previously done some of this separately through prtg and telegraf/grafana. I use IOT Link for this, it's lightweight and works well. Will pull in OS level stats into HA for you to display as entities or graph them There's a good guide for setting this up here. Another alternative for other OS's is Glances 1 1 Link to comment Share on other sites More sharing options...
coreyjohnson75 1 Posted January 7, 2023 Share Posted January 7, 2023 Thanks! I love HA but have never really added in the customizations so finally getting around to fancying it up 1 Link to comment Share on other sites More sharing options...
Spaceboy 2493 Posted January 7, 2023 Share Posted January 7, 2023 14 hours ago, seanbuff said: I use IOT Link for this, it's lightweight and works well. Will pull in OS level stats into HA for you to display as entities or graph them There's a good guide for setting this up here . Another alternative for other OS's is Glances this is pretty cool. you can even get a snapshot of the desktop! Link to comment Share on other sites More sharing options...
Spaceboy 2493 Posted January 7, 2023 Share Posted January 7, 2023 regarding long term graphing, i've started sending all my HA data to influxdb which i was already using for dashboarding pfsense stats. graphing in HA seems a bit limited Link to comment Share on other sites More sharing options...
troy_ 4 Posted January 12, 2023 Share Posted January 12, 2023 Has anybody created anything to interact with Emby. I love getting all the data out, but, one thing I'm really missing from Plex is the ability to launch content either automatically or interactively. For example - when nobody is home, Star Trek Voyager starts playing for our dogs to watch. For reference - this is how it's done with Plex. The Plex integration has the ability to be used as a media source: plex://{"library_name": "Movies", "title": "Groundhog Day"} If someone has a way to do that - I'd really appreciate the help! Link to comment Share on other sites More sharing options...
Spaceboy 2493 Posted January 12, 2023 Share Posted January 12, 2023 i imagine its possible through the api but i'm not sure how. its something i've been inteested in myself but never got round to researching Link to comment Share on other sites More sharing options...
troy_ 4 Posted January 13, 2023 Share Posted January 13, 2023 Obviously a lot of work to do. Plex's implementation here makes it look easy because the heavy lifting is done by their library. Is their an official library for Emby - I've found this. Link to comment Share on other sites More sharing options...
Spaceboy 2493 Posted January 13, 2023 Share Posted January 13, 2023 (edited) 18 hours ago, troy_ said: Obviously a lot of work to do. Plex's implementation here makes it look easy because the heavy lifting is done by their library. Is their an official library for Emby - I've found this . i don't think its that difficult. this thread seems to cover it although i tried and get the same result and unfortunately it doesnt seem to have been resolved. API is accesses at the bottom of the dashboard i think we want /Sessions/{Id}/Playing i got the item id by looking at the url when on an media item in the web client i got the device id from running /Sessions but i also get a 204 response code and the error message on the target saying no compatible streams available. Hopefully a knowledgeable api person will tell us where its going wrong. in the other thread luke mentions you need the id from the db. i think thats what the id in the url is but not certain Edited January 13, 2023 by Spaceboy Link to comment Share on other sites More sharing options...
seanbuff 840 Posted January 14, 2023 Share Posted January 14, 2023 4 hours ago, Spaceboy said: but i also get a 204 response code and the error message on the target saying no compatible streams available. I had no issues running this in cURL or Postman, you just can't start it from Swagger for whatever reason. So then as a test, I added it to Home Assistant using the 'rest_command' function which creates a service. Then added some buttons to the UI to call the service and instantly trigger media playing on whichever SessionId chosen: Example: You could then also use these services in automations as @troy_ requested Agree, it's not the most elegant solution, and it would be nice to be able to use "friendly" names like the Plex integration provides - but it does the job. 1 Link to comment Share on other sites More sharing options...
Junglejim 351 Posted January 14, 2023 Share Posted January 14, 2023 This is a nice open source app, I've been playing around with it intermittently for the past few months. Running it in a docker so some things are not as easy as the OS, say on a Raspi but I'm getting there. I've got the standard Emby stuff working, plus my solar data and my lifix lights. Still got a lot to learn but I enjoy that aspect of software like this. Plus this community help out heaps! Link to comment Share on other sites More sharing options...
Spaceboy 2493 Posted January 14, 2023 Share Posted January 14, 2023 14 hours ago, seanbuff said: I had no issues running this in cURL or Postman, you just can't start it from Swagger for whatever reason. So then as a test, I added it to Home Assistant using the ' rest_command ' function which creates a service. Then added some buttons to the UI to call the service and instantly trigger media playing on whichever SessionId chosen: Example: You could then also use these services in automations as @troy_ requested Agree, it's not the most elegant solution, and it would be nice to be able to use "friendly" names like the Plex integration provides - but it does the job. cool - ta. i plan to use this as part of my morning automation. as my withings sleep monitor detects that i am out of bed, turn the lights on in the living room and start playing the news channel on the tv 1 Link to comment Share on other sites More sharing options...
troy_ 4 Posted January 15, 2023 Share Posted January 15, 2023 Apologies all - I'm feeling quite dense. I can't see how I would use the API to cast to an arbitrary endpoint as I have historically done with the Plex integration in Home Assistant. The API seems like I can start playback on a known/running Emby player. Can somebody help get an example together of using the API to search for an arbitrary string (eg "Die Hard (1998)") in a library (eg "Movies") and play it on an arbitrary cast endpoint (eg "Living Room TV") If I know the id of an item, I can play it via an API call - but I can't see how to do anything covered here (Plex Integration). Link to comment Share on other sites More sharing options...
seanbuff 840 Posted January 15, 2023 Share Posted January 15, 2023 2 minutes ago, troy_ said: I can't see how I would use the API to cast to an arbitrary endpoint as I have historically done with the Plex integration in Home Assistant. You can't, that's why I said this: On 14/01/2023 at 11:04, seanbuff said: Agree, it's not the most elegant solution, and it would be nice to be able to use "friendly" names like the Plex integration provides For the current Emby integration, a number of bits of information need to be known beforehand, like the Media Item ID and a Session ID. 1 Link to comment Share on other sites More sharing options...
troy_ 4 Posted January 15, 2023 Share Posted January 15, 2023 2 minutes ago, seanbuff said: You can't, that's why I said this: For the current Emby integration, a number of bits of information need to be known beforehand, like the Media Item ID and a Session ID. Apologies - thank you. Assuming also not possible to get the media URL to play on an arbitrary endpoint (like a cast device)? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now