Add a package
The Add a package action adds a package to your 17Track account by its tracking number, so 17Track starts following it for you.
This is handy when you want to start tracking a shipment straight from Home Assistant, for example from an automation that reads tracking numbers out of your order confirmation emails.
Using this action from the user interface
If you prefer building automations and scripts visually, Home Assistant walks you through this action step by step. You pick what to target, tweak a few options, and save. No YAML knowledge required.
To add a package from an automation or a script:
- Go to Settings > Automations & scenes.
- Open an existing automation or script, or select Create automation > Create new automation.
- If you’re setting up a new automation, add a trigger in the When section. Scripts don’t need a trigger. They run when something else calls them.
- In the Then do section, select Add action.
- From the search box, search for and select 17TRACK: Add a package.
- Select the 17Track service, then enter the Package tracking number to add and a Package friendly name.
- Select Save.
This action does not support targets. In the UI, you select the 17Track service through the 17Track service field instead of choosing an area, device, entity, or label.
Options in the UI
Using this action in YAML
If you work directly in YAML, or you want to know exactly what Home Assistant does under the hood, this section has the technical reference. It lists the field names you use in YAML, their types, and which ones are required.
In YAML, refer to this action as seventeentrack.add_package. A basic example looks like this:
action: seventeentrack.add_package
data:
config_entry_id: 2b4be47a1fa7c3764f14cf756dc98991
package_tracking_number: RU0103445624A
package_friendly_name: "Example package"
This adds the package to 17Track under the given friendly name.
Options in YAML
Good to know
- Combine this action with dashboard helpersA helper is a virtual entity you create inside Home Assistant. It is not backed by a physical device. Helpers store values, track state, or do calculations that your automations and dashboards need. [Learn more] to create an automation that adds a package to 17Track when you enter the new package data from the dashboard:
- Create an input text helper for each of the following required fields: Package tracking number to add, Package friendly name and 17Track service, and then add them to a new card in your dashboard.
- Since the value of 17Track service (
config_entry_id) never changes once set, you can pre-fill it in the helper and leave it fixed. Only the first two helpers need to be filled in each time you want to add a package. - You can also create an input button helper and add it as the trigger of your automation, as described in the automation example for tracking a package by entering all package data in dashboard helpers.
Try it yourself
Ready to test this? Open Developer tools > Actions, search for this action, fill in the fields, and select Perform action. You see what happens on your actual entitiesAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more] without writing a line of YAML.
More examples
Real scenarios where this action shows up in automations and scripts. Copy any example and adapt it to your setup.
You don’t need to edit YAML to use these examples. Copy a YAML snippet from this page, open the automation editor in Home Assistant, and press Ctrl+V (or Cmd+V on Mac). Home Assistant automatically converts the pasted YAML into the visual editor format, whether it’s a full automation, a single trigger, a condition, or an action.
Automation: track a package by entering the tracking number in a dashboard helper
When a helper that holds a new tracking number changes, add that package to 17Track.
-
Trigger: State
-
Entity: Tracking number (
input_text.tracking_number)
-
Entity: Tracking number (
- Action: 17TRACK: Add a package
YAML example for adding a package using a text helper
alias: "Track new package"
triggers:
- trigger: state
entity_id: input_text.tracking_number
actions:
- action: seventeentrack.add_package
data:
config_entry_id: 2b4be47a1fa7c3764f14cf756dc98991
package_tracking_number: "{{ states('input_text.tracking_number') }}"
package_friendly_name: "New order"
Automation: track a package by entering all package data in dashboard helpers
Enter the tracking number and friendly name of a new package in a dedicated card on your dashboard and then press a button to start this automation. The automation reads the two text helpers that were added and, if the tracking number is not empty, passes the values as data to the 17TRACK: Add a package action. After that, it clears the input fields for the next use.
-
Trigger: State
-
Entity: Add package to 17Track (
input_button.add_package_to_17track)
-
Entity: Add package to 17Track (
- Condition: Template
- Action: 17TRACK: Add a package
-
Action: Input text: Set input text value
- Target: Package tracking number
-
Action: Input text: Set input text value
- Target: Package friendly name
YAML example for adding a package using dashboard helpers
alias: "Add package to 17Track from dashboard helpers"
triggers:
- trigger: state
entity_id: input_button.add_package_to_17track
conditions:
- condition: template
value_template: >
{{ states('input_text.package_tracking_number') | length > 0 }}
actions:
- action: seventeentrack.add_package
data:
config_entry_id: >
{{ states('input_text.seventeentrack_config_entry_id') }}
package_tracking_number: >
{{ states('input_text.package_tracking_number') }}
package_friendly_name: >
{{ states('input_text.package_friendly_name') }}
- action: input_text.set_value
target:
entity_id: input_text.package_tracking_number
data:
value: ""
- action: input_text.set_value
target:
entity_id: input_text.package_friendly_name
data:
value: ""
Still stuck?
The Home Assistant community is quick to help: join Discord for real-time chat, post on the community forum with the action you’re calling and what you expected to happen, or share on our subreddit /r/homeassistant.
AI assistants like ChatGPT or Claude can also explain actions or suggest the right one when you describe what you want in plain language.
Related actions
These actions work well alongside this one:
-
Get packages: Queries the 17Track API for the latest package data.
-
Archive package: Archives a package in 17Track by tracking number.