RESTful sensor and multiple json objects from an array

I have asked this question on reddit also, but got no good answer, so I hope, someone can help me here:
I do have a RESTful sensor hooked up (I’d like to read Pushbullet messages in HA to allow sending specific commands from my phone to the HA instance) and I’d like to parse multiple json properties, but I have some problems. This is my config entry to read the last message in my thread:

- platform: rest
  name: pushbullet_pushes
  method: GET
    Content-Type: application/json
    Access-Token: !secret pushbullet_api
    - pushes[0]['created']
    - pushes[0]['body']
    - pushes[0]['sender_email_normalized']
  value_template: '{{ value_json.pushes[0].created }}'
  scan_interval: 180

Pastebin of the JSON response (I put dummy data placeholders to mask out any personal info)

What I did so far:

  1. my first attempt was to get the whole json string ( value_template: ‘{{ value_json }}’ ) or at least the pushes array ( value_template: ‘{{ value_json.pushes[0] }}’ ) and parse it out in several further template sensors, but I got an error, that a state cannot be longer than 256 characters, so it is not working
  2. I tried using the above (so one single entry as a value template and use the others which I need as json_attributes), which is not working either: it gives back no attributes. I checked in the template editor and these json attribute mappings do get back what I’d want normally
  3. I also tried adding only the whole “pushes” array to the json attribute instead of just nitpicking some sub-keys, in this case I got at least something for the attributes of the sensor, however it was [object Object]
  4. I also tried adding only pushes[0] to the attributes, in this case I got back the first 3 keys inside pushes[0] and could not do anything about receiving the rest
  5. I also tried ssh-ing to my hassio instance (hassio installed manually on a ubuntu server machine) and do a curl call which I could jq, but my hassio instance said the domain could not be resolved, then I did nslookup to get the ip, but for that I got some ssl conflicts (I don’t use https on my instance, since I don’t have it exposed to the internet)

What should I do if I want to extract those 3 keys that I have in this config excerpt? I can’t think of anything other than using separate API calls for each property, but that would mean 4 times more API calls, which would get me rate limited or reaching the limits of the free tier

I also have a semi-related question: can I have a resource_template or similar tag, which I could use to input a timestamp from a sensor state to the url?


actually turned out that the solution #3 which included adding “pushes” to the attributes works fine, although it displays [object Object] as attributes, but a template sensor is able to go into it