17TRACK

The 17TRACK integration allows users to get package data tied to their 17track.net account. The integration creates both summary sensors, which show the number of packages in a current state (e.g., "In Transit"), as well as individual sensors for each package within the account.

:::important Although the 17track.net website states that account passwords cannot be longer than 16 characters, users can technically set longer-than-16-character passwords. These passwords will not work with the used API. Therefore, please ensure that your 17track.net password does not exceed 16 characters.

::: :::note 配置 此集成可通过 UI 配置。前往 设置 > 设备与服务 添加。 :::

Package statuses

17track's API provides the following tracking statuses. The integration creates a sensor for each status, which contains the packages in that status. The sensor's displayed value is the number of packages in that status.

  • Not found
  • In transit
  • Expired
  • Ready to be picked up
  • Undelivered
  • Delivered
  • Returned

Examples

Dashboard summary card

To display package information on your dashboard, first create a trigger-based template sensor that calls the seventeentrack.get_packages action:

template:
  - trigger:
      - trigger: time_pattern
        hours: /1
      - trigger: homeassistant
        event: start
    action:
      - action: seventeentrack.get_packages
        data:
          config_entry_id: YOUR_CONFIG_ENTRY_ID
          package_state:
            - in_transit
        response_variable: result
    sensor:
      - name: "Packages in transit"
        unique_id: packages_in_transit
        state: "{{ result.packages | count }}"
        attributes:
          packages: "{{ result.packages }}"

Then use a templated Markdown card to list all packages in transit along with their status:

type: markdown
title: Packages in transit
content: >
  {% for package in state_attr('sensor.packages_in_transit', 'packages') %}

  - **{{ package.friendly_name }} ({{ package.tracking_number }}):** {{
  package.info_text }}

  {% endfor %}
Tip

To find your config_entry_id, go to Settings > Devices & services, select the 17Track integration, click the three-dot menu, and select Copy entry ID.

Actions

Action: Get packages

The seventeentrack.get_packages action allows you to query the 17track API for the latest package data.

Data attributeOptionalDescription
config_entry_idNoThe ID of the 17Track service config entry.
package_stateyesA list of the package states.
# Example automation action to retrieve packages with specific states from 17Track
- action: seventeentrack.get_packages
  data:
    config_entry_id: 2b4be47a1fa7c3764f14cf756dc98991
    package_state: ["Delivered", "In transit"]

Action: Archive package

The seventeentrack.archive_package action allows you to archive a package using the 17track API.

Data attributeOptionalDescription
config_entry_idNoThe ID of the 17Track service config entry.
package_tracking_numberNoThe package tracking number.
# Example automation action to archive a package with a tracking number
- action: seventeentrack.archive_package
  data:
    config_entry_id: 2b4be47a1fa7c3764f14cf756dc98991
    package_tracking_number: RU0103445624A

Action: Add package

The seventeentrack.add_package action allows you to add a package using the 17track API.

Data attributeOptionalDescription
config_entry_idNoThe selected service to add the package to.
package_tracking_numberNoThe package tracking number to add.
package_friendly_nameNoThe friendly name of the package to be added.
# Example automation action to add a package with tracking number and its friendly name
- action: seventeentrack.add_package
  data:
    config_entry_id: 2b4be47a1fa7c3764f14cf756dc98991
    package_tracking_number: RU0103445624A
    package_friendly_name: "Example Package"