xbianonpi / xbian

XBMC on Raspberry Pi, Bleeding Edge
https://xbian.org
GNU General Public License v3.0
294 stars 44 forks source link

Add pilight by default to be able to control program start/stop by using the webgui or phone apps #558

Closed CurlyMoo closed 9 years ago

CurlyMoo commented 10 years ago

Since pilight 4.0 a new program protocol has been introduced. This allows users to start and stop shell scripts and keep track of them. When a program is running the switch in the webgui will state running and when it is stopped it will state stopped.

I use this myself to start and stop XBMC and that's working perfectly. I often stop it for development purposes. Now my girlfriend can easily start it again.

It would be cool to extend the xbian-config functionality of program starting / stopping to a webgui and mobile phones.

This is how the config looks for XBMC:

    "programs": {
        "name": "Programs",
        "XBMC": {
            "name": "XBMC",
            "protocol": [ "program" ],
            "id": [{
                "name": "xbmc"
            }],
            "program": "/usr/local/lib/xbmc/xbmc.bin",
            "arguments": "--standalone -fs --lircdev /run/lirc/lircd",
            "stop-command": "service xbmc stop",
            "start-command": "service xbmc start",
            "state": "running",
            "pid": 11642
        }
    }
CurlyMoo commented 10 years ago

And of course, it would be a great for letting people know about pilight :smile:

mk01 commented 10 years ago

extending xbian-config with web interface - currently no.

but xbian-config can easily be integrated into running web interface (if present) - by calling xbian-config CLI as follows.

xbian-config services stop/start/status xbmc

also the JSON template is correct, but what is really needed is just

"program": "initctl",
"stop-command": "stop xbmc",
"start-command": "start xbmc",

there should be in general only one authority to doing the low level work (starting / stopping). currently it is upstart which has all the informations needed (program binary, other arguments). that way we can be always sure that ALL interfaces will always do the same thing exactly the same way - in that case ask system to start / stop xbmc.

CurlyMoo commented 10 years ago

but xbian-config can easily be integrated into running web interface (if present) - by calling xbian-config CLI as follows.

I know, build a lot myself.

extending xbian-config with web interface - currently no.

I didn't said extending. I said using pilight with already existing functionality: starting and stopping programs through a webgui of with your mobile phone or interfacing with LIRC.