Easily track all your package/parcel!

As you can see in first post, this one is a work in progress. I post here for early adopters or for those who like tinkering as I need reviews so I can shape the integration based on needs.

I’m thinking about creating a new service to remove old parcel and also a custom front card to see and manage tracked parcels

Now, if your question is “17track vs parcelsapp”, it mostly depends on where you live and what are your most used delivery company. In France, 17track is really slow to update and overall parcels is better. It may be different for other countries.

Update: the latest version 0.1.1 has all the basics you need:

  • Add a parcel
  • Remove a parcel
  • A tons of attributes on sensors
  • Obviously fixed the persistence on HA reboot
  • Uses HA preferred language on parcelsapp API requests (so messages should be in your language now)

I updated the first post accordingly

I can’t seem to get it to work. Installs ok, API and country New Zealand.

But when I add a parcel, nothing happens. No sensor is created. Anything specific to check for?

Upon further investigation, I ran the curl example (the first one in the doc pages, with my own apikey, country and parcel number. It returned

{"error":"UNCONFIRMED_ACCOUNT"}

Weird thing. I can log into the dashboard,

I have no email asking me to confirm the account.

1 Like

goddamn as i typed that I thought to check spam folder. There it was and once I confirmed curl is now working.

2 Likes

Hi
I live in Belgium so main company is bpost, postnl and DHL…
Would love to see packages added automatically and a dashboard custom card is welcome too.
Main thing is, it should be free to use.

It is for 10 shipment per month, see Easily track all your package/parcel! - #8 by le.storm1er

Thank you, I had the same problem!

Hello, here’s a Frontend display for the integration. :slight_smile: It only works with versions above 0.1.2!

It can be quickly rewritten into other languages as it includes a translation option. I took the basics from the widely used Track17 markdown script and adapted it for ParcelsApp.

And below you can find a simple package removal tool.
The code is in English, only the example is in Hungarian :slight_smile:

{% set computer_text = '<ha-icon icon="mdi:laptop" style="color:yellow"></ha-icon>' %}

# **[ParcelsApp](https://parcelsapp.com/)**

{% set parcels = states.sensor | selectattr('entity_id', 'match', 'sensor.parcelsapp_tracking_*') | list %}
{% set parcels_by_status = parcels | groupby('attributes.status') %}

{% set status_translation = {
    'archive': 'Archived packages',
    'delivered': 'Delivered packages',
    'transit': 'Packages in transit',
    'arrived': 'Packages awaiting delivery',
    'pickup': 'Packages awaiting pickup',
    'pending': 'Pending'
} %}

{% for status_group in parcels_by_status %}
{% set status = status_group.grouper %}
{% set packages = status_group.list %}

## {{ status_translation.get(status, status) | capitalize }}

---

{% for package in packages %}
### <ha-icon icon="mdi:package-variant" style="color:yellow"></ha-icon> **{{ package.attributes.get('name', '') }}** [{{computer_text}}](https://parcelsapp.com/en/tracking/{{ package.attributes.get('tracking_id', '') }})

{%- if package.attributes.get('tracking_id') not in [None, 'undefined'] %}
> **Tracking number**: {{ package.attributes.tracking_id }}
{%- endif %}
{%- if package.attributes.get('message') not in [None, 'undefined'] %}
> **Status**: {{ package.attributes.message }}
{%- endif %}
{%- if package.attributes.get('carrier') not in [None, 'undefined'] %}
> **Carrier**: {{ package.attributes.carrier }}
{%- endif %}
{%- if package.attributes.get('location') not in [None, 'undefined'] %}
> **Location**: {{ package.attributes.location }}
{%- endif %}
{%- if package.attributes.get('origin') not in [None, 'undefined'] %}
> **Origin**: {{ package.attributes.origin }}
{%- endif %}
{%- if package.attributes.get('destination') not in [None, 'undefined'] %}
> **Destination**: {{ package.attributes.destination }}
{%- endif %}
{%- if package.attributes.get('days_in_transit') not in [None, 'undefined'] %}
> **Days in transit**: {{ package.attributes.days_in_transit }}
{%- endif %}
{%- if package.attributes.get('uuid') not in [None, 'undefined'] %}
> **UUID**: {{ package.attributes.uuid }}
{%- endif %}
{%- if package.attributes.get('uuid_timestamp') not in [None, 'undefined'] %}
> **UUID timestamp**: {{ package.attributes.uuid_timestamp }}
{%- endif %}
{%- if package.attributes.get('last_updated') not in [None, 'undefined'] %}
> **Last updated**: {{ relative_time(package.attributes.last_updated) }}
{%- endif %}

{% endfor %}

{% endfor %}

type: custom:auto-entities
card:
  type: entities
  title: Package Removal
  state_color: true
filter:
  include:
    - domain: sensor
      entity_id: sensor.parcelsapp_tracking_*
      options:
        type: custom:button-card
        name: |
          [[[ return entity.attributes.name ]]]
        icon: mdi:package-variant-closed
        tap_action:
          action: call-service
          service: parcelsapp.remove_package
          service_data:
            tracking_id: |
              [[[ return entity.attributes.tracking_id ]]]
          confirmation:
            text: Are you sure you want to delete this package?
        layout: icon_name
        styles:
          card:
            - padding: 10px
          grid:
            - grid-template-areas: i status
            - grid-template-columns: min-content auto
            - align-items: right
            - padding-top: 2px
            - font-size: 14px
          name:
            - grid-area: "n"
            - justify-self: start
          custom_fields:
            status:
              - grid-area: status
              - justify-self: end
              - padding-top: 2px
              - font-size: 10px
        custom_fields:
          status: |
            [[[ return entity.attributes.tracking_id ]]]

image

3 Likes

Track17 and Aftership can only query one carrier and are slower compared to Parcelsapp. I often get packages that are handled by 2-3 different carriers, and Parcelsapp can manage that seamlessly. It’s also much faster because I don’t have to wait for the main carrier to receive data from the underlying carriers.

For example, my last order from the US went with DHL within the US, then Yun Express took it to Germany, where Deutsche Post sent it to Hungary, and finally Hungarian Post delivered it. Of course, everything is trackable through the main tracking number, but by the time Hungarian Post syncs with the main track, the package is already in my hands :slight_smile:

2 Likes

hi. I am not familiar with the front end display code. Where do I paste the code into HA??

It’s to be put in a markdown card.

Hey works very nicely thanks.

1 Like

Anyone got a dutch version?
Ok how do i add a package? Its not possible to automatically add packages ? from bpost or postnl?
And how do i remove a package
And how do i see the state…

This is indeed very young integration :stuck_out_tongue:

Use the provided action.

See post Easily track all your package/parcel! - #19 by v1k70rk4

1 Like

I hope the creator of the integration makes his own card where you can add tracking, delete trackign and see state…
But fancier

That’s the goal, I’m also a dad with little free time, so it will come “when it’s ready” :stuck_out_tongue:

Thanks a lot for the startup cards @v1k70rk4 <3

3 Likes

Thank you! Works great!!!

1 Like

This integration seems to be holding up well, along with the markdown in https://community.home-assistant.io/t/easily-track-all-your-package-parcel/781310/19?u=nickrout

Well done guys.

i love parcelsapp and use it all the time.
i’ve been waiting for this kind of integration for a while now.

does anyone know how to add new tracking numbers without using developer tools?

i’ve created 2 helpers (tracking number and name) and tried to use them in an automation that perform the track_package action. it seems the action does not support templating (like {{states.input_text.tracking_id.state}})…

any idea, anyone?