INTERACT FORUM

Windows => Third Party Plug-ins, Programs, and Skins => Topic started by: etc6849 on September 11, 2017, 08:47:09 pm

Title: How to get notifications of what's playing as text onto a TCP socket connection?
Post by: etc6849 on September 11, 2017, 08:47:09 pm
What I am looking to do is have my home automation server keep an open TCP port connection with JRiver (or some plugin), then whenever I click next track or play on my HTPC, my home automation server would get an instant update what's currently being played.   In this manner, the media item's attributes are sent over the tcp socket as text.

I would have thought there would be a way to talk to JRiver over a TCP Socket.  I found examples of how to do this in a one way manner by adding HTTP header info as part of the GET command, and then using an open port to query JRiver and receive a response.

Hopefully there is a solution that doesn't require an external script. I found one script that uses perl to send what's playing notifications on a mac; that could be modified to send the information over a TCP socket in windows.  This is the handy perl example: 
https://yabb.jriver.com/interact/index.php?topic=87932.0 (https://yabb.jriver.com/interact/index.php?topic=87932.0)
Title: Re: How to get notifications of what's playing as text onto a TCP socket connection?
Post by: JimH on September 11, 2017, 09:49:15 pm
MC has a REST interface:

https://wiki.jriver.com/index.php/Web_Service_Interface
Title: Re: How to get notifications of what's playing as text onto a TCP socket connection?
Post by: etc6849 on September 12, 2017, 01:54:48 pm
Hi Jim.  Thanks for the response.

Most home automation conntrollers communicate via a TCP socket or RS232 when unsolicited notifications are desired.

I looked in the webservice option, but it wasn't clear if it supports unsolicited notifications from JRiver.  Any hints?

Thanks!

MC has a REST interface:

https://wiki.jriver.com/index.php/Web_Service_Interface
Title: Re: How to get notifications of what's playing as text onto a TCP socket connection?
Post by: mattkhan on September 12, 2017, 02:43:32 pm
It should be possible to write something using one of the APIs exposed by JRiver, to do this but such a feature is not provided out of the box
Title: Re: How to get notifications of what's playing as text onto a TCP socket connection?
Post by: millst on September 13, 2017, 11:19:59 am
A plugin can do this easily. I have one for my custom home automation.

You could also write your own program to poll the REST interface and send the unsolicited notifications.

-tm
Title: Re: How to get notifications of what's playing as text onto a TCP socket connection?
Post by: etc6849 on September 13, 2017, 11:55:11 am
Would you be so kind as to post the plugin you use?

Thanks!

A plugin can do this easily. I have one for my custom home automation.

You could also write your own program to poll the REST interface and send the unsolicited notifications.

-tm
Title: Re: How to get notifications of what's playing as text onto a TCP socket connection?
Post by: etc6849 on September 16, 2017, 07:52:16 pm
Jim,

With respect, the REST interface is lacking.  I don't see mute implemented, and there is no discrete Play method?  Why so many simple limitations? ?

EDIT: I see that for these basic commands, which should be there, I can use MCC codes as a work around, but then the link structure and zone code is different (versus the Playback commands)...

This is really disappointing for paid software.  If you want me to buy the next version (and more licenses too), there needs to be a simple way to interface your program with HA controllers. 

It is very ironic that you are now selling home automation software, yet don't have a basic method for home automation integrators to use to control your masterpiece.  It would really be nice as there are no true audiophile options that can be integrated (at least not in my price range).

KODI is a free program and blows JRiver away when it comes to being able to integrate it easily.  I made a JSON two-way KODI module for my HA server (search Premise and KODI on youtube), plus there's even a KODI two-way module for Control4.

MC has a REST interface:

https://wiki.jriver.com/index.php/Web_Service_Interface
Title: Re: How to get notifications of what's playing as text onto a TCP socket connection?
Post by: JimH on September 16, 2017, 09:02:44 pm
Volume 0 work?

From the link I gave you, you can get the documentation.

http://localhost:52199/MCWS/v1/doc
Title: Re: How to get notifications of what's playing as text onto a TCP socket connection?
Post by: etc6849 on September 17, 2017, 11:49:08 am
For what it's worth, volume = 0 does not match the same state as mute in JRiver MC.  They are two different properties.  As my post stated, I was able to find the missing mute commands by issuing MCC commands, so everything is there and 100% functional so all is well  :)

My post's intent was not to say there aren't workarounds such as polling MCWS via a script using or building a custom JRiver plugin using the SDK.  These types of options are totally fine with me (and seem to be working very well) as I'm using PC based home automation software.  I would say that 99% of the home automation market doesn't use a PC based setup that is flexible enough to fully integrate with your software; take that for what it's worth.  Regardless JRiver is best in class when it comes to audio quality and options.
Title: Re: How to get notifications of what's playing as text onto a TCP socket connection?
Post by: millst on September 17, 2017, 07:06:50 pm
My plugin wouldn't be usable. The notifications to my home automation server are a small part of what it does and it's all hardcoded for my setup.

-tm
Title: Re: How to get notifications of what's playing as text onto a TCP socket connection?
Post by: Matt on September 18, 2017, 08:02:32 am
Next build:
NEW: Added the MCWS function Playback/Mute to set the mute state of playback.