Custom Component issue - Energenie Pi-Mote (RPi.GPIO import error)

Hi all,

I have been trying to create a custom component which will talk to my Energenie sockets via the Pi-mote control board on the Raspberry Pi. (The board).

This board requires some Python scripting in order to talk to the sockets via the Pi’s GPIO pins. I am having trouble importing the RPI-GPIO module. Here is the error in the logs:

2018-06-04 14:41:24 ERROR (SyncWorker_4) [homeassistant.util.package] Unable to install package RPi.GPIO==0.6.3: Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-a01_btne/RPi.GPIO/';f=getattr(tokenize, 'open', open)(__file__);'\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-x3xokudw-record/install-record.txt --single-version-externally-managed --prefix  --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-a01_btne/RPi.GPIO/
2018-06-04 14:41:24 ERROR (MainThread) [homeassistant.requirements] Not initializing switch.energenie_switcher because could not install requirement RPi.GPIO==0.6.3

I am running Hassio v0.70.1 on a Raspberry Pi Model B.

Here is a snippet of my custom component:

Support for Energenie pi hat remote
import logging
import voluptuous as vol

from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHEMA)
from homeassistant.const import CONF_NAME
import homeassistant.helpers.config_validation as cv


CONF_SOCKET = 'socket'
DEFAULT_NAME = 'Energenie Switch'

_LOGGER = logging.getLogger(__name__)

    vol.Required(CONF_NAME): cv.string,
    vol.Required(CONF_SOCKET): cv.string

def setup_platform(hass, config, add_devices, discovery_info=None):
    """setup the switch"""

    socket = config.get(CONF_SOCKET)
    socket_name = config.get(CONF_NAME)


    add_devices([EnergenieSwitch(socket, socket_name)])'added devices now......')

And my .yaml:

platform: energenie_switcher
name: 'Socket 1 - Speakers'
socket: 1

Any advice on this error? I may have errors in my component but to me that error is just in relation to the Requirements installation.


Anyone have any insight on this? Half of my IoT devices are rendered unusable if I cannot talk to the Pi-mote module.

Has anyone gotten a Python script that imports RPi.GPIO working?

I may be stating the obvious. but you have looked at how the gpio component does it?

Did you ever make any progress with your hassio component for the pimote?