[userModule] MediaCenter (Kodi/xbmc on/off)
Posted: 31 Dec 2014 13:29
This module creates an binary switch for Kodi (xbmc) media centers. It enables you to turn the media center on and off. It also detects whether the media centers are on or off (by pinging them every 10 minutes) and updates the state of the switch accordingly.
It requires that your media center have a fixed IP address, that they are configured for remote operation, and that they respond to wake-on-lan request. You will need to know the IP address and the MAC address of the media center.
Furthermore, when installing this module, add the following lines to /opt/z-way-server/automation/.syscommands:(Assuming your z-way installation is in /opt/z-way-server, otherwise modify the paths accordingly.)
Otherwise you will get errors saying that the command is denied by policy.
The system on which you run z-way has to have the wakeonlan, nc and ping utilities installed. Running: should do the trick.
For debugging purposes you can run the rpc_shutdown.sh, wakeonlan and check_ip.sh manually: Will shut down the media center. If it does not, check that you are using the right ip-address and that your media system is configured for remote operation on port 9090
Will start the media center. If it does not, check that your are using the right mac-address and that your media system is configured to respond to wake-on-lan request
Will check whether an ip-address responds to ping requests (i.e. whether it is up or not) with an exit code. Run it using:
If it returns 0 then the host is up, otherwise it is down.
It requires that your media center have a fixed IP address, that they are configured for remote operation, and that they respond to wake-on-lan request. You will need to know the IP address and the MAC address of the media center.
Furthermore, when installing this module, add the following lines to /opt/z-way-server/automation/.syscommands:
Code: Select all
/usr/bin/wakeonlan
/opt/z-way-server/automation/userModules/MediaCenter/rpc_shutdown.sh
/opt/z-way-server/automation/userModules/MediaCenter/check_ip.sh
Otherwise you will get errors saying that the command is denied by policy.
The system on which you run z-way has to have the wakeonlan, nc and ping utilities installed. Running:
Code: Select all
apt-get install wakeonlan netcat
For debugging purposes you can run the rpc_shutdown.sh, wakeonlan and check_ip.sh manually:
Code: Select all
rpc_shutdown.sh <ip-address>
Code: Select all
wakeonlan <mac-address>
Code: Select all
check_ip.sh <ip-address>
Code: Select all
check_ip.sh <ip-address>;echo $?