Lovelace Aftership Card

I haven’t tested this but try updating the .js file from

<div>
                    ${item.last_checkpoint
            ? this._toTitleCase(item.last_checkpoint.location)
            : item.status}
                  </div>

to this

<div style="text-transform: capitalize">
                    ${item.last_checkpoint
            ? item.last_checkpoint.location
            : item.status}
                  </div>
1 Like

I beat you’re getting an error around here: https://github.com/custom-cards/aftership-card/blob/7f7694f69a519ab75ef640ba5c7d69eccab026a2/src/aftership-card.ts#L72

A status is expected on each tracking. Could be updated to define a default status for one’s that have nothing yet

1 Like

I don’t see any changed behaviour, same type error.

That can’t be right. Did you clear your browser cache?

1 Like

I’ve cleared the cache, and I’ve restarted HA.
I hope I inserted it the right place?

code

Does it work for you if you insert the same sensor data?

I don’t have time to test, but you wouldn’t have the same error as the toTitleCase function is no longer called

1 Like

Ok, am I inserting it the right place, at around line 3050?

So interesting find on the github, I’ll keep this card in mind until later when it’s updated. It would be interesting to have it really working. Thankyou @iantrich for starting the project, it’s a really great initiative! I hope you’ll find some time in the future to have a look at it.

im getting the same thing on 0.95.4


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

:frowning:

Did you find a fix for this?

You need to have a shipment under the aftership as soon as there is no outbound delivery error message.

I do! I have multiple

That is an issue with the integraition, not the card, open an issue here https://github.com/home-assistant/home-assistant/issues?q=is%3Aopen+is%3Aissue+label%3A"integration%3A+aftership"

I am running into an issue where the “ADD” function on the card doesn’t appear to be working. No errors seem to be thrown, just doesn’t work. Works via Add Service call. Running HassOS, Hassio 0.96.3, latest card (via HACS).

Any ideas?

Hi there, sorry for the newbie cuestion, im getting this, no tracking info, only (object Object) message, any ideas why is this happening?.

That’s how the info is stored. Use the card or look at the object in developer tools-> states

Sorry but i´m new and don´t quite get it, that´s the aftership card, isn´t it supposed to show the shipments states on it?

This is what i get looking into states:
{
“attribution”: “Information provided by AfterShip”,
“pending”: 1,
“inforeceived”: 1,
“intransit”: 3,
“trackings”: [
{
“name”: “9405809698839916646075”,
“tracking_number”: “9405809698839916646075”,
“slug”: “usps”,
“link”: “https://track.aftership.com/usps/9405809698839916646075”,
“last_update”: “2019-08-05T10:36:07+00:00”,
“expected_delivery”: null,
“status”: “Pending”,
“last_checkpoint”: “Shipment pending”
},
{
“name”: “Sensores Presión”,
“tracking_number”: “RU375144085NL”,
“slug”: “postnl-international”,
“link”: “https://track.aftership.com/postnl-international/RU375144085NL”,
“last_update”: “2019-08-05T09:09:36+00:00”,
“expected_delivery”: null,
“status”: “InfoReceived”,
“last_checkpoint”: {
“slug”: “postnl-international”,
“city”: null,
“created_at”: “2019-08-05T09:09:31+00:00”,
“location”: null,
“country_name”: null,
“message”: “The item is pre-advised to PostnL”,
“country_iso3”: null,
“tag”: “InfoReceived”,
“subtag”: “InfoReceived_001”,
“subtag_message”: “Info Received”,
“checkpoint_time”: “2019-08-05T06:13:00”,
“coordinates”: [],
“state”: null,
“zip”: null
}
},
{
“name”: “Carcasa Exterior”,
“tracking_number”: “RB772559558SG”,
“slug”: “singapore-post”,
“link”: “https://track.aftership.com/singapore-post/RB772559558SG”,
“last_update”: “2019-08-01T11:06:24+00:00”,
“expected_delivery”: null,
“status”: “InTransit”,
“last_checkpoint”: {
“slug”: “singapore-post”,
“city”: null,
“created_at”: “2019-08-01T11:06:19+00:00”,
“location”: “AR”,
“country_name”: “Argentina”,
“message”: “Arrival at Destination Post (Country: AR)”,
“country_iso3”: “ARG”,
“tag”: “InTransit”,
“subtag”: “InTransit_004”,
“subtag_message”: “Arrived at destination country”,
“checkpoint_time”: “2019-07-12T00:00:00”,
“coordinates”: [],
“state”: null,
“zip”: null
}
},
{
“name”: “Cámara Domo”,
“tracking_number”: “RU927334903CN”,
“slug”: “china-post”,
“link”: “https://track.aftership.com/china-post/RU927334903CN”,
“last_update”: “2019-07-17T10:40:44+00:00”,
“expected_delivery”: null,
“status”: “InTransit”,
“last_checkpoint”: {
“slug”: “china-post”,
“city”: null,
“created_at”: “2019-07-17T10:40:39+00:00”,
“location”: “布宜诺斯艾利斯”,
“country_name”: null,
“message”: “发送到境外海关部门”,
“country_iso3”: null,
“tag”: “InTransit”,
“subtag”: “InTransit_001”,
“subtag_message”: “In Transit”,
“checkpoint_time”: “2019-07-15T07:01:00”,
“coordinates”: [],
“state”: null,
“zip”: null
}
},
{
“name”: “Cámara SXJ02ZM”,
“tracking_number”: “RU374543890NL”,
“slug”: “postnl-international”,
“link”: “https://track.aftership.com/postnl-international/RU374543890NL”,
“last_update”: “2019-08-04T22:47:21+00:00”,
“expected_delivery”: null,
“status”: “InTransit”,
“last_checkpoint”: {
“slug”: “postnl-international”,
“city”: null,
“created_at”: “2019-07-12T22:42:44+00:00”,
“location”: null,
“country_name”: null,
“message”: “The item is being processed by customs”,
“country_iso3”: null,
“tag”: “InTransit”,
“subtag”: “InTransit_006”,
“subtag_message”: “Customs clearance started”,
“checkpoint_time”: “2019-07-12T09:01:00”,
“coordinates”: [],
“state”: null,
“zip”: null
}
}
],
“unit_of_measurement”: “packages”,
“friendly_name”: “aftership”,
“icon”: “mdi:package-variant-closed”
}

That’s the more-info card for the sensor, not the lovelace card as linked at the top of this thread. The card I made shows tracking information.

You were right, my mistake. Anyway, now i followed you instructions step by step, ( saved aftership-card.js to “config directory>/www/aftership-card.js” on my Home Assistant instance, linked the card into the raw editor, and created the custom card, but notting happens, is like i had an empy card. Weird.



@iantrich I’m having the same issue as @rnlascano. I added the card via HACS, have the component working, and can see the deliveries in states, but the card is just blank. The edit buttons are there when editing the UI, but no card is visible.