Send HTTP command luup.inet.wget

Hi,

I followed an online guide on how to send http commands to XBMC to start stop pause etc.

It works when I paste the command into a web browser, for instance this pause xbmc:

http://192.168.0.190/jsonrpc?request={"jsonrpc":"2.0","method":"Player.PlayPause","params":{"playerid":1},"id":1}

In the guide I’m supposed to enter the command into the Luup field into a new scene as follows:

luup.inet.wget(“http://192.168.190/jsonrpc?request={“jsonrpc”:“2.0”,“method”:“Player.PlayPause”,“params”:{“playerid”:1},“id”:1}”)

When I try to activated that scene, nothing happens and ever since createing the scene the top display in vera says:

ERROR for lua scenes and events

Once I get it to work I’ll add the scene to Homewave.

Any idea whats going on here?

Kind Regards
Tommy

Try using single quotes instead of double quotes. The url is most likely clashing with the Lua interpreter.

  • Garrett

Thanks,

I’ll try that, but in the mean time I figured out a workaround. I just pasted the URL that worked from a browser into a Homewave button that could be configured to launch a URL (I didnt know that was possible)

Works great!

Your the man Garrett :slight_smile:

The single quotes did it, and I ended up needing to to the work from Vera anyway. I followed this guide (halfway down, motion detection notification to xbmc)

http://windowsmediacenter.blogspot.no/2013_02_01_archive.html

It says nothing about single quotes though! Glad you knew.

@garrettwp

I have the exact same situation as tommylad. So I used the luup…

function HTTPGet(URL)
local status, result = luup.inet.wget(URL, 3)
end

HTTPGet(‘http://192.168.122.xxx:xxx/cgi/admin/ptctrl.cgi?action=move&Cmd=Position1’)

I get msg sent successful, but the cam does not move. In a browser http://192.168.122.xxx:xxx/cgi/admin/ptctrl.cgi?action=move&Cmd=Position1 works perfectly.

What do you think is wrong here?

Thanks