I’m trying to integrate my smappee in home assistant.
I’ve found this in github.
I use this code in my smappee.py file:
import logging
import socket
from urllib.error import URLError
from datetime import timedelta
from homeassistant.const import (
CONF_ACCESS_TOKEN, CONF_NAME, CONF_API_KEY, CONF_PASSWORD,
CONF_USERNAME, STATE_UNKNOWN)
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
_LOGGER = logging.getLogger(__name__)
REQUIREMENTS = [
'https://github.com/EnergyID/smappy/archive/master.zip'
'#smappee/smappee==0.1.1']
And i get these errors:
16-05-03 12:54:45 INFO (MainThread) [homeassistant.loader] Loaded sensor.smappee from homeassistant.components.sensor.smappee
Process Process-1:
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/_vendor/packaging/requirements.py", line 90, in __init__
req = REQUIREMENT.parseString(requirement_string)
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/_vendor/pyparsing.py", line 1137, in parseString
raise exc
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/_vendor/pyparsing.py", line 1127, in parseString
loc, tokens = self._parse( instring, 0 )
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/_vendor/pyparsing.py", line 1001, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/_vendor/pyparsing.py", line 2412, in parseImpl
loc, exprtokens = e._parse( instring, loc, doActions )
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/_vendor/pyparsing.py", line 1005, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/_vendor/pyparsing.py", line 2215, in parseImpl
raise ParseException(instring, loc, self.errmsg, self)
pkg_resources._vendor.pyparsing.ParseException: Expected stringEnd (at char 5), (line:1, col:6)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 2788, in __init__
super(Requirement, self).__init__(requirement_string)
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/_vendor/packaging/requirements.py", line 94, in __init__
requirement_string[e.loc:e.loc + 8]))
pkg_resources.extern.packaging.requirements.InvalidRequirement: Invalid requirement, parse error at "'://githu'"
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/homeassistant/util/package.py", line 46, in check_package_exists
req = pkg_resources.Requirement.parse(package)
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 2833, in parse
req, = parse_requirements(s)
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 2781, in parse_requirements
yield Requirement(line)
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 2790, in __init__
raise RequirementParseError(str(e))
pkg_resources.RequirementParseError: Invalid requirement, parse error at "'://githu'"
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/_vendor/packaging/requirements.py", line 90, in __init__
req = REQUIREMENT.parseString(requirement_string)
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/_vendor/pyparsing.py", line 1137, in parseString
raise exc
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/_vendor/pyparsing.py", line 1127, in parseString
loc, tokens = self._parse( instring, 0 )
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/_vendor/pyparsing.py", line 1001, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/_vendor/pyparsing.py", line 2412, in parseImpl
loc, exprtokens = e._parse( instring, loc, doActions )
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/_vendor/pyparsing.py", line 1005, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/_vendor/pyparsing.py", line 2215, in parseImpl
raise ParseException(instring, loc, self.errmsg, self)
pkg_resources._vendor.pyparsing.ParseException: Expected stringEnd (at char 7), (line:1, col:8)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 2788, in __init__
super(Requirement, self).__init__(requirement_string)
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/_vendor/packaging/requirements.py", line 94, in __init__
requirement_string[e.loc:e.loc + 8]))
pkg_resources.extern.packaging.requirements.InvalidRequirement: Invalid requirement, parse error at "'/smappee'"
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/multiprocessing/process.py", line 254, in _bootstrap
self.run()
File "/usr/lib/python3.4/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.4/dist-packages/homeassistant/__main__.py", line 245, in setup_and_run_hass
skip_pip=args.skip_pip, log_rotate_days=args.log_rotate_days)
File "/usr/local/lib/python3.4/dist-packages/homeassistant/bootstrap.py", line 303, in from_config_file
skip_pip=skip_pip)
File "/usr/local/lib/python3.4/dist-packages/homeassistant/bootstrap.py", line 275, in from_config_dict
_setup_component(hass, domain, config)
File "/usr/local/lib/python3.4/dist-packages/homeassistant/bootstrap.py", line 128, in _setup_component
p_name)
File "/usr/local/lib/python3.4/dist-packages/homeassistant/bootstrap.py", line 206, in prepare_setup_platform
if not _handle_requirements(hass, platform, platform_path):
File "/usr/local/lib/python3.4/dist-packages/homeassistant/bootstrap.py", line 68, in _handle_requirements
if not pkg_util.install_package(req, target=hass.config.path('deps')):
File "/usr/local/lib/python3.4/dist-packages/homeassistant/util/package.py", line 22, in install_package
if check_package_exists(package, target):
File "/usr/local/lib/python3.4/dist-packages/homeassistant/util/package.py", line 49, in check_package_exists
req = pkg_resources.Requirement.parse(urlparse(package).fragment)
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 2833, in parse
req, = parse_requirements(s)
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 2781, in parse_requirements
yield Requirement(line)
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 2790, in __init__
raise RequirementParseError(str(e))
pkg_resources.RequirementParseError: Invalid requirement, parse error at "'/smappee'"
What am i doing wrong?