Plex device for control by Vera

Hi,

I have put together (hacked) files for remote control of Plex Home Theater and thought I would share. With this I am able to control Plex from inside SQRemote using the Plex HTTP API.

If anyone would like to add some polish, like for instance making the server and player a variable, that would be great.

Enjoy.

Thanks a lot, however I don’t get this code to work. Any ideas?

[code]local http = require(“socket.http”)
http.TIMEOUT = 5

local status, result = luup.inet.wget(“http://192.168.1.4:32400/system/players/192.168.1.4/navigation/contextmenu”, 5)[/code]

I hacked it to work with my system, so you will probably need to edit I_Plex file to add your correct IP address of your server and client.

So change:
luup.inet.wget(“http://192.168.1.4:32400/system/players/192.168.1.4/navigation/contextmenu”, 5)

to:
luup.inet.wget(“http://serverIP:32400/system/players/PlayerNameOrIPaddress/navigation/contextmenu”, 5)

I did this already. But even if I enter your code in the browser I don’t get any result beside of this message.

Traceback (most recent call last): File "/Users/Multimedia/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/runtime.py", line 843, in handle_request result = f(**d) File "/Users/Multimedia/Library/Application Support/Plex Media Server/Plug-ins/System.bundle/Contents/Code/playerservice.py", line 65, in process_legacy_remote_command result = cmd(**kwargs) File "/Users/Multimedia/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/sandbox.py", line 19, in _apply return apply(f, args, kwargs) File "/Users/Multimedia/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/playerkit.py", line 45, in __call__ self._player._send_udp_command(cmd) File "/Users/Multimedia/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/playerkit.py", line 191, in _send_udp_command self._socket.sendto(self._cmd_fmt % (struct.pack(">H", len(cmd)+2), cmd), (self._host, self._udp_port)) gaierror: [Errno 8] nodename nor servname provided, or not known

Hmm, I’m not sure. You should be able to test the HTML calls directly from a browser to check if they work. And if you are using Plex Home Theater, I noticed there is a setting to allow HTML control, so it might be off.

Everything is enabled, I am in the same network, no firewall on the Mac.

Looks like an issue of Plex.

Thanks for your help.