17track sensor

I amnot sure what you mean by plugin. 17Track is a built in integration.

Oh sorry i mean integrations…

2021-04-21 07:16:29 WARNING (MainThread) [homeassistant.loader] No ‘version’ key in the manifest file for custom integration ‘visonic’. As of Home Assistant 2021.6, this integration will no longer be loaded. Please report this to the maintainer of ‘visonic’

2021-04-21 07:16:29 WARNING (MainThread) [homeassistant.loader] No ‘version’ key in the manifest file for custom integration ‘svt_play’. As of Home Assistant 2021.6, this integration will no longer be loaded. Please report this to the maintainer of ‘svt_play’

You haven’t installed some external custom component (maybe from HACS) have you?

It looks like you have seventeentrack installed as a custom integration. Maybe you have installed that integration manually before that was part of the core. In that case you need to remove the the integration from the custom_integration folder to make sure that the core component is loaded.

Hi, i try this and it works, Thanks. But I want to add The Delvered packages in the second card (Package) and add this :

- entity_id: sensor.*track_package_*
      state: Delivered
      options:
        secondary_info: last-changed
        icon: 'mdi:package'

But it don’t work. Any ideas ?

Hey there,
i just get an Error with the official example on the intigrations page. My Password does not exceed the Character Count.

On Restart of the PI the only thing from seventeentrack that appears is the one parcel i entered. The Entity disappears after 10 Minutes Completely (Not Offline or Recovered) and comes just back if i restart the PI.

Do any of you have any idea what this is?

Please post the error message, not a screenshot.

Logger: homeassistant.helpers.template
Source: helpers/template.py:1331
First occurred: 11:23:11 (3 occurrences)
Last logged: 11:24:11

Template warning: 'as_timestamp' got invalid input 'None' when rendering template '{{ (as_timestamp(state_attr('calendar.home_assistant_devs', 'start_time')) + 60*60*18) | timestamp_custom | replace(' ', 'T') }}' but no default was specified. Currently 'as_timestamp' will return 'None', however this template will fail to render in Home Assistant core 2022.6

That is nothing to do with 17track. It is some template you have.

17track is working fine here.

The Entity of my tracked package goes missing after exactly 10 minutes with no specific Log entry. There is or was no Device for 17 Track/seventeentrack.

can this even be related to the warning at all or is it something else?

The integration updates every 10 minutes. You’ll need to bump up the logging for that integration.

It seems the Update to HASSOS 8.1 just Fixed it. I can see all Entities that i should see.
Thanks for your Help.

This is exactly my problem.

I have the integration running smoothly now, however it seems as though 17track themselves only update the tracking once a day (if at all without manual intervention). For example if I log into 17Track, check the boxes next to my saved tracking numbers and click “Track” the tracking data will be updated on the website, and shortly after home assitant will be updated with this new data (assuming via the 10 minute polling interval). Therefore it is not a problem with the home assistant polling, and rather the tracking data not being updated automatically by 17Track.

Is there any way to have the tracking data provided by 17 track to be updated more frequently? It looks like they have public APIs available now, which I would assume should make this possible?

I wonder the same thing.

Does anyone have this working with mushroom (chip) cards?

I only managed to get the count sensors as mushroom cards, but not the conditional or state-switch versions with an entity per package.

type: custom:vertical-stack-in-card
cards:
  - type: horizontal-stack
    cards:
      - type: custom:mushroom-entity-card
        icon: mdi:factory
        primary_info: state
        secondary_info: last-changed
        entity: sensor.seventeentrack_packages_not_found
      - type: custom:mushroom-entity-card
        primary_info: state
        icon: mdi:email-fast-outline
        secondary_info: last-changed
        entity: sensor.seventeentrack_packages_in_transit
      - type: custom:mushroom-entity-card
        primary_info: state
        icon: mdi:package-variant
        secondary_info: last-changed
        entity: sensor.seventeentrack_packages_delivered

I don’t use mushroom card but I extended the markdown card as found on 17TRACK - Home Assistant so I have more detailed information on the packages.

type: vertical-stack
cards:
  - type: markdown
    content: >-
      ## <ha-icon icon="mdi:truck-delivery"></ha-icon> Packages In Transit ({{(states('sensor.seventeentrack_packages_in_transit')) }})
    theme: bamva_headlines
  - type: markdown
    content: >
      ## Package details

      {% if states('sensor.seventeentrack_packages_in_transit') | int > 0 -%}

      {% for state in states.sensor.seventeentrack_packages_in_transit.attributes.packages -%}
          {% set package_entity = "sensor.seventeentrack_package_" ~ state.tracking_number.lower() %}
      * **{{state.tracking_number}}**

      {{"\n"}}
        * {{state.friendly_name}}
        * {{state_attr(package_entity,'info_text')}}
        * Distributed from {{state_attr(package_entity,'origin_country')}}
        * Last update: {{state_attr(package_entity,'timestamp').strftime("%d-%m-%Y %H:%M")}}
      {%- endfor %}

      {%- else -%}

      * **None**

      {%- endif %}
  - type: markdown
    content: >-
      ## <ha-icon icon="mdi:package-variant-closed"></ha-icon> Packages Delivered  ({{ (states('sensor.seventeentrack_packages_delivered')) }})
    theme: bamva_headlines
  - type: markdown
    content: >
      ## Package details

      {% if states('sensor.seventeentrack_packages_delivered') | int > 0 -%}

      {% for state in states.sensor.seventeentrack_packages_delivered.attributes.packages -%}
          {% set package_entity = "sensor.seventeentrack_package_" ~ state.tracking_number.lower() %}
      * **{{state.tracking_number}}**

      {{"\n"}}
        * {{state.friendly_name}}
        * {{state_attr(package_entity,'info_text')}}
        * Distributed from {{state_attr(package_entity,'origin_country')}}
        * Last update: {{state_attr(package_entity,'timestamp').strftime("%d-%m-%Y %H:%M")}}
      {{"\n"}}

      {%- endfor %}

      {%- else -%}

      * **None**

      {%- endif %}
