Junglejim 354 Posted February 25, 2023 Share Posted February 25, 2023 (edited) Finally got around to the "Active Emby Users" sensor and it works really well. Thanks @seanbuff Edit: Had to play some more.. Saturday night and had a few.. Some OMV Love.. Edited February 25, 2023 by Junglejim 1 1 Link to comment Share on other sites More sharing options...
skank 82 Posted May 16, 2023 Author Share Posted May 16, 2023 Still would love a message when content is added... Link to comment Share on other sites More sharing options...
skank 82 Posted May 16, 2023 Author Share Posted May 16, 2023 On 2/3/2023 at 4:52 AM, seanbuff said: But why would you ever shutdown Emby??? The default minimized notification is okay, but when you expand it - it's not so good. Hi @seanbufftheres no way to only show the minimized version? Pity this still aint possible.. Do you have it explained somewhere how to set this up? Link to comment Share on other sites More sharing options...
seanbuff 842 Posted June 10, 2023 Share Posted June 10, 2023 On 16/05/2023 at 21:47, skank said: Do you have it explained somewhere how to set this up? Apologies for the delay in getting back to this. I'll assume you have some basic knowledge of how to create an automation within HA for this purpose. Firstly you need to create your unique webhook URL that Emby will send new media notifications to. Create Home Assistant Automation In HA, create a blank Automation. Add a Trigger of type 'Webhook' A unique ID will be generated, to which you can prefix some easy to identify words: Once added, be sure to click the 'Copy' icon at the end of that text box to save for later use Now for the 'Action', scroll down and click 'Add Action' and select 'Call Service' Assuming you have the HA app installed on your phone, you should see it pop up when you start typing "notify" Select the target device you would like the notifications received on. Now we need to switch the editor to YAML mode in order to enter the custom data. Go ahead and use the menu to switch from Visual to YAML This is the code I landed on to receive the notifications the screenshot you quoted service: notify.mobile_app_my_pixel_5 data: message: "{{ (trigger.data | string)[45:] }}" title: New Emby content has been added You can play around with the [45:] value to trim or add characters to the notification body. Save your Automation and name it something like "NOTIFY: Emby New Media" Now that we're done with the HA component, we need to head over to Emby and setup the webhook that will initiate the automation trigger. Add Emby Webhook Within Emby, go to 'Webhooks' and click '+ Add Webhook' Give it a meaningful name, and in the URL field, paste the webhook trigger that we copied from HA exactly as-is, it should contain the URL portion to your own HA instance (which could be an IP or hostname depending on your config) For the 'Events' - click on Library > New Media Added Finally click 'Send Test Webhook' to see if you get a notification on your chosen mobile device target using the HA companion app. Save it and there you have it. Have a play with it and let me know if you have any questions. 2 Link to comment Share on other sites More sharing options...
skank 82 Posted June 10, 2023 Author Share Posted June 10, 2023 (edited) Thx !!!! workign as a charm when i test it. Will see how it goes now when new media added. I've set it to 25 instead of 45 @LukeAny chance? "If @Luke ever gets around to adding an option to send Webhooks with a content-header of application/json then i'll revisit this." Edited June 10, 2023 by skank 1 Link to comment Share on other sites More sharing options...
Oxide 139 Posted June 19, 2023 Share Posted June 19, 2023 On 29/09/2022 at 04:59, seanbuff said: Does anyone know if it's possible to display the username instead of the device name? Link to comment Share on other sites More sharing options...
Junglejim 354 Posted June 21, 2023 Share Posted June 21, 2023 (edited) On 20/06/2023 at 03:26, Oxide said: Does anyone know if it's possible to display the username instead of the device name? Hi mate, I'm not sure you can with the sensor. The only thing I can think of is to edit the device name in the emby servers "Devices" page to reflect the user of that device.. I could change this to Junglejim. Edited June 21, 2023 by Junglejim 1 Link to comment Share on other sites More sharing options...
skank 82 Posted June 21, 2023 Author Share Posted June 21, 2023 (edited) On 6/10/2023 at 3:19 PM, skank said: Thx !!!! workign as a charm when i test it. Will see how it goes now when new media added. I've set it to 25 instead of 45 @LukeAny chance? "If @Luke ever gets around to adding an option to send Webhooks with a content-header of application/json then i'll revisit this." @seanbuffit doesnt seem to trigger Although i added media, i couldnt get anything heres my code [code] alias: "New media added to emby" trigger: - platform: webhook allowed_methods: - POST - PUT local_only: true webhook_id: emby-nieuwe-media-xxxxxxxxxxxxxxx condition: [] action: - service: notify.mobile_devices data: message: "{{ (trigger.data | string)[25:] }}" title: Nieuwe film of serie toegevoegd aan server! [/code] where xxx is the right webhook any idea? i've set also: limit library events to "each" so it should trigger right Edited June 21, 2023 by skank Link to comment Share on other sites More sharing options...
seanbuff 842 Posted June 21, 2023 Share Posted June 21, 2023 10 minutes ago, skank said: Although i added media, i couldnt get anything And if you hit the "Send Test Webhook" button? What happens? That would test the link between Emby and HA. Link to comment Share on other sites More sharing options...
skank 82 Posted June 21, 2023 Author Share Posted June 21, 2023 49 minutes ago, seanbuff said: And if you hit the "Send Test Webhook" button? What happens? That would test the link between Emby and HA. yeah then i get a message Link to comment Share on other sites More sharing options...
Oxide 139 Posted June 21, 2023 Share Posted June 21, 2023 6 hours ago, Junglejim said: Hi mate, I'm not sure you can with the sensor. The only thing I can think of is to edit the device name in the emby servers "Devices" page to reflect the user of that device.. I could change this to Junglejim. Thanks, I found editing the entities in HA did the trick, it also remove the Emby prefix 2 Link to comment Share on other sites More sharing options...
skank 82 Posted June 25, 2023 Author Share Posted June 25, 2023 On 6/21/2023 at 3:23 PM, skank said: yeah then i get a message any idea @seanbuff Link to comment Share on other sites More sharing options...
skank 82 Posted June 30, 2023 Author Share Posted June 30, 2023 i guess not? pity Link to comment Share on other sites More sharing options...
seanbuff 842 Posted June 30, 2023 Share Posted June 30, 2023 7 minutes ago, skank said: i guess not? pity Apologies, I've been away this week.. I had since disabled mine but will check on it in the next day or so and report back. Link to comment Share on other sites More sharing options...
skank 82 Posted June 30, 2023 Author Share Posted June 30, 2023 1 minute ago, seanbuff said: Apologies, I've been away this week.. I had since disabled mine but will check on it in the next day or so and report back. Hi ok no problem mate, thx for looking Link to comment Share on other sites More sharing options...
skank 82 Posted July 1, 2023 Author Share Posted July 1, 2023 IT would even rock if we could get a message saying which movie added + the cover added to it. But i guess its a bridge too far Link to comment Share on other sites More sharing options...
seanbuff 842 Posted July 1, 2023 Share Posted July 1, 2023 14 hours ago, skank said: IT would even rock if we could get a message saying which movie added + the cover added to it. That sorta thing would be best served by native notifications to the Emby mobile app itself, once Luke ever gets around to implementing. On 21/06/2023 at 22:22, skank said: it doesnt seem to trigger Although i added media, i couldnt get anything I have re-enabled mine and it's working just fine. Your YAML code looks okay, except you changing 45 to 25, by doing that you are prefixing text (garbage) to the start of the notification - i suggest you leave it at '45' to make it cleaner Also, your call service says "- service: notify.mobile_devices" -- what is that? is that a single phone or a group? Have you tried just selecting a single device? Have you also tried not limiting to any particular library, and just leaving as "Any" ? Link to comment Share on other sites More sharing options...
skank 82 Posted July 5, 2023 Author Share Posted July 5, 2023 On 7/2/2023 at 1:43 AM, seanbuff said: That sorta thing would be best served by native notifications to the Emby mobile app itself, once Luke ever gets around to implementing. I have re-enabled mine and it's working just fine. Your YAML code looks okay, except you changing 45 to 25, by doing that you are prefixing text (garbage) to the start of the notification - i suggest you leave it at '45' to make it cleaner Also, your call service says "- service: notify.mobile_devices" -- what is that? is that a single phone or a group? Have you tried just selecting a single device? Have you also tried not limiting to any particular library, and just leaving as "Any" ? Hi I changed the automation from 25 to 45 like you said, will see if that fixes it. the notify.mobile_devices is a group indeed. But when i test, all is working fine, it seems somehow when media is added, it doesnt trigger... I didnt limit it to any particular library, it is set like you mentioned to "any" Link to comment Share on other sites More sharing options...
skank 82 Posted July 8, 2023 Author Share Posted July 8, 2023 Update, after changing prefixing text, it didnt trigger Any further ideas? Link to comment Share on other sites More sharing options...
seanbuff 842 Posted July 8, 2023 Share Posted July 8, 2023 1 hour ago, skank said: Any further ideas? Have you tried notifying just a single device instead of a group? Copy my steps exactly to get it working first before trying other things Link to comment Share on other sites More sharing options...
skank 82 Posted July 8, 2023 Author Share Posted July 8, 2023 3 hours ago, seanbuff said: Have you tried notifying just a single device instead of a group? Copy my steps exactly to get it working first before trying other things Tried both... Still the same... it doesnt work. I added new movie, but no message. When i test the webhook (and so the automation) , i do get the message. Its completely the same automation is you said. Even settings in emby is completely the same Link to comment Share on other sites More sharing options...
seanbuff 842 Posted July 9, 2023 Share Posted July 9, 2023 On 09/07/2023 at 01:06, skank said: Still the same... it doesnt work. Do you have a log file you can provide that covers the time you add new media to Emby? You should see the httpclient module issue a POST towards your Home Assistant instance, do you see that? Info HttpClient: POST http://homeassistant:8123/api/webhook/emby-new-media-adkq5cmZgNizmfW3XXXXXXXXX If you're not seeing that, then Emby is not even notifying HA. Link to comment Share on other sites More sharing options...
skank 82 Posted July 11, 2023 Author Share Posted July 11, 2023 (edited) On 7/10/2023 at 1:37 AM, seanbuff said: Do you have a log file you can provide that covers the time you add new media to Emby? You should see the httpclient module issue a POST towards your Home Assistant instance, do you see that? Info HttpClient: POST http://homeassistant:8123/api/webhook/emby-new-media-adkq5cmZgNizmfW3XXXXXXXXX If you're not seeing that, then Emby is not even notifying HA. Mmm i will check, hopefully i can look a couple of days back in the log? What if im not seeing it? Can i fix it then somehow And in which log i need to search? I see 4 logs Edited July 11, 2023 by skank Link to comment Share on other sites More sharing options...
skank 82 Posted July 11, 2023 Author Share Posted July 11, 2023 (edited) update: yes i found it -08 14:03:43.550 Info HttpClient: POST http://192.168.10.6:8123/api/webhook/Emby-nieuwe-media-B2rpQzr9MvsdSDVvc4556 Edit 2: strange thing though, the code i see there, is different than the code i set up in emby as webhook (and in home assistant automation) I changed the code in home assistant now to B2rpQzr9MvsdSDVvc4556 Will see if it triggers now although its set up in emby webhook differently edit 3: after my change, i added another movie to emby, then i looked back into the new logs, and there i couldnt find the line " Info HttpClient: POST http://192.168.10.6:8123/api/webhook/Emby-nieuwe-....." Edited July 11, 2023 by skank Link to comment Share on other sites More sharing options...
seanbuff 842 Posted July 12, 2023 Share Posted July 12, 2023 13 hours ago, skank said: strange thing though, the code i see there, is different than the code i set up in emby as webhook Sounds pretty confusing. There should be no way Emby is sending to an ID you never gave it. If I were you I would start again, clean from scratch, including getting HA to generate a new webhook ID for you (not edit it yourself) and then delete and create a brand new webhook on the Emby side using the new URL. Give that a shot and see how you go -- at least you know what you're looking for now. Good luck. 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