#Help Needed: Multiscrape Entities Not Created When Product Data is Missing

1 messages · Page 1 of 1 (latest)

final turtle
#

I’m using the multiscrape integration in Home Assistant to scrape product data from SmartLabel website, based on a UPC stored in the sensor.esphome_web_e0bdc0_barcode_scanner_data sensor. The problem arises when I restart Home assistant: If the previous UPC in the sensor points to a valid page, but the product data isn’t found (e.g., the expected elements don’t exist on the page) then the multiscrape entities (e.g., sensor.smartlabel_product_title, sensor.smartlabel_product_image) are not created.

This becomes a major issue after restarting Home Assistant, as the entities remain "unknown" or completely missing, which breaks further scanning and related automations.

Goal:
I want to ensure the multiscrape entities are always created at startup, even if the scraped data is missing or unavailable. Ideally, these entities should initialize with a default state (e.g., "Product Not Found"). If this isn’t officially supported, I’m looking for a reliable workaround to achieve this.

#----Barcode lookup of product on SmartLabel for Shopping List -----------------
multiscrape:
  - resource_template: "https://smartlabel.syndigo.com/upc/{{ states('sensor.esphome_web_e0bdc0_barcode_scanner_data') | default('041415033658') }}"
    scan_interval: 86400
    sensor:
      - name: "SmartLabel Product Title"
        unique_id: "smartlabel_product_title"
        select: "title"
      - name: "SmartLabel Product Image"
        unique_id: "smartlabel_product_image"
        select: "img.top__image"
        attribute: "src"
      - name: "SmartLabel Supermarket Name"
        unique_id: "smartlabel_supermarket_name"
        select: "div.medium-medium"```


**Questions:**

1. How can I make multiscrape always create the entities, regardless of whether data is found?

2. Is there an official way to initialize multiscrape entities with default values when the scrape fails?

3. If not, what’s the best workaround to address this?