This page last changed on Aug 14, 2013 by hank.

Hi

I would need help to add a http command to my project.

The command should be a HTTP command that run the the address below, same function as you wrote it in the IE.

The link is: http://192.168.1.5:5006/sovrum/play

Should i use GET or POST?

Do i need some more info to add, for me i can´t get it to work.

Best Regards
Henrik

What is the URL supposed to do? If you want to get a value for a sensor, than you need to add a polling interval value.
IIRC GET and Post are both treated as GET at the moment. So it does not matter yet.

Posted by pz1 at Aug 14, 2013 18:25

GET, which is similar to typing a URL in a browser.

POST is similar to submitting a form.

You mean that if you type that address in IE address bar and type enter, your media player plays (I believe from the URL that's the use case here).

But if you create an HTTP GET command with that URL in OR and use that from e.g. a button, it does not play ?

Posted by ebariaux at Aug 14, 2013 18:26

Hi PE ZANSTRA & ERIC

Yes Eric, that is exactly what it should do.
I´m very near to get my Sonos integration to OpenRemote to work.

If I use the link in one of my computers, the music starts to play so it should be easy to get it to work in OR.

I tried to make a button with a this command and it didn´t start to play.
I will make a second try tonight.

Do i need a special version of OR to get this to work?
I have used http: commands before and got it to work.

Posted by hank at Aug 14, 2013 18:33

Perfect now it works!

Before i could see the new buttons but it didn´t work correctly, after a reboot of OR it works!
Only one thing left that needs to be solved, with link below i get info about what´s playing now. http://192.168.1.97:5005/vardagsrum/state

This is what you see in IE.

{"currentTrack":

Unknown macro: {"artist"}
,"relTime":14,"stateTime":1376505641662,"volume":100,"currentState":"PLAYING"}

If i use http command and GET and json: $.artist and connect it to a label it will give you not only "Orup" it will give whole CurrentTrack line.
What should json code be to only display the artist info?

Posted by hank at Aug 14, 2013 19:53

Can you edit the post to put the JSON reply in a {code} block ?
Or maybe you need to escape some curly braces (putting a \ in front of it) so that it displays correctly.

Posted by ebariaux at Aug 14, 2013 21:10

It should look like this:

{"currentTrack"{"artist":"Veronica","title":"Blue","album":"You","duration":194} ,"relTime":14,"stateTime":1376505641662,"volume":100,"currentState":"PLAYING"}
Posted by hank at Aug 15, 2013 12:21

How about $.currentTrack.artist as the JSONPath expression ?

Posted by ebariaux at Aug 15, 2013 12:47

Gives the same resaults, showing all the first 4 posts until relTime.

Posted by hank at Aug 15, 2013 13:12

I found out this link: http://openremote.org/pages/viewpage.action?pageId=20451362&focusedCommentId=20451410

Seems to have the same problem as me.

It might be that my OR are to old and need to be updated.

Posted by hank at Aug 15, 2013 13:49

At the end of the thread it sounds like it was resolved with the OpenRemote version that was mentioned in there also.

Posted by mredeker at Aug 16, 2013 09:06

Ok, I will check again.
I think i have version 2.0.1 or maybe 2.0.0.

Posted by hank at Aug 16, 2013 09:08

Dear All

This was solved by itself upgrading to 2.1 Snapshot version of OpenRemote.

Best Regards
Henrik Gjörloff

Posted by hank at Sep 16, 2013 15:32
Document generated by Confluence on Jun 05, 2016 09:30