2 Likes

Trying to install 17track, after putting the sensor into config with my login and restarted HA, no sensors related to 17track show up and when i check the logs, none of it is related to seventeentrack or 17track as well.

Please don’t post the same message to more than one thread.

Hi, a nice little code copied into a HomeAssistant MarkDown card does its job nicely.

{% set has_active_package = False %}

{% if states.sensor.seventeentrack_packages_undelivered.attributes.packages %}
{% set has_active_package = True %}
<font size="4">Undelivered packages:</font>
{% for package in states.sensor.seventeentrack_packages_undelivered.attributes.packages %}
>- **{{ package.friendly_name }}** ({{ package.tracking_number }}){% if package.timestamp %} {{ package.timestamp.strftime('%Y.%m.%d %H:%M') }}{% endif %}<br> {{ package.info_text }}{% if package.location %} - {{ package.location }}{% endif %}
{% endfor %}
{% endif %}

{% if states.sensor.seventeentrack_packages_ready_to_be_picked_up.attributes.packages %}
{% set has_active_package = True %}
<font size="4">Packages ready to be picked up/delivered:</font>
{% for package in states.sensor.seventeentrack_packages_ready_to_be_picked_up.attributes.packages %}
>- **{{ package.friendly_name }}** ({{ package.tracking_number }}){% if package.timestamp %} {{ package.timestamp.strftime('%Y.%m.%d %H:%M') }}{% endif %}<br> {{ package.info_text }}{% if package.location %} - {{ package.location }}{% endif %}
{% endfor %}
{% endif %}

{% if states.sensor.seventeentrack_packages_in_transit.attributes.packages %}
{% set has_active_package = True %}
<font size="4">Packages in transit:</font>
{% for package in states.sensor.seventeentrack_packages_in_transit.attributes.packages %}
>- **{{ package.friendly_name }}** ({{ package.tracking_number }}){% if package.timestamp %} {{ package.timestamp.strftime('%Y.%m.%d %H:%M') }}{% endif %}<br> {{ package.info_text }}{% if package.location %} - {{ package.location }}{% endif %}
{% endfor %}
{% endif %}

{% if states.sensor.seventeentrack_packages_not_found.attributes.packages %}
{% set has_active_package = True %}
<font size="4">Incorrect data and/or not yet available:</font>
{% for package in states.sensor.seventeentrack_packages_not_found.attributes.packages %}
>- **{{ package.friendly_name }}** ({{ package.tracking_number }}){% if package.timestamp %} {{ package.timestamp.strftime('%Y.%m.%d %H:%M') }}{% endif %}<br> {{ package.info_text }}{% if package.location %} - {{ package.location }}{% endif %}
{% endfor %}
{% endif %}

{% if not has_active_package %}
<font size="4">No tracked package.</font>
{% endif %}
1 Like

This is what I have for markdown to track my package.

{% set status = [
  {
      "sensor": "seventeentrack_packages_ready_to_be_picked_up",
      "icon": "mdi:flag",
      "order": 2
  },
  {
      "sensor": "seventeentrack_packages_not_found",
      "icon": "mdi:timer-sand-empty",
      "order": 6
  },
  {
      "sensor": "seventeentrack_packages_expired",
      "icon": "mdi:restore-alert",
      "order": 1
  },
  {
      "sensor": "seventeentrack_packages_undelivered",
      "icon": "mdi:alert-decagram",
      "order": 3
  },
  {
      "sensor": "seventeentrack_packages_in_transit",
      "icon": "mdi:truck-fast",
      "order": 4
  },
  {
      "sensor": "seventeentrack_packages_returned",
      "icon": "mdi:alert",
      "order": 5
  },
  {
      "sensor": "seventeentrack_packages_delivered",
      "icon": "mdi:package",
      "order": 1
  }
]
%}
{% set cellphone_text = '<ha-icon icon="mdi:cellphone" style="color:yellow"></ha-icon>' %}
{% set computer_text = '<ha-icon icon="mdi:laptop" style="color:yellow"></ha-icon>' %}

# **[17TRACK](https://buyer.17track.net/en/myshipment)** [{{cellphone_text}}](https://m.17track.net/en/track)

{%- for state in status|sort(attribute="order") %}

{%- if states['sensor'][state.sensor].state != '0' %}

## {{ states['sensor'][state.sensor]['attributes']['friendly_name'] }}

---
{%- for package in states['sensor'][state.sensor]['attributes']['packages']|sort(attribute="friendly_name") %}

### <ha-icon icon="{{ state.icon }}" style="color:yellow"></ha-icon> **{{ package.friendly_name }}** [{{computer_text}}](https://buyer.17track.net/en/myshipment?ob=1&Item={{package.tracking_number}}) [{{cellphone_text}}](https://m.17track.net/en/track-details?nums={{package.tracking_number}})

> **Tracking**: `{{package.tracking_number}}` 
{%- if package.info_text != None %}
> **Informations**: {{ package.info_text }} {% endif -%} 
{%- if package.location | length != 0 %} 
> **Location** : {{package.location}} {% endif -%} 
{%- if package.timestamp | string | length > 4 %} 
> **Update**: {{ relative_time(as_local(strptime(package.timestamp|string,'%Y-%m-%d %H:%M:%S%z'))) }} {% endif -%}

{% endfor %}
{% endif -%}
{%- endfor %}
4 Likes