Display entity attribute

Hello everyone!

I’m looking for help.
How to display a entity attribute which is object in lovelace? Actually this attribute is array of json objects.

Thank you in advance.

try this entity attributes card:

Already tried. It can’t display values of attribute which is object. Getting only attribute name and saying that value is object.

Maybe you should try to post your code and the resulting entity with its attributes to give us an idea of what you are looking to try to get to.

I’m trying to display list of my packages with tracking numbers. 17track sensor have attribute packages which is array of json objects. Each is separate package.
I was using following filter with no success.

filter:
  include:
     - key: sensor.seventeentrack.packges.tracking_number

what are the resulting attributes of this platform? I don’t use it so I’m not able to visualize what the format is of what you are receiving.

What is that code snippet above from? a filter card of some sort?

Here is the list of attributes

{
  "attribution": "Data provided by 17track.net",
  "packages": [
    {
      "friendly_name": "Пакеты",
      "info_text": "Acceptance",
      "status": "In Transit",
      "tracking_number": "***********"
    }
  ],
  "unit_of_measurement": "шт.",
  "friendly_name": "В пути",
  "icon": "mdi:package",
  "package": "shipment_trackers"
}

Code snippet is from entity attribute card config.

You could create a template sensor to extract the value from the sensor attributes:

  value_template: >
    {% if states.sensor.seventeentrack.attributes.packages[0] is defined %}
      {{states.sensor.seventeentrack.attributes.packages[0].tracking_number }}
    {% else %}
      none
    {% endif %}

The only issue is you would need to create a sensor for every index number ([0], [1], [2], etc) for the number of packages that you would reasonably expect to receive at one time. And then list those in a conditional card (state is not ‘none’).

there might likely be a better way to do it but I’m not a templating guru so that is the way I would end up doing it even though it would get ugly if I got lot’s of packages.

What if the attribute for the sensor is larger than 255 characters? I’m trying to display a few attributes from an entity but… the returned result is too long (more that 255). But like this, there can be multiple itels [0], [1], [2], etc. I really just want to display the data in lovelace, it’s just a weather report, no need for automations, etc