[Release] GPIO Monitor Service KODI Add-on

Here is handy add-on I created to monitor a GPIO pin on the Raspberry Pi.
Once the pin is pulled high or low, a configurable KODI function is run.

How to Install

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

Now navigate to "Main Menu -> Add-ons -> My Add-ons"
Select ".." then select "Install from repository"
Select "MattHuisman.nz Repository".
Select "Services" then "GPIO Monitor"

Now select "Install" and the add-on will download and install.

Follow the prompts to install the required RPi-GPIO Library.



The pin, edge and function can all be set in the add-on settings.

The Pin can be anything from 1 to 40 (default is 0 = Disabled)
It uses the board pin numbering (Gray numbers below)

The edge can be Falling (default) or Rising.

Falling will trigger when the pin goes from High to Low.
Rising will trigger when the pin goes from Low to High.

Note: Some pins have built-in pull up resistors so it's best to use Falling with these pins.

The Function can be any of the KODI build-in functions:

The default is "ShutDown"
Other handy functions are "Reboot" & "RunAddon(id)".

No Notifications simply hides the pop-up message when the function is run.


  1. Hi Matt, thanks again for all your help!

    For some reason I don't understand (but I'm not good at coding either XD), I had to change with thing on your script from
    if state != last_state and state == EDGE:
    if state != last_state and state != EDGE:
    Otherwise, LE will execute the shutdown command right after booting.

    I use a momentary switch with recalbox like the one on this page:

    I would say, it is a normally open switch, as it is working (on recalbox) with this script:

    Am I doing something wrong by making that change?

    1. Your new version solved the problem! Thank you very much!

    2. Oh great :)

      I was just about to combine all my comments into one comment but then noticed your response!

      You should just need to use the default settings if using a push button between pin 5 & 6

    3. You created a really useful addon there!

    4. All thanks to your original question :)


    5. It does not work with OpenELEC?

    6. I've tested in LibreELEC.
      It may work in OpenELEC if they have the RPI.GPIO dependency available.

    7. Thanks for the addon! Would be great if you could include a feature to monitor several GPIO-pins!

    8. Good idea :)
      I'll add to the to-do list


Post a Comment