Page 1 of 1

[userModule] MediaCenter (Kodi/xbmc on/off)

Posted: 31 Dec 2014 13:29
by mhorst
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:

Code: Select all

(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:

Code: Select all

apt-get install wakeonlan netcat
should do the trick.

For debugging purposes you can run the, wakeonlan and manually:

Code: Select all <ip-address>
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

Code: Select all

wakeonlan <mac-address>
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

Code: Select all <ip-address>
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:

Code: Select all <ip-address>;echo $?
If it returns 0 then the host is up, otherwise it is down.