Lovelace Aftership Card

Why not just delete them?

It’s what I currently do, but having a filter would show only the ones I want automatically.

I get an error:

aftership: Error on device update!
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/entity_platform.py", line 261, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/app/homeassistant/helpers/entity.py", line 375, in async_device_update
    await self.async_update()
  File "/usr/src/app/homeassistant/components/aftership/sensor.py", line 190, in async_update
    'last_checkpoint': track['checkpoints'][-1]
IndexError: list index out of range

Can you post that to the GitHub, please

I published

I have same issue. I did a configuration of sensor as it’s described into the documentation, but the sensor is missing into HA. So the card is not working :frowning:

Is there any solution?

The situation in my case become very strange:
As I’m using docker I made few very simple tests:

  • install other container with HA - aftership works without issues
  • deleted entire HA container (just keeping the config foder) - and rebuilding container - problem persist.
    Now I have no ideas what I can do - may be something is written in some files into /config folder - but I cannot find anythings… Any ideas will be highly appreciated.

can you link to the aftership docker?

What do you mean by “Aftership Docker”?
I have 2 absolutely the same configs of HA - one is porduction installed long time ago and second one -test with just aftership configuration.
In first one I’m receiving error, second one - works as expected.

1 Like

Hi, on my instance Aftership worked correctly for a long time. After an update (I’m not sure which version but +/- 2 updates ago) it fails with the error mentioned above. My present version is 0.94.1. Are you sure that on both your installations you have the same version od Hassio?

1 Like

First I’m using “native” ha in docker, not HASSIO. Both were in different versions - production is - latest, test is dev. But in a few minutes I’ll try.
I try to install it for the first time in 93.x and it doesn’t work.

1 Like

In 0.95 problem is fixed. So aftership integration works without issues. Now I have problem with the After ship card - but will try to reinstall it first.

1 Like

Hi All

I¨m on HA 0.95.1 on HASSIO on a Raspberry Pi.
I’ve been able to add two trackings through the card, and I can see the trackings in the sensor, but after adding a series of packages, the card is not showing up any longer?

Sensor reports ‘3’
And the content looks like this:

  "attribution": "Information provided by AfterShip",
  "intransit": 2,
  "pending": 1,
  "trackings": [
    {
      "name": "Sonoff Basic",
      "tracking_number": "Hidden",
      "slug": "postnl-international",
      "link": "https://track.aftership.com/postnl-international/Hidden",
      "last_update": "2019-06-29T09:11:08+00:00",
      "expected_delivery": null,
      "status": "InTransit",
      "last_checkpoint": {
        "slug": "danmark-post",
        "city": "Brøndby",
        "created_at": "2019-06-29T09:08:08+00:00",
        "location": "Brøndby Pakkecenter - BRC, Brøndby, 2605, Danmark",
        "country_name": "Danmark",
        "message": "Forsendelsen behandles pĂĽ vores sorteringscenter",
        "country_iso3": "DNK",
        "tag": "InTransit",
        "subtag": "InTransit_003",
        "subtag_message": "Arrival scan",
        "checkpoint_time": "2019-06-28T11:11:03",
        "coordinates": [],
        "state": null,
        "zip": "2605"
      }
    },
    {
      "name": "Hidden",
      "tracking_number": "Hidden",
      "slug": "postnl-international",
      "link": "https://track.aftership.com/postnl-international/Hidden",
      "last_update": "2019-06-29T09:09:02+00:00",
      "expected_delivery": null,
      "status": "InTransit",
      "last_checkpoint": {
        "slug": "postnl-international",
        "city": null,
        "created_at": "2019-06-29T09:05:45+00:00",
        "location": null,
        "country_name": null,
        "message": "The item is on transport to the country of destination",
        "country_iso3": null,
        "tag": "InTransit",
        "subtag": "InTransit_007",
        "subtag_message": "Departure Scan",
        "checkpoint_time": "2019-06-28T14:37:00",
        "coordinates": [],
        "state": null,
        "zip": null
      }
    },
    {
      "name": "Havelys",
      "tracking_number": "Hidden",
      "slug": "postnl-international",
      "link": "https://track.aftership.com/postnl-international/Hidden",
      "last_update": "2019-06-29T09:05:08+00:00",
      "expected_delivery": null,
      "status": "Pending",
      "last_checkpoint": "Shipment pending"
    }
  ],
  "unit_of_measurement": "packages",
  "friendly_name": "aftership",
  "icon": "mdi:package-variant-closed"
}

So the sensor seems to hold the data, but the card is not being displayed (it’s still there).

Error in the browser console?

1 Like

You are absolutely right:


codelines

Just a thought from another one living in Denmark.
The character “ø” in the response, could be the problem.

1 Like

HA usually doesn’t have a problem with UTF-8 character sets, but yes, it’s always interesting when danish letters appear in the texts.

Similar for me. I added a package that has no update yet. And the whole card was removed.
Content:

	attribution: Information provided by AfterShip
pending: 1
trackings: [object Object]
unit_of_measurement: packages
friendly_name: aftership
icon: mdi:package-variant-closed
1 Like

This is not HA related, it’s JavaScript related. Please log an issue on the repo, not sure when I’ll get around to looking into it. @AlmostSerious same goes for your issue.

1 Like