adam1010 19 Posted June 3, 2017 Posted June 3, 2017 I still use Kodi (with the Emby add-on) on a few TVs because it supports displaying notifications that are sent to its API. So for instance, I can call the Kodi JSON API endpoint with a message like: "Motion detected at the front door" "Spa temperature is 103 degrees" "New text message from John Smith" Then the message is displayed as an overlay on whatever content I'm watching (or just at the top of the screen if no media is playing). I'm able to specify a title and duration for the notification as well. In the case of Emby, I would also want to specify if the alert should be broadcast to (a) all connected devices, or ( to all devices logged in with certain USERS I'm happy to provide screenshots for how the alerts display in Kodi if that would be helpful. Any idea if something like this has been considered before or is on the roadmap? It really is the only feature that keeps me using Kodi (with Emby plugin) on my TVs instead of just using Emby directly.
ebr 15579 Posted June 3, 2017 Posted June 3, 2017 The API for this actually already exists in Emby Server and most (I believe) apps can display them. The part that is missing right now is the interface in the web/mobile apps to send them.
adam1010 19 Posted June 3, 2017 Author Posted June 3, 2017 @@ebr That's awesome! I don't plan on using the web/mobile apps to send the notifications (I'll use scripts to post directly to the server API). Where can I find the API documentation for sending notifications?
Luke 39654 Posted June 3, 2017 Posted June 3, 2017 Due to the lack of place to send them, it doesnt get enough testing but we are happy to resolve issues that you run into. Thanks.
adam1010 19 Posted June 3, 2017 Author Posted June 3, 2017 @@Luke Thanks for the support, I'd be happy to test it and provide any relevant feedback. Can you point me to the API endpoint I should be using?
Luke 39654 Posted June 4, 2017 Posted June 4, 2017 https://github.com/MediaBrowser/Emby/wiki/Remote-control
adam1010 19 Posted June 4, 2017 Author Posted June 4, 2017 Thanks @@Luke I opened this in my browser: http://192.168.1.xxx:yyyy/Sessions?api_key=xyz to get the list of sessions, and then took the "Id" field from my main TV and used: http://192.168.1.xxx:yyyy/Sessions/{the_ID}/Playing/Stop?api_key=xyz However, it then displayed an error message: Unable to find the specified file. Does it require a "POST" request or something other than just accessing from a GET URL request?
Luke 39654 Posted June 4, 2017 Posted June 4, 2017 https://github.com/MediaBrowser/Emby/wiki/Authentication
adam1010 19 Posted June 5, 2017 Author Posted June 5, 2017 Thanks @@Luke I was able to get an authorization token and was able to Pause/Stop content. However, "DisplayMessage" doesn't appear to do anything on my Android TV (it returns a 204/No Content). Is that the correct method? curl 'http://192.168.1.x:xyz/emby/Sessions/xxx/Command/DisplayMessage'-H 'x-mediabrowser-token: xxx' -H 'x-emby-authorization: MediaBrowser Client="Emby Mobile", Device="Chrome", DeviceId="xxx", Version="3.2.13.0", UserId="xxx"' -H 'content-type: application/json' --data-binary '{"Header":"Hello","Text":"World","TimeoutMs":10000}'
Luke 39654 Posted June 5, 2017 Posted June 5, 2017 Did you first get the session info and check that it is listed in it's SupportedCommands?
adam1010 19 Posted June 5, 2017 Author Posted June 5, 2017 It's NOT listed as a supported command. The list includes: DisplayContent, Mute, Unmute, ToggleMute Do I have to enable it or was this functionality never added to the Android TV app?
Luke 39654 Posted June 5, 2017 Posted June 5, 2017 It was probably never added. You should probably start with basic testing sending these to the web app and emby theater, then @@ebr can add it to android tv when possible. thanks.
adam1010 19 Posted June 5, 2017 Author Posted June 5, 2017 Sounds good. I just tried the command in the web app and it did pop up a modal box. The modal box is blank and has a green "Got It" button to dismiss the modal. Do my command arguments look wrong or do you think it's a bug? My TVs are either Linux or Android so I won't be able to test Emby theater.
chef 3805 Posted June 5, 2017 Posted June 5, 2017 (edited) Sounds good. I just tried the command in the web app and it did pop up a modal box. The modal box is blank and has a green "Got It" button to dismiss the modal. Do my command arguments look wrong or do you think it's a bug? My TVs are either Linux or Android so I won't be able to test Emby theater. I believe you can browse to tv.emby.media to test the theater, in any web browser Edited June 5, 2017 by chef
adam1010 19 Posted November 7, 2017 Author Posted November 7, 2017 Hey @@Luke -- Thanks for implementing this universally, I can send notifications to all my devices now, even my Android TV! I've wired it up to my SmartThings hub -- It's fantastic :-) Am I supposed to be able to set a Title/Header for the message? I've tried specifying one but it doesn't come through on the clients. Emby Web client just shows the message body (no title), while the Android TV shows a hard-coded title of "Remote Message" for everything.
Luke 39654 Posted November 7, 2017 Posted November 7, 2017 It's up to each app to manage the display and some might be ignoring the title. But it sounds like you are doing the right thing.
ebr 15579 Posted November 7, 2017 Posted November 7, 2017 There is no way to set a title using our send dialog from the dashboard, right? In any case, the Android TV and Fire TV apps will use it if specified with the next release.
adam1010 19 Posted November 7, 2017 Author Posted November 7, 2017 @@ebr You're the man, thanks! Correct, the web dashboard UI doesn't currently have an input box to specify a title.
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