myUSPS component

I just setup the USPS component on ver 0.37.1 but am unable to get it working. It appears all of the dependencies aren’t present and I get this error in the log:

17-02-03 14:58:58 ERROR (Thread-6) [homeassistant.bootstrap] Not initializing sensor.usps because could not install dependency myusps==1.0.2

I’ve checked the deps folder and there is nothing present for usps. Anyone know how I can remedy this? Can I manually download the dependency or something?

Thanks.

Try running:

sudo apt-get install libxml2-dev
sudo apt-get install libxslt1-dev

Then restart Home Assistant.

Please let me know what your outcome is as I was hoping mine would work after those steps to get myusps package installed, however, I’m now finding another issue:

https://github.com/home-assistant/home-assistant/issues/5739

Noob question,

For the fix do we run both installs from inside the virtual environment (if running HASS in one)?

@highfi13g

You would run this as the pi user:

sudo apt-get install libxml2-dev
sudo apt-get install libxslt1-dev

When you restart Home Assistant it should automatically install myusps automatically, however, you can also cd and source /bin/activate your virtualenv and then run pip3 install myusps.

No luck.

I ran these two commands:

sudo apt-get install libxml2-dev
sudo apt-get install libxslt1-dev

I then restarted hass and hass failed to run. I then read further down about your instructions for RasPi AIO installation and performed the following:

sudo su -s /bin/bash homeassistant
source /srv/homeassistant/homeassistant_venv/bin/activate
pip3 install myusps

the installation took about 20 minutes, which seemed a bit excessive, but when it completed hass was functioning as normal and the same error was gone from the log and replaced with a new error:

17-02-04 13:29:10 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform usps
Traceback (most recent call last):
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 151, in _async_setup_platform
    entity_platform.add_entities, discovery_info
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/sensor/usps.py", line 54, in setup_platform
    config.get(CONF_UPDATE_INTERVAL))])
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/sensor/usps.py", line 69, in __init__
    self.update()
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/util/__init__.py", line 296, in wrapper
    result = method(*args, **kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/sensor/usps.py", line 85, in _update
    for package in myusps.get_packages(self._session):
  File "/home/homeassistant/.homeassistant/deps/myusps/__init__.py", line 99, in wrapped
    return function(*args)
  File "/home/homeassistant/.homeassistant/deps/myusps/__init__.py", line 123, in get_packages
    dashboard = _require_elem(response, DASHBOARD_XPATH)
  File "/home/homeassistant/.homeassistant/deps/myusps/__init__.py", line 66, in _require_elem
    raise ValueError('No element found')
ValueError: No element found

Thoughts as to what else to try? I can verify that there are two myusps folders in the deps folder.

Thanks for your help.

I think you’re getting that error because you don’t have a package in your USPS account. Did you get it working? I am in the process of doing the pip install and my cpu is hanging at 99-100% but its still trickling. Wondering if that is what you experienced since you said it took 20min. Seems kinda ridiculous for a package to take that long to install. But I am on a rp2. Who knows. Hopefully this works. It’s not even a big deal if it doesn’t. I just don’t like when something doesn’t work.

Looks like it installed. Now I get this… Even though my login information looks accurate.

Feb 12 09:13:20 ha-pi hass[3014]: INFO:homeassistant.components.sensor:Setting up sensor.usps
Feb 12 09:13:22 ha-pi hass[3014]: ERROR:homeassistant.components.sensor:Error while setting up platform          usps
Feb 12 09:13:22 ha-pi hass[3014]: File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-     packages/myusps/__init__.py", line 99, in wrapped
Feb 12 09:13:22 ha-pi hass[3014]: File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/myusps/__init__.py", line 109, in get_profile
Feb 12 09:13:22 ha-pi hass[3014]: File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/myusps/__init__.py", line 63, in _require_elem
Feb 12 09:13:22 ha-pi hass[3014]: myusps.USPSError: Not logged in
Feb 12 09:13:22 ha-pi hass[3014]: File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/sensor/usps.py", line 54, in setup_platform
Feb 12 09:13:22 ha-pi hass[3014]: File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/sensor/usps.py", line 65, in __init__
Feb 12 09:13:22 ha-pi hass[3014]: self._profile = myusps.get_profile(session)
Feb 12 09:13:22 ha-pi hass[3014]: File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/myusps/__init__.py", line 102, in wrapped
Feb 12 09:13:22 ha-pi hass[3014]: File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/myusps/__init__.py", line 109, in get_profile
Feb 12 09:13:22 ha-pi hass[3014]: File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/myusps/__init__.py", line 63, in _require_elem
Feb 12 09:13:22 ha-pi hass[3014]: myusps.USPSError: Not logged in