Restful API multiple values

I have tried a ton of configs and can not get multiple values in my tile, what is the right format?
configuration.yaml I have
sensor: !include sensor.yaml

sensor.yaml

 - platform: rest
    resource: http://10.0.0.31
    unique_id: oil_sensor
    name: Oil Sensor
    value_template: "{{ value_json.gals}} "
    unit_of_measurement: gals

    name: Oil Sensor percentage
    value_template: "{{ value_json.percentage}} "
    unit_of_measurement: percentage

My stats just pull percentage, I want both percentage and gals

json
{“in”: 10.141732283464567, “name”: “OilSensor”, “cm”: 25.76, “gals”: 230.91622745745494, “percentage”: 92.36649098298197}

I can do this but then I need to add 2 cards to my dashboard 1 for ea variable


  - platform: rest
    resource: http://10.0.0.31
    unique_id: oil_sensor
    name: Oil Sensor
    value_template: "{{ value_json.gals}} "
    unit_of_measurement: gals

  - platform: rest
    resource: http://10.0.0.31
    unique_id: oil_sensor2
    name: Oil Sensor
    value_template: "{{ value_json.percentage}} "
    unit_of_measurement: percent

You have to use the rest integration, not the platform

# Example configuration.yaml entry
rest:
  - resource: "https://api.openweathermap.org/data/2.5/weather?zip=80302,us&APPID=VERYSECRETAPIKEY"
    sensor:
      - name: "Report"
        value_template: "{{ value_json['weather'][0]['description'].title() }}"
        picture: "{{ 'https://openweathermap.org/img/w/' + value_json['weather'][0]['icon'].lower() + '.png' }}"

      - name: "Outside temp"
        value_template: "{{ value_json['main']['temp'] - 273.15 }}"
        unit_of_measurement: "°C"

      - name: "Outside pressure"
        value_template: "{{ value_json['main']['pressure'] }}"
        unit_of_measurement: "hP"

      - name: "Outside humidity"
        value_template: "{{ value_json['main']['humidity'] }}"
        unit_of_measurement: "%"
1 Like

Oh so it has to go into the configuration.yaml then?

Yes OR use an include rest.yaml and put it in there.

Thanks koying, that worked