Jump to content

New Plugin: Emby.Notification.Slack


ackbarr

Recommended Posts

horstepipe

The only error I'm getting in log is:

Could not find handler for /emby/Notification/Slack/Test/xxxxxxxxxxxxxxxxxxxxxxx
Link to comment
Share on other sites

horstepipe

@@Luke maybe you could help me by telling me what's the meaning of the error in the log file?

Everything worked fine here until I deleted the channel and re-setup the plugin.

Link to comment
Share on other sites

ackbarr

Everything worked fine here until I deleted the channel and re-setup the plugin.

 

The plugin still sends notifications via Slack, it is simply the wiring between the test notification button in the configuration page and the plugin that is broken.  I've compared my code to other similar plugins in the repository (PushBullet PushALot, etc),  and have not found any reason the existing javascript in the configuration page stopped working.

  • Like 1
Link to comment
Share on other sites

horstepipe

The plugin still sends notifications via Slack, it is simply the wiring between the test notification button in the configuration page and the plugin that is broken.  I've compared my code to other similar plugins in the repository (PushBullet PushALot, etc),  and have not found any reason the existing javascript in the configuration page stopped working.

Just caught my eye that the plugin isn't listed at notifications -> services -> installed services, either (self-translated from German). Or is this because the plugin is not listed in the catalogue?

Ok I'll try if notifications will work in general, thank you for the answer!

Edited by horstepipe
Link to comment
Share on other sites

chef

Sorry guys how does this integrate with Slack?

 

Do you send messages to slack or Recieve messages from slack?

 

Where do the messages appear or how do they send?

 

We were talking about ways to communicate between server admins and users. Is this what this plugin allows?

 

Thanks very much

Link to comment
Share on other sites

ackbarr

Sorry guys how does this integrate with Slack?

 

Do you send messages to slack or Recieve messages from slack?

 

Where do the messages appear or how do they send?

 

We were talking about ways to communicate between server admins and users. Is this what this plugin allows?

 

Thanks very much

 

This plugin sends emby notifications to a slack chat channel of your choice. The main use case (for me anyway) is to tell my family (which all use my emby server) when new content has been grabbed, imported, and added to Emby's library. The plugin relies on slack incoming webhooks, so it can only send messages, not receive. It also cannot be used to control your emby install via slack - although now that I type it, that is an interesting idea.  

 

Slack by itself would provide a chat channel to communicate between server admins and regular users, no plugin to emby needed.

  • Like 1
Link to comment
Share on other sites

ackbarr

can you set it up in a way that the channel and user are not mandatory fields?

Most likely - the Slack Incoming Webhooks API does not consider these required fields. Can you explain the use case a bit?  I'm struggling to see how you would use it. Are you simply wanting to control the channel and user on the slack webhook side? Or were you asking if the channel and user can be set dynamically based on some conditional logic?

 

@@ackbarr It's also not in the Emby Catalog right?

Correct, I discussed adding it to the catalog with ebr last fall when I initially released the plugin. Then I left for a business trip and forgot to follow up on it.  That's on me.

Link to comment
Share on other sites

makarai

Are you simply wanting to control the channel and user on the slack webhook side?

 

Yes that's exactly right I'll manipulate with an incoming script what ever the Jasn contains. I use a self hosted slack alternative, that natively supports slack webhook scheme as long as Chanel and user is not set. (rocket.chat)

 

Thanks :)

Edited by makarai
Link to comment
Share on other sites

ackbarr

Are you simply wanting to control the channel and user on the slack webhook side?

 

Yes that's exactly right I'll manipulate with an incoming script what ever the Jasn contains. I use a self hosted slack alternative, that natively supports slack webhook scheme as long as Chanel and user is not set. (rocket.chat)

 

Thanks :)

Ok that makes a bit more sense. I haven't played with rocket.chat before, but it looks interesting. Based on their documentation, we might not need to change the plugin as it looks like the script handler can overload properties coming from the json. The example script (https://rocket.chat/docs/administrator-guides/integrations/) shows extracting the text property from the posted json (stored in request.content?) and putting it into a new content object.

Link to comment
Share on other sites

Sven

Most likely - the Slack Incoming Webhooks API does not consider these required fields. Can you explain the use case a bit?  I'm struggling to see how you would use it. Are you simply wanting to control the channel and user on the slack webhook side? Or were you asking if the channel and user can be set dynamically based on some conditional logic?

 

Correct, I discussed adding it to the catalog with ebr last fall when I initially released the plugin. Then I left for a business trip and forgot to follow up on it.  That's on me.

 

No problem. For me as developer, no problem to add the channel. 

But for other people it will be harder.

 

When it's in the catalog it would be easier for them. :)

Link to comment
Share on other sites

