JSON parsing

Hello, I was able to get the sensor.papercut filter some attributes. However, I want to get the value of upgradeAssuranceRemainingDays (sensor.papercut_license_days) I cannot get it work. The sensor state shows “unknown”. Below is my sensor yaml lines and below it is the sensor.papercut attributes. Please help!

  - platform: rest
    name: papercut
    resource_template: http://192.168.1.11:9191/api/health?Authorization=sdafj35sfjkdgj0a34jsdfsdfsf94
    json_attributes:
    - license
    - printers
    value_template: OK
    #scan_interval: 600

## PAPERCUT ##
  - platform: template
    sensors:
      papercut_license_days:
        unique_id: sensor.papercut_license_days
        friendly_name: 'Papercut License Days Remaining'
        value_template: "{{ state_attr('sensor.papercut', 'license')['upgradeAssuranceRemainingDays'] }}
        #value_template: "{{ state_attr('sensor.papercut', 'upgradeAssuranceRemainingDays') }}"    

license:
valid: true
upgradeAssuranceRemainingDays: 205
siteServers:
used: 0
licensed: -1
remaining: -1
devices:
RICOH:
used: 12
licensed: 16
remaining: 4
RICOH_SMARTSDK:
used: 12
licensed: 16
remaining: 4
RICOH_V4:
used: 12
licensed: 16
remaining: 4
packs: []

printers:
inError: []
inErrorCount: 0
inErrorPercentage: 0
count: 19
heldJobCountTotal: 8
heldJobsCountMax: 5
heldJobsCountAverage: 0

friendly_name: papercut

You are missing a double quote at the end of your value template.

1 Like

Hahaha! Simple as that! Thanks @tom_l !