The REST sensor has shorter history than other type of sensors

Hi everyone. Quick question about the long term statistic table.

I’m using the public REST API of GasBuddy to track the gas price around me. However, the REST sensor only has history of around one week(probably the default history length set in recorder field? Not sure) while other sensors can keep their history in long term statistic table, see below.

May I ask if there’s a special setting for REST sensor, or if there’s a way to debug this. Thanks!
:pray:

Recorder setting:

recorder:
  db_url: !secret recorder_db_url

Sensor setting:

- platform: rest
  scan_interval: 3600
  resource: https://www.gasbuddy.com/graphql
  method: POST
  headers:
    Content-Type: application/json
  payload: |
    {
      "operationName": "GetStation",
      "variables": {
        "id": "xxxxx"
      },
      "query": "query GetStation($id: ID!) { station(id: $id) { prices { credit { nickname postedTime price } } } }"
    }
  unique_id: gasbuddy_arco_price
  name: Arco gas price
  icon: mdi:gas-station
  unit_of_measurement: USD
  value_template: "{{ value_json.data.station.prices.0.credit.price | float }}"

Other sensors, e.g., Xiaomi thermometer

For long term statistics to be generated an entity needs a state_class. The RESTful sensor does support this option. In your case use:

  state_class: measurement

I see. Thanks for the explanation.