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/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-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
REQUIREMENTS = ['RPi.GPIO==0.6.3']
CONF_SOCKET = 'socket'
DEFAULT_NAME = 'Energenie Switch'
_LOGGER = logging.getLogger(__name__)
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
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"""
import RPi.GPIO as GPIO
_LOGGER.info('IMPORTED GPIO')
socket = config.get(CONF_SOCKET)
socket_name = config.get(CONF_NAME)
print(config)
add_devices([EnergenieSwitch(socket, socket_name)])
_LOGGER.info('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.
Thanks,
Dan