Json to rest or command_line sensor

I have this call, I want to set “completion” and “needItems” as own sensors, or one sensors with these as atributes

But cant find a way to do this with a sensor. I guess rest sensor will be the best.

C:\Users\Flemming>curl -X GET -H "X-API-Key: abcdefg" http://10.0.24.10:8384/rest/db/completion?device=abcabc-abcabc-abcabc
{
  "completion": 100,
  "globalBytes": 3614385890068,
  "globalItems": 601103,
  "needBytes": 0,
  "needDeletes": 0,
  "needItems": 0,
  "remoteState": "unknown",
  "sequence": 0
}

Rest sensor is the way to go.
The payload looks like json so that’s good.
Each field in the Json could be set as an attribute.
Here is the documentation.

Or if you use the rest integration each one can be a sensor and they all get updated from just one call to the resource.

1 Like

I see, but how do I add the API key to the call? cant see any option for that