Permissions issue when running a python script

sudo adduser openhab gpio
sudo -u openhab <your Skript>

Maybe this will already help. I don’t know if you need more privileges then gpio.
First we add the user openHAB to the group gpio. Then we try to call the Skript as the user openHAB. If this works it should work from within openHAB.