Hey has anyone looked in contacting 17track.net to see if we can integrate package tracking into HASS?
I’d be happy to take a look. Do you have a tracking number I can use to test?
Here you go:
LX260466855NL
This package has been delivered in the meantime but is still traceable.
They don’t have a public API but are open to discuss potential cooperation as stated here: https://help.17track.net/hc/nl/articles/235261928-Does-17TRACK-have-API-
Personally I would love to see an integration for this.
I was able to reverse engineer a pretty simple API, which is great. I’m just waiting for some feedback from the other devs; once I get answers, I’ll start working on an integration.
Alright, got the answers I need. There’s lots of good data here and I have some work ahead of me. I’ll keep you posted.
Alright, we have a rough component in place. Would love some beta testers.
Download
You can download the sensor platform here: https://raw.githubusercontent.com/bachya/home-assistant/17track/homeassistant/components/sensor/seventeen_track.py
Load
To load into HASS, first place that file in <config_dir>/sensor/seventeen_track.py
.
Then, add this to your configuration.yaml
:
sensor:
- platform: seventeen_track
monitored_conditions:
- TRACKING_NUMBER_1
- TRACKING_NUMBER_2
# etc.
Caveats
There appear to be sporadic times where 17track.net doesn’t return data for a package. There tend to be two possible causes:
- You need to go to the 17track.net website, enter your tracking number, and confirming which carrier it belongs to.
- Restart your HASS.
Beta Period
Let’s go for a beta period of 7 days. We can discuss any feedback here; assuming we’re good to go at that time, I’ll push a PR to the HASS core.
That’s great, I’ll try it out. But did someone try to contact 17track for a cooperation? Because without there agreement, they might brake the component by next update, and official way would still be a better solution.
Remark: adding the package number through the interface would be a more practicable solution. I cannot restart my HA to add a new package in 17track.
I suppose a separate list like shopping list would be appropriate.
Yes, I reached out just as I was starting my work (middle of this week). No response yet, but will keep everyone posted.
I had a feeling someone would say that. I’ll take a look.
I have a lots of packages coming from China (thanks AliExpress and GearBest), so I’ll try to find some time to beta test as well.
THANKS for your efforts!
Hi all – I received the following from 17track over the weekend:
Dear 17TRACK user:
Thanks for visiting our website and taking time to contact us for our API service.
Please fill up the application form for us to review if you are a fit to use our API, we are very sorry that we don’t usually offer our API for public use because of the restriction of our data source.
Once we receive the applications, we will get back to you again.
Kind regards, 17TRACK
The application they mention is here: https://drive.google.com/open?id=1s-urICIwmSw8kfTTX3G9jgXA4FQlkdVL
So, we have two options (not necessarily mutually exclusive):
- Proceed forward with the reversed engineered API that I’m using and be nimble enough to adjust should it change.
- Attempt to go through the official registration process.
#2 isn’t fully my call: would need the weighing-in and backing of the primary owners. CC: @balloob @pvizeli @fabaff
I am working on getting partners onboard but 17TRACK is not big enough to be any priority.
Thanks, Paulus. We’ll move forward with a reverse-engineered integration.
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
- Remove your existing
<CONFIG>/custom_components/sensor/seventeen_track.py
- Add this file to
<CONFIG>/custom_components/sensor/
: https://raw.githubusercontent.com/bachya/home-assistant/17track/homeassistant/components/sensor/seventeentrack.py - 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!
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.
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:
- https://github.com/bachya/home-assistant/tree/17track/homeassistant/components/seventeentrack
- https://github.com/bachya/home-assistant/blob/17track/homeassistant/components/sensor/seventeentrack.py
- Replace all files within
<CONFIG>/custom_components/seventeentrack/
with the latest. - Replace
<CONFIG>/custom_components/sensor/seventeentrack.py
with the latest. - Add
seventeentrack
to theFLOWS
list defined inhomeassistant/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!
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.