Filtering from a sensor that outputs a list

Im using a custom integration for monitoring grocy states in home assistant. The sensor “sensor.grocy_stock” gives me a list which looks like this:

items
- _product_id: 3
  _available_amount: 31
  _best_before_date: '2999-12-31T00:00:00+00:00'
  _name: Citerizin
  _barcodes:
    - '-06716142'
  _product_group_id: 3
- _product_id: 8
  _available_amount: 1
  _best_before_date: '2020-07-15T00:00:00+00:00'
  _name: Eistee
  _barcodes:
    - ''

Is there a way that I can filter this list to display for only 1 product and its amount into a lovelace card? The perfect way would be creating a sensor for each product so that I can easily use it for automations, but im not too familar with templating that complicated stuff.

you could use a template sensor Template - Home Assistant
with a template like this:

or you try a custom card: Lovelace: Attributes card / entity row

Thanks for pointing me in the right direction for the template sensor, this works, the way i want it. Now i have alot work to do, implementing a template sensor for every item in stock i want to use for automations or such.
But now, i want to add a card to lovelace with the sensor, displaying the amount of the items remaining in stock, and when i tap it, it should tell grocy to consume that item.
When i add a button card for it with the code:

entity: sensor.grocy_product0
hold_action:
  action: more-info
name: Ceterizin nehmen
show_icon: true
show_name: true
tap_action:
  action: call-service
  service: grocy.consume_product
  service_data:
    amount: 1
    product_id: 3
    transaction_type: CONSUME
type: button

Then the amount left is hidden. When i try to add an entity or sensor card with the code

type: entities
title: My Title
entities:
  - entity: sensor.grocy_product0
    tap_action:
      action: call_service
      service: grocy.consume_product
      service_data: null
      product_id: 3
      amount: 3
      transaction_type: CONSUME

I get in the code editor

Expected a value of type `{entity,name,icon} | entity-id` for `entities.0.tap_action` but received `{"action":"call_service","service":"grocy.consume_product","service_data":null,"product_id":3,"amount":3,"transaction_type":"CONSUME"}`

Although in the docs it says the cards support tap_action.

What am i doing wrong?

for the entity card it’s typo and indentation, i think:

type: entities
title: My Title
entities:
  - entity: sensor.grocy_product0
    tap_action:
      action: call-service
      service: grocy.consume_product
      service_data: null
        product_id: 3
        amount: 3
        transaction_type: CONSUME

Its not about the “missing” indetation, it actually complains about a bad indentation whith the indentation of the service data.

remove ‘null’ from service_data: and it’s ‘call-service’ your first code was call_service. If it’s still not working i am running out of ideas

type: entities
title: My Title
entities:
  - entity: sensor.grocy_product0
    tap_action:
      action: call-service
      service: grocy.consume_product
      service_data:
        product_id: 3
        amount: 3
        transaction_type: CONSUME