Jump to content

Can Emby trigger an alert when the Premiere device limit is exceeded (via API or Webhooks)?


Recommended Posts

Posted

Hello everyone,

I would like to know if Emby can trigger an alert whenever the Premiere device limit is exceeded.
Is this something that can be achieved either through the Emby API or through the Notifications section using Webhooks?

What I need is a way to:

Detect when the number of active devices or sessions goes beyond the allowed Premiere limit

Automatically send a notification (webhook or POST request) to an external server I own

Before attempting to build a custom solution, I want to confirm whether Emby exposes this type of event through its API or if the notifications/webhook system can be configured to detect it.

Any guidance or suggestions would be greatly appreciated.

Thank you!
 

Posted (edited)

Unfortunately the webhook/notification system doesn't have an event like you've described. I don't think there is any way to get the exact number of devices that are using a premiere device slot, but it doesn't sound like you need the exact number anyways. Here is how I would do it:

 

Periodically make a POST request to https://mb3admin.com/admin/service/registration/getStatus with a request body of:

{"key": yourPremiereKey, "serverId": yourEmbyServerId }

That endpoint will return the following data: 

{"planType":"Lifetime/Monthly/Yearly","deviceStatus":0,"subscriptions":[]}

The value of deviceStatus will be a number between 0 to 2, with 0 being well within your device limit, 1 being close to your device limit, and 2 being at or over the limit. Now you can do what you please with this data, send a notification, automatically remove old devices via the api, whatever!

Edited by rechigo
darkassassin07
Posted

@rechigo

Where are you getting your serverid from? I've tried the value from /data/device.txt on the server, but all I get from mb3admin is 400 bad request.

 

Just using curl for now:

curl --header "Content-Type: application/json" --request POST --data '{"key": mykey, "serverId": myserverid}' https://mb3admin.com/admin/service/registration/getStatus

(add -v to see the 400 bad request response)

Posted (edited)
27 minutes ago, darkassassin07 said:

@rechigo

Where are you getting your serverid from? I've tried the value from /data/device.txt on the server, but all I get from mb3admin is 400 bad request

Hello, I got it from watching the network request to /getStatus when going to the premiere settings page in browser's dev tools. The server ID used in that request is the same ID returned by /System/Info

 

Did you make sure to wrap the mykey and myserverid in quotes? if not it wont be treated as a string and the request will fail

 

do it like this:

'{"key": "mykey", "serverId": "myserverid"}'

if you do it like this the request will fail with 400:

 '{"key": mykey, "serverId": myserverid}'

 

Edited by rechigo
  • Thanks 1

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...