How to parse JSON with Multiscrape

I’m trying to use the multiscrape integration to scrape JSON and I’m getting nowhere. I set up something reasonably complicated and couldn’t get it to work, so I’ve dumbed my sensor down to the absolute most basic config and I still get ‘unknown’ for the sensor value. Debug log says: Unable to scrape data: JSON cannot be scraped. Please provide a value template to parse JSON response.

I have a value_template already so I don’t know what else to do. I’m assuming I’m missing something simple.

This is my minimal example that isn’t working:

multiscrape:
  - name: Multiscrape Date
    resource_template: 'http://date.jsontest.com/'
    scan_interval: 36000
    log_response: true
    sensor:
      - unique_id: multiscrape_date
        name: Multiscrape Date
        select: "body > pre"
        value_template: '{{ value_json.date }}'

The resource is being correctly requested and shows up in the page_request_body.txt file as expected:

{
   "date": "09-01-2023",
   "milliseconds_since_epoch": 1693603701289,
   "time": "09:28:21 PM"
}

Why can’t I parse this response?

Try (as a test):

{{ (value | from_json).date }}

Or:

{{ (value | from_json)['date'] }}

If you can get JSON data, isn’t there an endpoint (URL) you can call directly to use with one of the REST platforms in HA?

Still get the same error with either of those options. I’m starting to think there is a bug with the integration if the response is JSON. Even if I simply set value_template: 'OK' I get the same error.

Rest works just fine with this simplistic example:

sensor:
  - platform: rest
    resource: http://date.jsontest.com
    name: Rest date
    value_template: "{{ value_json.date }}"

The problem I have is that the JSON response is gigantic and I want to use a value_template to work through it, and none of the native HA Rest integrations support templates for attributes. The only option would be to store the whole response in an attribute, and then use a separate template sensor to work through it. Or create a bunch of Rest sensors that each store one value, and then create a template sensor that combines them all into one sensor with a bunch of attributes.

I created an issue and quickly found out that what I needed to do was remove select from the sensor config. The following works:

multiscrape:
  - name: Multiscrape Date
    resource_template: 'http://date.jsontest.com/'
    scan_interval: 36000
    log_response: true
    sensor:
      - unique_id: multiscrape_date
        name: Multiscrape Date
        value_template: '{{ value_json.date }}'