Example how to get the state of charge (and maybe other useful information) for your car using the Tronity API*. The API is available for paid customers only (tronity.io).
-
-
Save svenblum/8cbe02c96bd96d095f8cd4a790716487 to your computer and use it in GitHub Desktop.
Tronity - get SOC for your BEV from their API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id": "3f3f5aae.72acee", | |
"type": "tab", | |
"label": "Tronity", | |
"disabled": false, | |
"info": "" | |
}, | |
{ | |
"id": "60b00bb6.c7d104", | |
"type": "http request", | |
"z": "3f3f5aae.72acee", | |
"name": "", | |
"method": "GET", | |
"ret": "obj", | |
"paytoqs": "ignore", | |
"url": "https://api-eu.TRONITY.io/v1/vehicles/dieNummerVomAuto/bulk", | |
"tls": "", | |
"persist": false, | |
"proxy": "", | |
"authType": "", | |
"x": 670, | |
"y": 300, | |
"wires": [ | |
[ | |
"e1264f92.4b7f4", | |
"a6e605ae.1e255", | |
"5009da1b.247ab4" | |
] | |
] | |
}, | |
{ | |
"id": "e1264f92.4b7f4", | |
"type": "debug", | |
"z": "3f3f5aae.72acee", | |
"name": "", | |
"active": true, | |
"tosidebar": true, | |
"console": false, | |
"tostatus": false, | |
"complete": "true", | |
"targetType": "full", | |
"statusVal": "", | |
"statusType": "auto", | |
"x": 850, | |
"y": 240, | |
"wires": [] | |
}, | |
{ | |
"id": "7d530788.01291", | |
"type": "http request", | |
"z": "3f3f5aae.72acee", | |
"name": "", | |
"method": "POST", | |
"ret": "obj", | |
"paytoqs": "query", | |
"url": "https://api-eu.TRONITY.io/oauth/authentication", | |
"tls": "", | |
"persist": false, | |
"proxy": "", | |
"authType": "", | |
"x": 550, | |
"y": 180, | |
"wires": [ | |
[ | |
"1cc29f2a.b43be1" | |
] | |
] | |
}, | |
{ | |
"id": "b34d9e97.3816a", | |
"type": "inject", | |
"z": "3f3f5aae.72acee", | |
"name": "15 minutes", | |
"props": [ | |
{ | |
"p": "payload" | |
}, | |
{ | |
"p": "topic", | |
"vt": "str" | |
} | |
], | |
"repeat": "900", | |
"crontab": "", | |
"once": false, | |
"onceDelay": 0.1, | |
"topic": "", | |
"payload": "", | |
"payloadType": "date", | |
"x": 150, | |
"y": 180, | |
"wires": [ | |
[ | |
"18f329a5.5f6e7e" | |
] | |
] | |
}, | |
{ | |
"id": "18f329a5.5f6e7e", | |
"type": "change", | |
"z": "3f3f5aae.72acee", | |
"name": "", | |
"rules": [ | |
{ | |
"t": "set", | |
"p": "payload", | |
"pt": "msg", | |
"to": "{\"client_id\":\"die ID\",\"client_secret\":\"das Passwort\",\"grant_type\":\"app\"}", | |
"tot": "json" | |
} | |
], | |
"action": "", | |
"property": "", | |
"from": "", | |
"to": "", | |
"reg": false, | |
"x": 350, | |
"y": 180, | |
"wires": [ | |
[ | |
"7d530788.01291" | |
] | |
] | |
}, | |
{ | |
"id": "ced764e7.359328", | |
"type": "comment", | |
"z": "3f3f5aae.72acee", | |
"name": "Get car info", | |
"info": "", | |
"x": 130, | |
"y": 260, | |
"wires": [] | |
}, | |
{ | |
"id": "d6859fce.3159", | |
"type": "comment", | |
"z": "3f3f5aae.72acee", | |
"name": "Get new token every 15 minutes", | |
"info": "", | |
"x": 190, | |
"y": 140, | |
"wires": [] | |
}, | |
{ | |
"id": "1cc29f2a.b43be1", | |
"type": "change", | |
"z": "3f3f5aae.72acee", | |
"name": "", | |
"rules": [ | |
{ | |
"t": "set", | |
"p": "tronitybearer", | |
"pt": "flow", | |
"to": "payload.access_token", | |
"tot": "msg" | |
} | |
], | |
"action": "", | |
"property": "", | |
"from": "", | |
"to": "", | |
"reg": false, | |
"x": 770, | |
"y": 180, | |
"wires": [ | |
[] | |
] | |
}, | |
{ | |
"id": "c41b108d.772ae", | |
"type": "function", | |
"z": "3f3f5aae.72acee", | |
"name": "set headers with JWT Bearer Token", | |
"func": "let token = flow.get('tronitybearer');\n\nmsg.headers = {\n 'Authorization': 'Bearer ' + token\n};\n\nreturn msg;", | |
"outputs": 1, | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 400, | |
"y": 300, | |
"wires": [ | |
[ | |
"60b00bb6.c7d104" | |
] | |
] | |
}, | |
{ | |
"id": "64090349.cc9f3c", | |
"type": "inject", | |
"z": "3f3f5aae.72acee", | |
"name": "3 minutes", | |
"props": [ | |
{ | |
"p": "payload" | |
}, | |
{ | |
"p": "topic", | |
"vt": "str" | |
} | |
], | |
"repeat": "180", | |
"crontab": "", | |
"once": false, | |
"onceDelay": 0.1, | |
"topic": "", | |
"payload": "", | |
"payloadType": "date", | |
"x": 150, | |
"y": 300, | |
"wires": [ | |
[ | |
"c41b108d.772ae" | |
] | |
] | |
}, | |
{ | |
"id": "a6e605ae.1e255", | |
"type": "change", | |
"z": "3f3f5aae.72acee", | |
"name": "", | |
"rules": [ | |
{ | |
"t": "set", | |
"p": "payload", | |
"pt": "msg", | |
"to": "payload.level", | |
"tot": "msg" | |
} | |
], | |
"action": "", | |
"property": "", | |
"from": "", | |
"to": "", | |
"reg": false, | |
"x": 890, | |
"y": 300, | |
"wires": [ | |
[ | |
"82cd1c8a.ac5c5" | |
] | |
] | |
}, | |
{ | |
"id": "82cd1c8a.ac5c5", | |
"type": "debug", | |
"z": "3f3f5aae.72acee", | |
"name": "SOC", | |
"active": true, | |
"tosidebar": false, | |
"console": false, | |
"tostatus": true, | |
"complete": "payload", | |
"targetType": "msg", | |
"statusVal": "soc", | |
"statusType": "auto", | |
"x": 1070, | |
"y": 300, | |
"wires": [] | |
}, | |
{ | |
"id": "5009da1b.247ab4", | |
"type": "change", | |
"z": "3f3f5aae.72acee", | |
"name": "", | |
"rules": [ | |
{ | |
"t": "set", | |
"p": "payload", | |
"pt": "msg", | |
"to": "payload.charging", | |
"tot": "msg" | |
} | |
], | |
"action": "", | |
"property": "", | |
"from": "", | |
"to": "", | |
"reg": false, | |
"x": 890, | |
"y": 360, | |
"wires": [ | |
[ | |
"da987961.161518" | |
] | |
] | |
}, | |
{ | |
"id": "da987961.161518", | |
"type": "debug", | |
"z": "3f3f5aae.72acee", | |
"name": "Ladestatus", | |
"active": true, | |
"tosidebar": true, | |
"console": false, | |
"tostatus": true, | |
"complete": "payload", | |
"targetType": "msg", | |
"statusVal": "soc", | |
"statusType": "auto", | |
"x": 1090, | |
"y": 360, | |
"wires": [] | |
}, | |
{ | |
"id": "c82a10b6.b67cc", | |
"type": "comment", | |
"z": "3f3f5aae.72acee", | |
"name": "Info (click me)", | |
"info": "1) Login here: https://app.platform.tronity.io/\n(same credentials as in the app)\n\n2) Open the existing app. Needed are 3 things:\n- ID \n- Password (regenerate a new one to show it)\n- Number of your car\n\n3) Enter ID and password in the payload from token\n4) Enter the number of your car in http-request", | |
"x": 130, | |
"y": 60, | |
"wires": [] | |
} | |
] |
Du musst dich bei Tronity auf der API-Plattform anmelden (gleiche Zugangsdaten). Dort findest du die gesuchte Info.
https://app.platform.tronity.io/
Viel Erfolg
Sven
Hi Sven
Danke für die schnelle Info.
Client Id und Client Secret habe ich gefunden.
Aber mit der Nummer vom Fahrzeug komm ich nicht weiter.
Habe sowohl VIN als auch die Vehicle ID im http request eingegeben.
Bei mir schaut das dann so aus (mit der ID aus Tronity)
https://api-eu.TRONITY.io/v1/vehicles/ <https://api-eu.TRONITY.io/v1/vehicles/61ec0ebe03fce9001a2e383a/bulk> 61ec0ebe03fce9001a2e383a/bulk
Kriege dann folgende Fehlermeldung:
Hast du noch eine Idee?
VG
Klemens
Von: svenblum ***@***.***>
Gesendet: Samstag, 5. Februar 2022 14:27
An: svenblum ***@***.***>
Cc: klemensatgithub ***@***.***>; Mention ***@***.***>
Betreff: Re: svenblum/README.md
@svenblum commented on this gist.
…_____
Hi @klemensatgithub <https://github.com/klemensatgithub>
Du musst dich bei Tronity auf der API-Plattform anmelden (gleiche Zugangsdaten). Dort findest du die gesuchte Info.
https://app.platform.tronity.io/
Viel Erfolg
Sven
—
Reply to this email directly, view it on GitHub <https://gist.github.com/8cbe02c96bd96d095f8cd4a790716487#gistcomment-4054505> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AXT5JHCKPHCLBTYI4MOHOALUZUQRLANCNFSM5NT5JGBA> .
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub> .
You are receiving this because you were mentioned. <https://github.com/notifications/beacon/AXT5JHFT6F2TUGG24NSZRNLUZUQRLA5CNFSM5NT5JGBKYY3PNVWWK3TUL52HS4DFVNDWS43UINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAHXO6S.gif> Message ID: ***@***.*** ***@***.***> >
Du musst einfach die folgenden 3 Dinge ersetzen
-Client-ID & Client-Secret (stehen links) im ersten set-payload da im Json-Script (kleine 3 Punkte klicken)
- und die Nummer vom Auto (steht rechts) im 2ten http-request. Der müsste bei dir dann so aussehen:
https://api-eu.TRONITY.io/v1/vehicles/61ec0ebe03fce9001a2e383a/bulk
Viel Glück
Sven
Hmhmhm, genau das habe ich gemacht, funktioniert aber nicht …..
Trotzdem danke, wäre zu schön gewesen den Skoda auch noch in der Home Automation zu haben….
VG
Klemens
Von: svenblum ***@***.***>
Gesendet: Samstag, 5. Februar 2022 14:56
An: svenblum ***@***.***>
Cc: klemensatgithub ***@***.***>; Mention ***@***.***>
Betreff: Re: svenblum/README.md
@svenblum commented on this gist.
…_____
Du musst einfach die folgenden 3 Dinge ersetzen
-Client-ID & Client-Secret (stehen links) im ersten set-payload da im Json-Script (kleine 3 Punkte klicken)
* und die Nummer vom Auto (steht rechts) im 2ten http-request. Der müsste bei dir dann so aussehen:
https://api-eu.TRONITY.io/v1/vehicles/61ec0ebe03fce9001a2e383a/bulk
Viel Glück
Sven
—
Reply to this email directly, view it on GitHub <https://gist.github.com/8cbe02c96bd96d095f8cd4a790716487#gistcomment-4054528> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AXT5JHHFZ7DKDE77KWRHVALUZUT7PANCNFSM5NT5JGBA> .
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub> .
You are receiving this because you were mentioned. <https://github.com/notifications/beacon/AXT5JHAZJB6OFPHBVUJ2UXDUZUT7PA5CNFSM5NT5JGBKYY3PNVWWK3TUL52HS4DFVNDWS43UINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAHXPAA.gif> Message ID: ***@***.*** ***@***.***> >
Den Skoda kriegst du über die VW-Schnittstelle viel besser direkt. Da musst du den Umweg über Tronity nicht machen. Kuck mal hier: https://flows.nodered.org/node/node-red-contrib-volkswagen-we
Hallo Sven,
guter Tipp! Die VW Node nimmt zwar meinen Skoda nicht, aber es gibt auch ein Skoda Connect Node. Kriege hier auch Daten zurückgespielt. So jetzt muss ich „nur“ noch mit dem payload basteln…. untere battery stehen ja die Werte 233km/64%, dann könnte es gehen.
VG
Klemens
Von: svenblum ***@***.***>
Gesendet: Samstag, 5. Februar 2022 15:18
An: svenblum ***@***.***>
Cc: klemensatgithub ***@***.***>; Mention ***@***.***>
Betreff: Re: svenblum/README.md
@svenblum commented on this gist.
…_____
Den Skoda kriegst du über die VW-Schnittstelle viel besser direkt. Da musst du den Umweg über Tronity nicht machen. Kuck mal hier: https://flows.nodered.org/node/node-red-contrib-volkswagen-we
—
Reply to this email directly, view it on GitHub <https://gist.github.com/8cbe02c96bd96d095f8cd4a790716487#gistcomment-4054540> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AXT5JHHQE7NSGHGBRP46GFTUZUWQRANCNFSM5NT5JGBA> .
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub> .
You are receiving this because you were mentioned. <https://github.com/notifications/beacon/AXT5JHERQMKAWJXPSOFGGTTUZUWQRA5CNFSM5NT5JGBKYY3PNVWWK3TUL52HS4DFVNDWS43UINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAHXPAY.gif> Message ID: ***@***.*** ***@***.***> >
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi
was ist mit "NummervomAuto" gemeint? VIN? ID in Tronity? oder laufende Nummer der Fahrzeuge?
Kriegt das nicht zum laufen
VG
Klemens