Multiple sensors in a single REST call

The API endpoint: http://192.168.1.2:61208/api/3/gpu

Returns:

[
  {
    "key": "gpu_id",
    "gpu_id": 0,
    "name": "GeForce GTX 1050 Ti",
    "mem": 4.415225982666016,
    "proc": 3,
    "temperature": 41
  }
]

I’ve been using 3 separate REST calls (below) to grab the respective information. I was wondering how I can do this more efficiently with just one call.

  - platform: rest
    resource: http://192.168.1.2:61208/api/3/gpu
    name: GPU Processor
    value_template: '{{ value_json[0].proc }}'
    unit_of_measurement: "%"
    scan_interval: 5
  - platform: rest
    resource: http://192.168.1.2:61208/api/3/gpu
    name: GPU Memory
    value_template: '{{ value_json[0].mem| round(2)  }}'
    unit_of_measurement: "%"
    scan_interval: 5
  - platform: rest
    resource: http://192.168.1.2:61208/api/3/gpu
    name: GPU Temperature
    value_template: '{{ value_json[0].temperature }}'
    unit_of_measurement: "°C"
    scan_interval: 5

Thanks in advance

If you just want to reduce the number of API calls you can do something like this:

- platform: rest
  resource: http://192.168.1.2:61208/api/3/gpu
  name: GPU Memory
  value_template: '{{ value_json[0].mem| round(2)  }}'
  unit_of_measurement: "%"
  scan_interval: 5
  json_attributes:
  - proc
  - temperature
- platform: template
  sensors:
    gpu_processor:
      friendly_name: GPU Processor
      value_template: "{{ state_attr('sensor.gpu_memory', 'proc') }}"
      unit_of_measurement: '%'
    gpu_temperature:
      friendly_name: GPU Temperature
      value_template: "{{ state_attr('sensor.gpu_memory', 'temperature') }}"
      unit_of_measurement: '°C'

This way it will only make one API call and store all the data on one sensor and the other two will update from that.

That’s probably about as close as you could get natively with HA. I don’t know of any way to create/update 3 sensors directly from one API call without involving attributes other then using AppDaemon or Node RED