Appdaemon and RPi.GPIO

So, after my post here yesterday, I solved that problem. Now I am having issues getting Appdaemon to trigger a GPIO port.

I’ve set up a switch and an automation that performs this perfectly, but I just cannot get my pythons script to do it.

Here is my script:

import appdaemon.plugins.hass.hassapi as hass
import RPi.GPIO as GPIO
from time import sleep

class FirstFunction(hass.Hass):

  def initialize(self):
     self.log("Hello from AppDaemon")
     self.log("You are now ready to run Apps!")
     self.listen_state(self.trigger, "input_boolean.trigger_first_function")
  
  def trigger(self, entity, attribute, old, new, kwargs):
     self.log("Triggering")
     
     # Board Settings
     
     GPIO.setmode(GPIO.BOARD)
     
     GPIO.setup(14, GPIO.OUT)
     
     GPIO.output(14, 1)
     sleep(10)
     
     self.log("Finished triggering")

I get the following output:
2018-11-02 08:43:09.913786 INFO circuit: Hello from AppDaemon
2018-11-02 08:43:09.924024 INFO circuit: You are now ready to run Apps!
2018-11-02 08:43:36.672094 INFO circuit: Triggering

But it never completes the function.

The following error is in the log file, but earlier, and doesn’t appear in the most recent restart??
File “/config/appdaemon/apps/script.py”, line 2, in <module> import RPi.GPIO as GPIO
ModuleNotFoundError: No module named ‘RPi’

If this is the problem, I’m struggling to work out how to correctly install this module. What am I doing wrong?

yup thats the problem.
you try to use a lib called RPI that you didnt install.

how is your setup?

hassio, HA and AD in seperate venvs, docker?

Hi Rene,

Forgive my lack of knowlege, I’m not entirely sure what you mean. I installed Hass.io on the RPi 2 Model B. Then the Appdaemon add-on. I’m not using Docker (that I’m aware of).

Thanks for your help.

i dont use hassio myself, but i know that somewhere in the configuration from the appdaemon addon you can give the libs that you want to have installed.

in your case that is the RPI lib

Seems obvious now. I forgot about that big of config…

{
  "log_level": "info",
  "system_packages": [],
  "python_packages": [
    "RPi.GPIO"
  ]
}

Starts the installation in the log:

Collecting RPi.GPIO
  Downloading https://files.pythonhosted.org/packages/f0/19/89e634790eb10d64ca87ce5c01751e784a730cf102262205d815275e883a/RPi.GPIO-0.6.4.tar.gz
Installing collected packages: RPi.GPIO
  Running setup.py install for RPi.GPIO: started
    Running setup.py install for RPi.GPIO: finished with status 'error'
    Complete output from command /usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-p6b3rxr4/RPi.GPIO/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-hfmjaf8g/install-record.txt --single-version-externally-managed --compile:
    running install

Then errors:

gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/include/python3.6m -c source/py_gpio.c -o build/temp.linux-armv7l-3.6/source/py_gpio.o
    unable to execute 'gcc': No such file or directory
    error: command 'gcc' failed with exit status 1

you could try

{
  "log_level": "info",
  "system_packages": [
    "gcc"
  ],
  "python_packages": [
    "RPi.GPIO"
  ]
}

Entire Appdaemon log file after restarting HASS

 Python Apps and HADashboard using AppDaemon 3.x for Home Assistant
 From: Community Hass.io Add-ons
 By: Franck Nijhof <[email protected]>
