mezz64 13 Posted December 12, 2016 Share Posted December 12, 2016 I'm working on expanding an existing python library that uses the HTTP api to interact with emby to use websockets where possible to allow for faster updates with less polling. Looking through the websockets documentation and in doing some testing I can't seem to find a way to initiate a single websocket connection that would give me events for all devices currently active in emby. Am I missing something or this the intended usage? Thus far the best workflow I can come up with is query the api for currently active device and then open a websocket connection for each active device. Any insight is appreciated. Thanks. Link to comment Share on other sites More sharing options...
mezz64 13 Posted December 13, 2016 Author Share Posted December 13, 2016 (edited) Digging into this some more it seems that if I connect to the websocket with a registered DeviceID I receive events from all currently active devices. So that's a step in the right direction. Also, is there a way to get emby to push progress updates through the websocket? I noticed it was asked in an older thread, but I'm not able to decipher the right message packet to send into the websocket from the dashboard/javascript code. Once again any help is much appreciated. Edited December 13, 2016 by mezz64 Link to comment Share on other sites More sharing options...
mezz64 13 Posted December 14, 2016 Author Share Posted December 14, 2016 For the benefit of someone else looking for this information I finally figured out the correct syntax for the websocket message to ask the server to provide session updates on an interval. The 1500 is the interval in milliseconds. {"MessageType":"SessionsStart", "Data": "0,1500"} {"MessageType":"SessionsStop", "Data": ""} Link to comment Share on other sites More sharing options...
Luke 36884 Posted December 14, 2016 Share Posted December 14, 2016 Thanks for the info ! 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