GPIO Monitor KODI Add-on

Features

  • Monitor multiple GPIO buttons on your Raspberry Pi
  • Run KODI function(s) when that button is pressed, released or held
  • Supports LibreELEC / OSMC / Xbian on all Raspberry Pi boards

Need

How

First follow THIS post to install my KODI Add-on Repository.

Navigate to "Main Menu -> Add-ons -> My Add-ons"
Select ".." then select "Install from repository"
Select "MattHuisman.nz Repository".
Select "Program add-ons" then "GPIO Monitor"
Select "Install" and the add-on will download and install.
You can now access the add-on under Program add-ons.
The first time you run the add-on, you will need to install the service and then reboot.

Setup

After the reboot, you can now setup your buttons.
The add-on uses BCM board pin numbering (GPIO2 to GPIO26)
Click Add Button and then select the GPIO (BCM) Pin number.
Once the button is added, you can select it to edit it.
Follow the same process for any additional buttons.
The service status will be shown next to the button so you can easily see any errors.
eg. Below I have set Pull-up to False on GPIO3 which has an built-in physical pull-up.
You can delete buttons using the context menu.

Functions

The full list of KODI functions can be found HERE.
Below are some commonly used functions.
  • Reboot
  • Shutdown
  • Action(Up)
  • Action(Down)
  • Action(Back)
  • ActivateWindow(window)
  • CECStandby
  • RunPlugin(plugin)
  • RunAddon(addon)
Multiple functions can be separated with a (pipe).
They will run in order. eg. Action(Up)|Action(Up)|Reboot.
That will move up twice and then reboot.

Example

Here is an example setup for a basic Reboot GPIO button.
It uses GPIO17 with a button that pulls the pin low (GND).

Source

Next