INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: How to get notifications of what's playing as text onto a TCP socket connection?  (Read 3528 times)

etc6849

  • Recent member
  • *
  • Posts: 34

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
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72436
  • Where did I put my teeth?
Logged

etc6849

  • Recent member
  • *
  • Posts: 34

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
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4225

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
Logged

millst

  • Galactic Citizen
  • ****
  • Posts: 256

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
Logged

etc6849

  • Recent member
  • *
  • Posts: 34

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
Logged

etc6849

  • Recent member
  • *
  • Posts: 34

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
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72436
  • Where did I put my teeth?

Volume 0 work?

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

http://localhost:52199/MCWS/v1/doc
Logged

etc6849

  • Recent member
  • *
  • Posts: 34

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

millst

  • Galactic Citizen
  • ****
  • Posts: 256

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
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42372
  • Shoes gone again!

Next build:
NEW: Added the MCWS function Playback/Mute to set the mute state of playback.
Logged
Matt Ashland, JRiver Media Center
Pages: [1]   Go Up