-----------------------------------------------------------
 armhf / HassOS 1.11 / HA 0.81.2 / SU 138 / stable
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to INFO
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 02-updates.sh: executing... 
INFO: You are running the latest version of this add-on
[cont-init.d] 02-updates.sh: exited 0.
[cont-init.d] 20-init-configuration.sh: executing... 
[cont-init.d] 20-init-configuration.sh: exited 0.
[cont-init.d] 21-compiled-dir.sh: executing... 
[cont-init.d] 21-compiled-dir.sh: exited 0.
[cont-init.d] 30-auto-token.sh: executing... 
INFO: Updating Hass.io API token in AppDaemon with the current one...
[cont-init.d] 30-auto-token.sh: exited 0.
[cont-init.d] 31-ha-url.sh: executing... 
[cont-init.d] 31-ha-url.sh: exited 0.
[cont-init.d] 50-compiled-symlink.sh: executing... 
[cont-init.d] 50-compiled-symlink.sh: exited 0.
[cont-init.d] 80-system-packages.sh: executing... 
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/armhf/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/armhf/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/main/armhf/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/community/armhf/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/testing/armhf/APKINDEX.tar.gz
v3.8.1-45-g1d77558b1e [http://dl-cdn.alpinelinux.org/alpine/v3.8/main]
v3.8.1-42-ge6bc061baf [http://dl-cdn.alpinelinux.org/alpine/v3.8/community]
v3.8.0-2773-g9485160fcd [http://dl-cdn.alpinelinux.org/alpine/edge/main]
v3.8.0-2773-g9485160fcd [http://dl-cdn.alpinelinux.org/alpine/edge/community]
v3.8.0-2761-g262b38de90 [http://dl-cdn.alpinelinux.org/alpine/edge/testing]
OK: 21756 distinct packages available
(1/10) Installing binutils (2.30-r5)
(2/10) Installing gmp (6.1.2-r1)
(3/10) Installing isl (0.18-r0)
(4/10) Installing libgomp (6.4.0-r9)
(5/10) Installing libatomic (6.4.0-r9)
(6/10) Installing pkgconf (1.5.3-r0)
(7/10) Installing mpfr3 (3.1.5-r1)
(8/10) Installing mpc1 (1.0.3-r1)
(9/10) Installing libstdc++ (6.4.0-r9)
(10/10) Installing gcc (6.4.0-r9)
Executing busybox-1.28.4-r1.trigger
OK: 133 MiB in 44 packages
[cont-init.d] 80-system-packages.sh: exited 0.
[cont-init.d] 81-python-packages.sh: executing... 
Collecting RPi.GPIO
  Downloading https://files.pythonhosted.org/packages/f0/19/89e634790eb10d64ca87ce5c01751e784a730cf102262205d815275e883a/RPi.GPIO-0.6.4.tar.gz
Installing collected packages: RPi.GPIO
  Running setup.py install for RPi.GPIO: started
    Running setup.py install for RPi.GPIO: finished with status 'error'
    Complete output from command /usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-k4o5xues/RPi.GPIO/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-ofp39yfg/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-armv7l-3.6
    creating build/lib.linux-armv7l-3.6/RPi
    copying RPi/__init__.py -> build/lib.linux-armv7l-3.6/RPi
    creating build/lib.linux-armv7l-3.6/RPi/GPIO
    copying RPi/GPIO/__init__.py -> build/lib.linux-armv7l-3.6/RPi/GPIO
    running build_ext
    building 'RPi._GPIO' extension
    creating build/temp.linux-armv7l-3.6
    creating build/temp.linux-armv7l-3.6/source
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/include/python3.6m -c source/py_gpio.c -o build/temp.linux-armv7l-3.6/source/py_gpio.o
    source/py_gpio.c:23:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-k4o5xues/RPi.GPIO/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-ofp39yfg/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-k4o5xues/RPi.GPIO/
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
FATAL: Failed installing package RPi.GPIO
[cont-init.d] 81-python-packages.sh: exited 1.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 50-compiled-symlink.sh: executing... 
[cont-finish.d] 50-compiled-symlink.sh: exited 0.
[cont-finish.d] 99-message.sh: executing... 
-----------------------------------------------------------
                Oops! Something went wrong.
 
 We are so sorry, but something went terribly wrong when
 starting or running this add-on.
 
 Be sure to check the log above, line by line, for hints.
-----------------------------------------------------------
[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] syncing disks.
[s6-finish] sending all processes the TERM signal.

I think we’re getting somewhere?

i think you need also python-dev

{
  "log_level": "info",
  "system_packages": [
    "gcc"
  ],
  "python_packages": [
   "python-dev",
   "RPi.GPIO"
  ]
}

I greatly appreciate your help by the way. :slight_smile:

After updating the config.

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Hass.io Add-on: AppDaemon v1.6.0
 Python Apps and HADashboard using AppDaemon 3.x for Home Assistant
 From: Community Hass.io Add-ons
 By: Franck Nijhof <[email protected]>
-----------------------------------------------------------
 armhf / HassOS 1.11 / HA 0.81.2 / SU 138 / stable
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to INFO
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 02-updates.sh: executing... 
INFO: You are running the latest version of this add-on
[cont-init.d] 02-updates.sh: exited 0.
[cont-init.d] 20-init-configuration.sh: executing... 
[cont-init.d] 20-init-configuration.sh: exited 0.
[cont-init.d] 21-compiled-dir.sh: executing... 
[cont-init.d] 21-compiled-dir.sh: exited 0.
[cont-init.d] 30-auto-token.sh: executing... 
INFO: Updating Hass.io API token in AppDaemon with the current one...
[cont-init.d] 30-auto-token.sh: exited 0.
[cont-init.d] 31-ha-url.sh: executing... 
[cont-init.d] 31-ha-url.sh: exited 0.
[cont-init.d] 50-compiled-symlink.sh: executing... 
[cont-init.d] 50-compiled-symlink.sh: exited 0.
[cont-init.d] 80-system-packages.sh: executing... 
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/armhf/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/armhf/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/main/armhf/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/community/armhf/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/testing/armhf/APKINDEX.tar.gz
v3.8.1-45-g1d77558b1e [http://dl-cdn.alpinelinux.org/alpine/v3.8/main]
v3.8.1-42-ge6bc061baf [http://dl-cdn.alpinelinux.org/alpine/v3.8/community]
v3.8.0-2773-g9485160fcd [http://dl-cdn.alpinelinux.org/alpine/edge/main]
v3.8.0-2773-g9485160fcd [http://dl-cdn.alpinelinux.org/alpine/edge/community]
v3.8.0-2761-g262b38de90 [http://dl-cdn.alpinelinux.org/alpine/edge/testing]
OK: 21756 distinct packages available
(1/10) Installing binutils (2.30-r5)
(2/10) Installing gmp (6.1.2-r1)
(3/10) Installing isl (0.18-r0)
(4/10) Installing libgomp (6.4.0-r9)
(5/10) Installing libatomic (6.4.0-r9)
(6/10) Installing pkgconf (1.5.3-r0)
(7/10) Installing mpfr3 (3.1.5-r1)
(8/10) Installing mpc1 (1.0.3-r1)
(9/10) Installing libstdc++ (6.4.0-r9)
(10/10) Installing gcc (6.4.0-r9)
Executing busybox-1.28.4-r1.trigger
OK: 133 MiB in 44 packages
[cont-init.d] 80-system-packages.sh: exited 0.
[cont-init.d] 81-python-packages.sh: executing... 
Collecting python-dev
  Could not find a version that satisfies the requirement python-dev (from versions: )
No matching distribution found for python-dev
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
FATAL: Failed installing package python-dev
[cont-init.d] 81-python-packages.sh: exited 1.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 50-compiled-symlink.sh: executing... 
[cont-finish.d] 50-compiled-symlink.sh: exited 0.
[cont-finish.d] 99-message.sh: executing... 
-----------------------------------------------------------
                Oops! Something went wrong.
 
 We are so sorry, but something went terribly wrong when
 starting or running this add-on.
 
 Be sure to check the log above, line by line, for hints.
-----------------------------------------------------------
[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] syncing disks.
[s6-finish] sending all processes the TERM signal.

its also available as apt-get so you could try:

{
  "log_level": "info",
  "system_packages": [
    "gcc",
    "python-dev"
  ],
  "python_packages": [
   "RPi.GPIO"
  ]
}

if that doesnt work i am out of options i guess.
then you better find help in the hassio section.

Thanks ReneTode, I think we’re narrowing in on the problem.

Current conig:

{
  "log_level": "info",
  "system_packages": [
    "gcc",
    "python-dev",
    "python3-dev"
  ],
  "python_packages": [
    "RPi.GPIO"
  ]
}

(No I probably don’t need python-dev and python3-dev, I was planning to remove one once it’s working).

Collecting RPi.GPIO
  Downloading https://files.pythonhosted.org/packages/f0/19/89e634790eb10d64ca87ce5c01751e784a730cf102262205d815275e883a/RPi.GPIO-0.6.4.tar.gz
Installing collected packages: RPi.GPIO
  Running setup.py install for RPi.GPIO: started
    Running setup.py install for RPi.GPIO: finished with status 'error'
    Complete output from command /usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ugtyz0bv/RPi.GPIO/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-476q2v6o/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-armv7l-3.6
    creating build/lib.linux-armv7l-3.6/RPi
    copying RPi/__init__.py -> build/lib.linux-armv7l-3.6/RPi
    creating build/lib.linux-armv7l-3.6/RPi/GPIO
    copying RPi/GPIO/__init__.py -> build/lib.linux-armv7l-3.6/RPi/GPIO
    running build_ext
    building 'RPi._GPIO' extension
    creating build/temp.linux-armv7l-3.6
    creating build/temp.linux-armv7l-3.6/source
    gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/include/python3.6m -c source/py_gpio.c -o build/temp.linux-armv7l-3.6/source/py_gpio.o
    In file included from source/py_gpio.c:23:0:
    /usr/include/python3.6m/Python.h:11:20: fatal error: limits.h: No such file or directory
     #include <limits.h>
                        ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ugtyz0bv/RPi.GPIO/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-476q2v6o/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-ugtyz0bv/RPi.GPIO/
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Any last ideas?

all i every time do is googling for the error and see if someone else had it and what packages come up.

in this case i found this page

yeah it goes about installing a different program, but on the page i find 3 different solutions:
install musl-dev or
install libc-dev or
install linux-headers

all would be system packages and i dont know whit which to go

then i added gpio to my search and found this:
http://forum.tinycorelinux.net/index.php?topic=20221.0

and they also talk about linux-headers, so i would go with that.

and yeah you are getting closer :wink:

Thanks for that. I google every time as well, I just struggle actually interpreting some of the issues I find.

adding linux-headers to the config errored.

But, the following config installs with no problems:

{
  "log_level": "info",
  "system_packages": [
    "gcc",
    "libc-dev",
    "python3-dev"
  ],
  "python_packages": [
    "RPi.GPIO"
  ]
}

Now I’m getting another error in my code, but I’m researching that first.

Thank you so much for all your help!

2 Likes

I don’t know if this deserves a separate issue or not. It is related, but a distinct issue.

Now I’m getting the following error in Appdaemon logs:

2018-11-04 17:23:34.999899 WARNING AppDaemon: Unexpected error in worker for App circuit:
2018-11-04 17:23:35.002117 WARNING AppDaemon: Worker Ags: {'name': 'circuit', 'id': UUID('8ca2c402-ee66-4975-9fce-67f80f9cbb36'), 'type': 'attr', 'function': <bound method Circuit.trigger of <circuit.Circuit object at 0x74729990>>, 'attribute': 'state', 'entity': 'input_boolean.trigger_universal_remote', 'new_state': 'on', 'old_state': 'off', 'kwargs': {'handle': UUID('b535d8e1-bf74-4de3-920f-f12d2eb80e5e')}}
2018-11-04 17:23:35.009009 WARNING AppDaemon: ------------------------------------------------------------
2018-11-04 17:23:35.013335 WARNING AppDaemon: Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/appdaemon/appdaemon.py", line 595, in worker
    self.sanitize_state_kwargs(app, args["kwargs"]))
  File "/config/appdaemon/apps/circuit.py", line 19, in trigger
    GPIO.setup(14, GPIO.OUT)
RuntimeError: No access to /dev/mem.  Try running as root!
2018-11-04 17:23:35.014570 WARNING AppDaemon: ------------------------------------------------------------

I’ve found that if I could run:

sudo adduser hass gpio

Then it may fix the issue, but I don’t think I can run this command since I am using HassOS?

If I was running Home Assistant in a docker env I would be able to, is that correct?

So now, to proceed, I need to swap to docker, is that correct?

you dont want to run appdaemon as root (sudo)
yeah, the problem with this is that you try to do advanced stuff with a system developed for noob use.
so you runin to all kind of trouble that normally would be easier to repair.

it seems the AD user which is probably the same as the hass user isnt able to read or write to /dev/mem

the whole dev dir is owned by root.
you could try to see if you could find the dir dev/mem and change the access so that the user running AD can access it. or add root access to the user. both solutions probably wont be easy on hassos and you need root access. (which is possible but not easy on default)

i would see if you get any response when you ask this in the hassio section. (maybe other have tried to use gpio also)

that said i googled for homeassistant gpio hassio and i noticed that there is a default component for home assistant.

so you might have travelled the wrong way.

add the gpio to your home assistant and then you can control them with appdaemon as well.

It took hours for me but this is the runing version on my hassio.

system_packages:
  - python3-dev
  - gcc
  - make
  - musl
  - musl-dev
  - libc-dev
python_packages:
  - RPi.GPIO
init_commands: []
log_level: info
1 Like

So what did you do, to run it as root.
I did the same implementation but still have the no Access problem.

actually, I couldn’t remember the case. Since I got other problems for controlling the relay, I have moved to venv version of the home assistant. I’m using a bottle script as a web service to trigger the relay.

Like a number of others on this forum and elsewhere, I have been trying to use
Appdaemon on a Raspberry pi to read data from GPIO pins and use it in Home Assistant.

In my case I’m trying to read the codes received by a 433MHz receiver attached to the pi
to GPIO PIN 27 using the rpi_rf module’s rpi-rf_receive.py script
(https://github.com/milaq/rpi-rf/blob/71fbe0507588cadd0e58978d2ed72a3cb5994f16/scripts/rpi-rf_receive)

But no luck as I keep getting this error:
File “/usr/lib/python3.8/site-packages/rpi_rf/rpi_rf.py”, line 188, in enable_rx
GPIO.setup(self.gpio, GPIO.IN)
RuntimeError: No access to /dev/mem. Try running as root!

Firstly, in my setup (Hass.io 32 bit for Raspberry pi 3b) there is no such directory as
/dev/mem
There is however this one
/sys/class/gpio
and when I enable the Raspberry PI GPIO integration in the configuration.yaml for pin 27
the folder GPIO27 appears in the above directory and events accrue in Home Assistant’s database.

It seems to be a permissions problem for AD apps accessing the GPIO pins of the pi.
So then I wondered what user Appdaemon apps run under and could I elevate that user’s permissions?

According to this little App I wrote it is actually the root user!
But root must have access to the GPIOs musn’t it?
Or is this a red herring?
And isn’t the advice not to run Appdaemon under the root user?

import appdaemon.plugins.hass.hassapi as hass
import os
import pwd

class DetectMotion(hass.Hass):
    
    def initialize(self):
        self.log("ok WE GOT THIS FAR now................")
        self.listen_now()

    def listen_now(self):
        self.log(pwd.getpwuid( os.getuid() )[ 0 ])

By the way I do have this in my Appdaemon configuation and all appears to go well according to the
Appdeamon logs.

system_packages: []
python_packages:
  - argparse
  - datetime
  - RPi.GPIO
  - rpi_rf
init_commands: []

Is there any way to fix this permissions problem without having to set up Home Assistant using venvs
or more complex onboarding?

Thanks in advance.

sorry, but i cant help with permissions on hassio.
i have never used it, and the permissions that the addon (AD docker) has is out of the reach from appdaemon.

not long ago i installed AD on a PI zero.
just a simple pip install, and i have working apps that use gpio

hassio is a very restricted area, to make sure that simple users dont come into trouble. and it also restricts the possibilities from AD.

so i see 2 ways to go:

  1. forget about hassio, or install hassio on another device then the PI that wants to use GPIO
  2. get in touch with frenck, and see if he can tell you how to get the needed permissions.

dont forget: AD is independant. it doesnt need to be on the same device that you run home assistant on. so its possible to have hassio on 1 PI and AD on another PI.