17Track.net

Same here. I made sure to manually install ‘py17track==1.1.3’ to be on the safe side.

Console output:

...
2018-06-02 22:56:28 INFO (MainThread) [homeassistant.loader] Loaded seventeentrack from custom_components.seventeentrack
...
2018-06-02 22:56:28 INFO (MainThread) [homeassistant.setup] Setting up seventeentrack
2018-06-02 22:56:28 INFO (MainThread) [homeassistant.setup] Setup of domain seventeentrack took 0.0 seconds.
2018-06-02 22:56:28 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=140250233337168-1>
2018-06-02 22:56:28 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=140250233337168-2>
...

@tielemans.jorim and @Fusion: what does the full layout of <CONFIG DIR>/custom_components look like?

root@tvhub:~/.homeassistant/custom_components# ls
customizer  sensor  seventeentrack
root@tvhub:~/.homeassistant/custom_components# ls -lR
.:
total 12
drwxr-xr-x 2 root root 4096 Jun  2 23:08 customizer
drwxr-xr-x 2 root root 4096 Jun  2 22:58 sensor
drwxr-xr-x 4 root root 4096 Jun  2 23:10 seventeentrack

./customizer:
total 12
-rw-r--r-- 1 root root 5166 May 20 07:37 __init__.py
-rw-r--r-- 1 root root  658 May 20 07:37 services.yaml

./sensor:
total 4
-rw-r--r-- 1 root root 3502 Jun  2 22:32 seventeentrack.py

./seventeentrack:
total 24
-rw-r--r-- 1 root root 4384 Jun  2 22:37 __init__.py
drwxr-xr-x 2 root root 4096 Jun  2 23:10 __pycache__
-rw-r--r-- 1 root root 2837 Jun  2 22:37 config_flow.py
-rw-r--r-- 1 root root  206 Jun  2 22:36 const.py
-rw-r--r-- 1 root root  724 Jun  2 22:36 strings.json

./seventeentrack/__pycache__:
total 16
-rw-r--r-- 1 root root 4299 Jun  2 23:10 __init__.cpython-36.pyc
-rw-r--r-- 1 root root 2739 Jun  2 23:10 config_flow.cpython-36.pyc
-rw-r--r-- 1 root root  374 Jun  2 23:10 const.cpython-36.pyc
root@tvhub:~/.homeassistant/custom_components#
C:\Users\Jorim Tielemans>net use X: \\192.168.1.4\config
De opdracht is voltooid.


C:\Users\Jorim Tielemans>dir X:\custom_components /s
 Volume in drive X is config
 Volume Serial Number is A415-9EEA

 Directory of X:\custom_components

02/06/2018  21:43    <DIR>          .
03/06/2018  08:42    <DIR>          ..
02/06/2018  21:45    <DIR>          sensor
02/06/2018  21:47    <DIR>          seventeentrack
               0 File(s)              0 bytes

 Directory of X:\custom_components\sensor

02/06/2018  21:45    <DIR>          .
02/06/2018  21:43    <DIR>          ..
30/05/2018  21:48             3.502 seventeentrack.py
               1 File(s)          3.502 bytes

 Directory of X:\custom_components\seventeentrack

02/06/2018  21:47    <DIR>          .
02/06/2018  21:43    <DIR>          ..
30/05/2018  21:48             2.837 config_flow.py
30/05/2018  21:48               206 const.py
30/05/2018  21:48               724 strings.json
30/05/2018  21:48             4.384 __init__.py
               4 File(s)          8.151 bytes

 Directory of X:\custom_components\seventeentrack\.translations

02/06/2018  21:47    <DIR>          .
02/06/2018  21:47    <DIR>          ..
30/05/2018  21:48               913 en.json
               1 File(s)            913 bytes

     Total Files Listed:
               6 File(s)         12.566 bytes
              10 Dir(s)   8.377.393.152 bytes free

C:\Users\Jorim Tielemans>

@Fusion @tielemans.jorim All looks good there. To confirm, when you first start up HASS after adding these files, nothing additional will appear. Can you confirm you’ve gone through the configuration entry workflow I mention above (under “Configuration”)?

Uhm, I think I did? :laughing:

Ah, darn – I see what’s happening. I’ve updated my instructions: at the moment, you need to manually edit the config_entries.py file within the Home Assistant package (homeassistant/config_entries.yaml) and add seventeentrack to the FLOWS list (around line 129):

FLOWS = [
    'deconz',
    'hue',
    'seventeentrack',
    'zone',
]

Obviously, you wouldn’t need to do this if we weren’t trying to add it custom.

Fair warning, I’m not sure how easy this is to do in Hass.io…can you take a crack and see?

I tried looking almost everywhere but couldn’t find such file.

i followed your instructions, but got the folowing error:

Log Details (ERROR)

Mon Jun 04 2018 20:11:53 GMT+0200 (Central Europe Daylight Time)

Error loading custom_components.sensor.seventeentrack. Make sure all dependencies are installed
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/loader.py”, line 86, in get_component
module = importlib.import_module(path)
File “/srv/homeassistant/lib/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 978, in _gcd_import
File “”, line 961, in _find_and_load
File “”, line 950, in _find_and_load_unlocked
File “”, line 655, in _load_unlocked
File “”, line 678, in exec_module
File “”, line 205, in _call_with_frames_removed
File “/home/homeassistant/.homeassistant/custom_components/sensor/seventeentrack.py”, line 9, in
from homeassistant.components.seventeentrack.const import (
ModuleNotFoundError: No module named ‘homeassistant.components.seventeentrack’

any ideas ??

Got it. You’d have to figure out where Hass.io installs its Python packages; perhaps somewhere like /usr/lib/python3.6/site-packages/homeassistant?

Tihs is the interesting line. Sometimes, HASS seems to get stuck when installing dependencies. Can you install py17track manually?

Was one of the first places I checked, however: no /homeassistant in that folder.

maybe you should look here:
/srv/homeassistant/lib/python3.6/site-packages/homeassistant

/srv is an empty folder here

ah oke, then you dont use virtual envirement, i don’t know how the structure in hasio is.

@tielemans.jorim Apologies, but I’m not a Hass.io authority. Recommend you reach out on the Discord forum and see if someone there can tell you where to find this file.

i did everything manual, i created the folowing files, and copy/paste the data:

/home/homeassistant/.homeassistant/custom_components/sensor/seventeentrack.py

/home/homeassistant/.homeassistant/custom_components/seventeentrack/init.py
/home/homeassistant/.homeassistant/custom_components/seventeentrack/config_flow.py
/home/homeassistant/.homeassistant/custom_components/seventeentrack/const.py
/home/homeassistant/.homeassistant/custom_components/seventeentrack/strings.json

/home/homeassistant/.homeassistant/custom_components/seventeentrack/translations/en.json

  • i edit the config_entries.py
    somehow the sensor.seventeentrack wont load.

i also dont get any error in the logs, but when i put in the frontend intergrations an track and trace number, the log creates the error.

you can patch a running hassio (home assistant container) using docker exec -it homeassistant /bin/bash from host if you setup access

OK so I added ‘seventeentrack’ to config_entries.yaml and indeed I am now seeing the configuration UI.

However, after selecting the “Account” method and entering my information, after a few seconds this log message was displayed:

2018-06-05 07:01:43 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry chris@<redacted>.com for seventeentrack
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/homeassistant/config_entries.py", line 186, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/root/.homeassistant/custom_components/seventeentrack/__init__.py", line 59, in async_setup_entry
    await hass.async_add_job(seventeentrack.update)
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/root/.homeassistant/custom_components/seventeentrack/__init__.py", line 125, in update
    self.update_ad_hoc()
  File "/root/.homeassistant/custom_components/seventeentrack/__init__.py", line 135, in update_ad_hoc
    self.ad_hoc_packages = self._client.track.find(*self.tracking_numbers)
  File "/root/.homeassistant/deps/lib/python3.6/site-packages/py17track/track.py", line 26, in find
    raise InvalidTrackingNumberError('Invalid data')
py17track.exceptions.InvalidTrackingNumberError: Invalid data

Thanks! Your logs are confusing: it looks like you’re trying the “Account” method, but the exception is thrown because it can’t find a tracking number (indicative of the “Ad Hoc” method). I just pushed a new __init__.py to my fork that includes some extra logging; could you replace yours with that one, make sure your logging is set to DEBUG, and post the results here?