ackbarr

Are you simply wanting to control the channel and user on the slack webhook side?

 

Yes that's exactly right I'll manipulate with an incoming script what ever the Jasn contains. I use a self hosted slack alternative, that natively supports slack webhook scheme as long as Chanel and user is not set. (rocket.chat)

 

Thanks :)

 

I setup my own rocket.chat server this morning and was able configure a webhook using the following script (based on https://rocket.chat/docs/administrator-guides/integrations/).Hope this helps you

/* exported Script */
/* globals console, _, s */

/** Global Helpers
 *
 * console - A normal console instance
 * _       - An underscore instance
 * s       - An underscore string instance
 */

class Script {
  /**
   * @params {object} request
   */
  process_incoming_request({ request }) {
    // request.url.hash
    // request.url.search
    // request.url.query
    // request.url.pathname
    // request.url.path
    // request.url_raw
    // request.url_params
    // request.headers
    // request.user._id
    // request.user.name
    // request.user.username
    // request.content_raw
    // request.content

    // console is a global helper to improve debug
    console.log(request.content);

    return {
      content:{
        text: request.content.text

       }
    };


  }
}
Link to comment
Share on other sites

makarai

 

I setup my own rocket.chat server this morning and was able configure a webhook using the following script (based on https://rocket.chat/docs/administrator-guides/integrations/).Hope this helps you

 

 

Hi thanks for your answer.

 

However,  i still get an error when sending a test message. Further my rc log does not show anything. ( I have created many incoming webhooks and when i curl it i can send messages all day long) 

 

Is there anything i have on the emby plugin interface side

Link to comment
Share on other sites

ackbarr

Are you trying to use the "Test Notification" button in the emby plugin settings? That is currently broken, although I can't figure out why after comparing my code to other plugins in the repository.  According to the logs, Emby returns a 404 for the registered URL for the test button.

 

What I did to test in my instance was temporarily turn on a notification like "Video Playback started" or "Video Playback stopped" then start playback of a video in my library.

Edited by ackbarr
Link to comment
Share on other sites

makarai

Are you trying to use the "Test Notification" button in the emby plugin settings? That is currently broken, although I can't figure out why after comparing my code to other plugins in the repository.  According to the logs, Emby returns a 404 for the registered URL for the test button.

 

What I did to test in my instance was temporarily turn on a notification like "Video Playback started" or "Video Playback stopped" then start playback of a video in my library.

 

ok, so i figured out my problem, which might be related, it might be related to yours as i could not explain why this is necessary.

 

I have plexpy installed which send out notification to my rocketchat throught my current webhook https://blablabla.de/1234 on when movies where added. I have a telegram bot running that uses also the public www address, also without a problem. However, when i use your plugin i have to use my internal ip address otherwise i'll get a websocket error. 

Link to comment
Share on other sites

ackbarr

It's tough to say why you would have to use the internal IP address without knowing more about your network design, but I'm guessing the box that runs your emby server can't resolve the dns name. I ran my rocket.chat instance in AWS and setup the DNS using domain I already owned. Notifications from emby to rocket.chat worked without a hitch using the incoming webhook script I posted earlier.

 

The test notification issue is something separate and broke after one of the Emby builds. It was first reported in early March. It's definitely an annoyance and I'll figure out why it broke at some point and release an updated version of the plugin. I'll probably go through the process to add it to the official repo at the same time.

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
SynoLoader

is this plug-in dead? i'm using slack for all my notifications and will like for emby to send notifications to slack as well! my emby server is on a synology nas and will like to test the plugin if it's posible! thanks!

Link to comment
Share on other sites

is this plug-in dead? i'm using slack for all my notifications and will like for emby to send notifications to slack as well! my emby server is on a synology nas and will like to test the plugin if it's posible! thanks!

 

Why would you think that it's dead?

Link to comment
Share on other sites

SynoLoader

Why would you think that it's dead?

 

is not available yet on the plugins catalog. thanks for your reply!

Link to comment
Share on other sites

ackbarr

it's not dead - it does everything I wanted to accomplish so there hasn't been any reason to push another build. There is one open bug report that breaks the "Test Message" button in the preferences page, but it doesn't impact actual notifications from being sent. I've also made all my code available on GitHub, so it will never be truly dead.

Link to comment
Share on other sites

SynoLoader

it's not dead - it does everything I wanted to accomplish so there hasn't been any reason to push another build. There is one open bug report that breaks the "Test Message" button in the preferences page, but it doesn't impact actual notifications from being sent. I've also made all my code available on GitHub, so it will never be truly dead.

 

great! and thank you for your hard work! i'm going to try it out on a synology nas! will look for the plugins folder and add your files to test it out! will post my findings! thanks!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...