We have moved at community.getvera.com

Author Topic: First time coding - Sending JSONrequest to Philips TV  (Read 2185 times)

Offline EvenTj

  • Sr. Newbie
  • *
  • Posts: 25
  • Karma: +0/-0
First time coding - Sending JSONrequest to Philips TV
« on: October 25, 2013, 03:05:45 pm »
Hi,
My new Philips TV can accept JSONrequests through the Jointspace API?s, but I cant figure out the code to send a JSONrequest, can someone help me figure the error with this code? Trying to set the TV to Standby.

http://jointspace.sourceforge.net/projectdata/documentation/jasonApi/1/doc/API-Method-input-key-POST.html

function JSONTest()
{
requestNumber = JSONRequest.post(
    "http://10.0.1.19:1925/1/input/key",
    {
        key: "Standby",
     
    },
    function (requestNumber, value, exception) {
        if (value) {
            processResponse(value);
        } else {
            processError(exception);
        }
    }
);
}

Anyone know how to send a JSONrequest.post( ??

Offline RichardTSchaefer

  • Community Beta
  • Master Member
  • ******
  • Posts: 10091
  • Karma: +764/-143
Re: First time coding - Sending JSONrequest to Philips TV
« Reply #1 on: October 25, 2013, 06:36:09 pm »
That's a JavaScript library ... Where do you plan to call it from ?

See: http://www.json.org/JSONRequest.html

Offline EvenTj

  • Sr. Newbie
  • *
  • Posts: 25
  • Karma: +0/-0
Re: First time coding - Sending JSONrequest to Philips TV
« Reply #2 on: October 26, 2013, 08:41:01 am »
That's a JavaScript library ... Where do you plan to call it from ?

See: http://www.json.org/JSONRequest.html

I want to make a scene which can turn on and off my TV using JSONrequest. How can I do this in the LUUP field? I thought I could run this code in the luup field, but offcourse no chance..

 ::)

Offline RichardTSchaefer

  • Community Beta
  • Master Member
  • ******
  • Posts: 10091
  • Karma: +764/-143
Re: First time coding - Sending JSONrequest to Philips TV
« Reply #3 on: October 26, 2013, 09:26:03 am »
This is all based on http requests with JSON formatted objects ... all doable in LUA ... but you will need to do some coding.

Offline skinnez

  • Jr. Member
  • **
  • Posts: 52
  • Karma: +1/-3
Re: First time coding - Sending JSONrequest to Philips TV
« Reply #4 on: November 12, 2013, 01:53:47 am »
Did this work? Any ideas on how you could get pressing play or pause on the philips remote to run a scene??
Cheers
J


Sent from my iPhone using Tapatalk

guest140520

  • Guest
Re: First time coding - Sending JSONrequest to Philips TV
« Reply #5 on: January 31, 2014, 05:07:55 pm »
Any information on how to integrale this Code in LUUP. This would be great.