read out XBMC play, pause stop status
|
25th Jan, 2014, 07:56 PM
Post: #1
|
|||
|
|||
read out XBMC play, pause stop status
hello,
i'm working on comining home automitation and media, i found this little script #!/bin/bash xbmcurl="http://pc-tv/jsonrpc" previousvideoplaying=0 while [ 1 ] do wget -q -O- --header='Content-Type: application/json' --post-data='{"jsonrpc": "2.0", "method": "Player.GetActivePlayers", "id": 1}' $xbmcurl | grep -v '"video"' > /dev/null video=$? wget -q -O- --header='Content-Type: application/json' --post-data='{"jsonrpc": "2.0", "method": "Player.GetProperties", "params": { "playerid": 1, "properties": ["speed"] }, "id": 1}' $xbmcurl | grep '"speed":0' > /dev/null playing=$? #echo "video=$video playing=$playing" if [ $video == 1 ] && [ $playing = 1 ]; then # echo "Video Playing!" if [ $previousvideoplaying == 1 ]; then echo "Video Playing, dimming ligths!" kaku 123 1 dim 4 fi previousvideoplaying=1 else if [ $previousvideoplaying == 1 ]; then echo "Video Stopped, brighting ligths!" kaku 123 1 dim 8; previousvideoplaying=0 fi done it only keeps saying "video playing, dimming lights" and dimm my light, i'm running 433Mhzdeamon in no hup ( https://github.com/jeroensteenhuis/433mhzforrpi ) am i missing anything? |
|||
« Next Oldest | Next Newest »
|
Possibly Related Threads... | |||||
Thread: | Author | Replies | Views: | Last Post | |
[IDEA] Start/stop XBMC from web gui | Fred | 8 | 29,952 |
11th Apr, 2013 10:41 PM Last Post: wuschl |