Execute script with remote via HDMI CEC

Hi there

I installed the latest player on my raspberry Pi, in replacement of Rasplex.
I need to execute a shell script (to toggle hyperion) when I press a button on my remote

The script is OK, mapping si OK, except for executing the script

In the inputmap json
"KEY_YELLOW": "host:/storage/.local/share/plexmediaplayer/toggle.sh",
and in the log

2018-12-28 18:24:53 [ DEBUG ] InputComponent.cpp @ 115 - Got host command: "/storage/.local/share/plexmediaplayer/toggle.sh" arguments:$
2018-12-28 18:24:53 [ WARN  ] InputComponent.cpp @ 144 - No such host command: "/storage/.local/share/plexmediaplayer/toggle.sh"

I don’t get it because /storage/.local/share/plexmediaplayer/toggle.sh efficiently toggles hyperion

Am I wrong with the path in the inputmap file ?

Or does this not support shell scripts ?

Thanks for any help, I’m new at this

According to: https://support.plex.tv/articles/216459997-create-your-own-inputmap/ then PMP input maps are based on mpv.io

Not tested, in fact not a PMP user, but I would personally try https://mpv.io/manual/master/#network, and launch an http request.

When that’s said, what do you mean with hyperion ?

Hello dane22

I will take a look at your suggestion

Hyperion is a software to control LED strips according to the displayed image, like Philips ambilight system. But my problem would be the same for any shell intervention
Best

1 Like

On mpv.io I failed to see shell access, only Network for an http GET

actually, looking at the error I get, it may just be an error on the path, I am not familiar with absolute paths in OpenElec systems. And I can’t find an example of what kind of path is expected with “host:script.sh”

Since your path started from root, then maybe a permission error for the user running PMP to access the script?

And as said, I’m not a PMP dude, so will sadly stand down again, and leave this to the real experts :smiley:

In the meantime I found a “scripts” folder in plexmediaserver. I put my script in here and changed the inputmap to host:toggle.py but nothing better… still the same error log

Thanks anyway for your help

1 Like

Hello

I auto solved the problem by looking here : PMP Weekly Update #7/8

the correct syntax is host:script /path/script.sh, not host:path/script.sh

example

"KEY_NAME": "host:script /path/.to/script/script.sh",

this is a stupid mistake, but I am glad it is solved and now it works well, I can do anything from my tv remote !

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.