Read your Tesla's State of Charge into Node-RED via the official Tesla Fleet API — read-only, your own developer app, no paid third-party service, never wakes the car.
A Tesla account and about 10 minutes. Everything else happens by clicking — there is no terminal involved.
In Node-RED, drop in a Tesla single metric node and open its config. Under Onboarding click Generate key pair, then Copy public key. (The private key is not used for read-only — you can download it as a backup or forget it.)
Go to fleetkey.cc, paste your public
key, and it gives you a domain like xxxxx.fleetkey.net. Tesla will read your key from there.
Copy that domain and save it in a notepad for the next steps — you'll need it in two places.
Go to developer.tesla.com, sign in, and create a Fleet API Application. The wizard has four steps:
Choose grant type “Authorization Code and Machine-to-Machine”, then fill the three URL fields (this is where people get stuck, so here is exactly what goes where):
| Field in the Tesla form | What to enter |
|---|---|
| Allowed Origin URL(s) | Your fleetkey domain from step 2:https://xxxxx.fleetkey.net(the domain hosting your public key) |
| Allowed Redirect URI(s) | https://teslametrics.github.io/node-red-contrib-tesla-fleet-api/callback.html(where Tesla returns the login code) |
| Allowed Returned URL(s) (optional) | Leave empty. |
Tick only what read-only needs:
Click Skip and Submit. No card needed; Tesla includes a free monthly Fleet API credit and a 15-minute poll stays well within it.
After approval (usually quick, sometimes a few days) you get a Client ID and Client Secret.
Back in the node's config, fill in Key Domain (your fleetkey domain), Client Secret and the Redirect URI (the callback URL above). Then:
vehicle_location scope. Leave it
ticked whenever you need location; those metrics are marked "(needs location)" in the pickers.This registers your app with Tesla and stores a refresh token in the node.
Click Done, then Deploy. The node now polls your State of Charge. Its badge shows e.g.
online 48%; msg.payload carries the battery level.
After onboarding, drop one of two metric nodes onto your flow:
battery_level) and emits its
value on msg.payload. Choose the payload format (naked = value only,
named = { key: value }, or value = { "value": … }) and
whether to emit on every refresh or only on change.{ key: value, … } on msg.payload.Wire either node to a Debug node and click Deploy. All metric nodes share the config's
single refresh poll, so adding more nodes does not cause extra Tesla API calls. When the car is
asleep or offline, the node emits the last-known value with msg.stale = true and
never wakes the car.
If your Tesla account has more than one car, each node has a Vehicle picker (it appears after you pair the account and Deploy the config). On a single-car account it auto-selects your only car. The config only polls the cars a node actually reads.
Reading runs on your own Tesla developer app, so your data goes straight from Tesla to your Node-RED — nothing passes through us or fleetkey (which only hosts a public key). Tesla gives each account a free monthly Fleet API credit; a 15-minute poll stays well within it, and the node never wakes the car.