(2017-05-24, 20:29)DarrenHill Wrote: No that's a bash script. The add-on provides a Python module - different language.
Look up "gpio python raspberry pi" on the net to get you started. Kodi (and variants) ship with python2.
Well... Im not too sure what im doing wrong. Here is the code that is currently in use.
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(channel, GPIO.OUT)
import xbmcaddon
#import xbmcgui
import os
import xbmc
addon = xbmcaddon.Addon()
addonname = addon.getAddonInfo('name')
line1 = "Turned on/off a relay"
line2 = "Version: " + addon.getAddonInfo('version')
os.system("sh /storage/.kodi/addons/relay-addon-kodi-master/relay.sh")
xbmc.executebuiltin('Notification(Relay Addon, The relay was turned on/off,5000,//storage/.kodi/addons/script.relay.master/icon.png)')
#xbmcgui.Dialog().ok(addonname, line1, line2)
The addon gives me an error and says to check logs. I have no clue where those logs are. Here is the original python script that came with the addon:
import xbmcaddon
#import xbmcgui
import os
import xbmc
addon = xbmcaddon.Addon()
addonname = addon.getAddonInfo('name')
line1 = "Turned on/off a relay"
line2 = "Version: " + addon.getAddonInfo('version')
os.system("sh /storage/.kodi/addons/relay-addon-kodi-master/relay.sh")
xbmc.executebuiltin('Notification(Relay Addon, The relay was turned on/off,5000,//storage/.kodi/addons/script.relay.master/icon.png)')
#xbmcgui.Dialog().ok(addonname, line1, line2)
Here is the source I used:
https://sourceforge.net/p/raspberry-gpio...asicUsage/