17Track.net

Hi again. v2 of the component is ready. Big changes in this one: instead of providing tracking numbers via the configuration, you now manage them on the fly via the UI.

Example




Installation

  1. Remove your existing <CONFIG>/custom_components/sensor/seventeen_track.py
  2. Add this file to <CONFIG>/custom_components/sensor/: https://raw.githubusercontent.com/bachya/home-assistant/17track/homeassistant/components/sensor/seventeentrack.py
  3. Add a seventeentrack directory and all of the files listed here (including .translations) to <CONFIG>/custom_components/: https://github.com/bachya/home-assistant/tree/17track/homeassistant/components/seventeentrack

Configuration

In configuration.yaml, simply have this section:

seventeentrack:

Next Steps

Will reboot the beta for another week; send me feedback, bug repots, etc. here. Thanks!

3 Likes

Would it be possible to just pull them from a 17track account? E.g. add them to my account via site/app and automatically update component every x hours, discard the archived ones…

Can’t use it on docker image. (may be expected)

2018-05-22 23:39:17 ERROR (SyncWorker_11) [homeassistant.util.package] Unable to install package py17track==1.0.3: The directory '/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

Certainly! I can imagine a world where we might combine the packages in an account plus some ad hoc ones via the configuration UI. The only problem is that I don’t have an account, so I don’t have anything to develop again. If you’d be willing, DM me some info on yours I can use that to develop against.

1 Like

I don’t control the official Docker image, unfortunately. That said, sounds like you need to adjust permissions on the directory it mentions.

Hello once more, team. New update for you!

Key Changes

  • You can now get tracking for ad hoc (one-off) tracking numbers and/or via an account.
  • No configuration.yaml needed; all of this is done via a configuration entry in the UI!

Example


Installation

As always, use my Home Assistant fork to get the necessary files:

  1. Replace all files within <CONFIG>/custom_components/seventeentrack/with the latest.
  2. Replace <CONFIG>/custom_components/sensor/seventeentrack.pywith the latest.
  3. Add seventeentrack to the FLOWS list defined in homeassistant/config_entries.py.

Configuration

No configuration needed. It’s the future! Simply:

  • Click on Configuration
  • Click on Integrations
  • Click on 17tracking.net
  • Configure as needed

Next Steps

Will reboot the beta for another week; send me feedback, bug repots, etc. here. Thanks!

2 Likes

I don’t seem to be able to configure the integration.
I placed all the files in /config/custom_components and restarted HASS but it just doesn’t show up.

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