Retrieve the current state of a battery device including charge level, status, and capacity
cURL
curl --request GET \ --url https://api.example.com/battery/{deviceId} \ --header 'x-api-key: <api-key>'
{ "id": "<string>", "vendor": "<string>", "sync": { "available": true, "lastPulledAt": "<string>" }, "metadata": { "model": "<string>", "source": "cache", "cacheType": "expedite" }, "state": { "status": "charging", "capacity": 123, "level": 50, "chargeRate": 123, "dischargeLimit": 123 }, "features": { "pull": [ { "key": "<string>", "min": 123, "max": 123 } ], "push": [ { "key": "<string>", "min": 123, "max": 123 } ] } }
The unique identifier for the battery device
"device_abc123"
Use expedite cache with 1 minute TTL instead of normal 15 minute TTL
false
Battery state retrieved successfully
Show child attributes