Re: Connected Cars
Posted: Friday 06 November 2020 17:35
All the info will perhaps be a lot... Could you tell me in which information you would be interested?
Hi,FireWizard wrote: ↑Friday 23 October 2020 19:26 Hi, @flenaers
Thanks for you post, however I was already aware of this.
See my posted issue at: https://github.com/molobrakos/volvooncall/issues/52 and also
https://github.com/molobrakos/volvoonca ... -392582296
I have already tried several combinations and values, but it did not work
The issue is in the VoC script of molobrakos. However he does not respond, so if you know how to solve it, would be fine.
It is not really an issue, but something nice to have.
Regards
As this API is now available and it is expected, that it will be extended in the future, as all car brands will move towards electrical vehicles. I wonder if this new API fits in the framework of your Tesla plugin.Hi! In the latest stable of Domoticz I have created a (c++) hardware module as native support for EV's (see https://www.domoticz.com/wiki/EVehicles). The module communicates with a car through a standard API interface, and this API can be implemented for various cars. Currently only the Tesla API is implemented, but we could also add Volvo here. It does not provide all sensors you like to have, as i see from the dashboard above, but everything can be extended of course. Is this an idea?
Based on the initial work of @MrHobbes74 I have implemented the 'MercedesMe' module in Domoticz (available in the Beta releases) that uses the ConnectedVehicle framework as used by the Tesla module as well.FireWizard wrote: ↑Tuesday 09 March 2021 11:46 Hello @flenaers
Thanks for your response, even if it is late, but what is late?
For information:
Volvo has made available for the first time in history an Extended Vehicle API, which is Public accessible : https://developer.volvocars.com/volvo-api/
@MrHobbes74
About a year ago you posted in this thread the following question:
As this API is now available and it is expected, that it will be extended in the future, as all car brands will move towards electrical vehicles. I wonder if this new API fits in the framework of your Tesla plugin.Hi! In the latest stable of Domoticz I have created a (c++) hardware module as native support for EV's (see https://www.domoticz.com/wiki/EVehicles). The module communicates with a car through a standard API interface, and this API can be implemented for various cars. Currently only the Tesla API is implemented, but we could also add Volvo here. It does not provide all sensors you like to have, as i see from the dashboard above, but everything can be extended of course. Is this an idea?
As I have seen, it offers currently the same functionality as "Molobrakos'" Python script and some extra data as well. What I miss, compared to the Python script, is to activate certain controls remotely through the API.
Would it be an idea to create a Hardware device in the style of the Tesla hardware, or to create a plug-in?
I'm not a C++ programmer, so it will not be me, but I can test.
Regards
If you have finished it, I can test against a real Volvo,5. Build your application
By using your credentials, you can build and test your application with real data.
After looking at the API documentation it seems that a basic implementation should be doable without to many hurdles (reality will show if I was correct or not).kiddigital wrote: ↑Thursday 11 March 2021 7:08 Not? Was worth a tryGood to read that Volvo provides a virtual Demo car. I will take a look and see if I can give it a try.
Is this true, as I understood that you are able to create your application and when it is finished, then you request the application to be published.But first 'hurdle' is that Volvo does not allow just any application to be created and does not (yet) provide the needed details to perform the OAuth steps. I had to 'create an application' (filling in a form after creating an account) and request the application to get 'published'. Did the request and the answer was that it could take 10-14 days before someone (a person) has handled the request and has decided if or if not the application is allowed. So I have to wait for this process to complete.
Code: Select all
msg.url = 'https://api.volvocars.com/extended-vehicle/v1/vehicles';
return msg;
Code: Select all
for (var i = 0; i < msg.payload.vehicles.length; i++) {
var newMsg = {};
newMsg.url = 'https://api.volvocars.com/extended-vehicle/v1/vehicles/' + msg.payload.vehicles[i].id + '/resources';
node.send(newMsg);
}
return null;
Code: Select all
for (var i = 0; i < msg.payload.resources.length; i++) {
var newMsg = {};
newMsg.url = msg.payload.resources[i].href;
node.send(newMsg);
}
return null;
I tried it as well, but same result.I will try to get the DEMO running and I will let you know what I meet.
RegardsDear Sir/Lady,
Since 3/11/2021, 7:59:01 PM the Volvo Extended Vehicle API has stopped
updating its Demo User Access Token.
So it is no longer possible to test applications with the DEMO "car".
With the own car it works correct, but a timeout of 1 hour is rather limited.
--
With Kind regards,
Code: Select all
[{"id":"74aed579.228d04","type":"subflow","name":"Volvo Extended API","info":"Subflow to provide Headers to HTTP request.\nRequires msg.url as input.","category":"","in":[{"x":120,"y":80,"wires":[{"id":"969e3345.457bf8"}]}],"out":[{"x":600,"y":80,"wires":[{"id":"11de1bbe.5ff6d4","port":0}]}],"env":[],"color":"#DDAA99"},{"id":"11de1bbe.5ff6d4","type":"http request","z":"74aed579.228d04","name":"","method":"GET","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","x":450,"y":80,"wires":[[]]},{"id":"969e3345.457bf8","type":"function","z":"74aed579.228d04","name":"","func":"msg.headers = {};\nmsg.headers['accept'] = 'application/json';\nmsg.headers['vcc-api-key'] = global.get(\"vcc-api-key\");\nmsg.headers['authorization'] = global.get(\"authorization\");\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":260,"y":80,"wires":[["11de1bbe.5ff6d4"]]},{"id":"fc2c4745.3d9bb8","type":"tab","label":"Volvo","disabled":false,"info":""},{"id":"61a810cc.ef33d","type":"inject","z":"fc2c4745.3d9bb8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":160,"wires":[["f9d10275.84991"]]},{"id":"4e2ecc27.ba8874","type":"debug","z":"fc2c4745.3d9bb8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":810,"y":160,"wires":[]},{"id":"f9d10275.84991","type":"function","z":"fc2c4745.3d9bb8","name":"Set URL (Vehicles)","func":"msg.url = 'https://api.volvocars.com/extended-vehicle/v1/vehicles';\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":350,"y":160,"wires":[["2480aadf.fe5f76"]]},{"id":"95d66788.ef6778","type":"comment","z":"fc2c4745.3d9bb8","name":"Get vehicle list","info":"","x":340,"y":120,"wires":[]},{"id":"7c468a1d.85bcb4","type":"comment","z":"fc2c4745.3d9bb8","name":"Get vehicle resources","info":"","x":360,"y":220,"wires":[]},{"id":"ad82eac8.3e8238","type":"debug","z":"fc2c4745.3d9bb8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":810,"y":260,"wires":[]},{"id":"2fd99f41.6339c8","type":"function","z":"fc2c4745.3d9bb8","name":"Set URL (Resources)","func":"for (var i = 0; i < msg.payload.vehicles.length; i++) {\nvar newMsg = {};\nnewMsg.url = 'https://api.volvocars.com/extended-vehicle/v1/vehicles/' + msg.payload.vehicles[i].id + '/resources';\nnode.send(newMsg);\nnode.done();\n}\nreturn null;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":360,"y":260,"wires":[["bd630a81.6df9d"]]},{"id":"bd630a81.6df9d","type":"subflow:74aed579.228d04","z":"fc2c4745.3d9bb8","name":"Vehicle Resources","env":[],"x":590,"y":260,"wires":[["ad82eac8.3e8238","bc7718ad.62a178"]]},{"id":"bc7718ad.62a178","type":"function","z":"fc2c4745.3d9bb8","name":"Set URL (Values)","func":"for (var i = 0; i < msg.payload.resources.length; i++) {\nvar newMsg = {};\nnewMsg.topic = msg.payload.resources[i].name;\nnewMsg.url = msg.payload.resources[i].href;\nnode.send(newMsg);\nnode.done();\n}\nreturn null;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":350,"y":360,"wires":[["19b196f5.08c2d1"]]},{"id":"9c5ab621.5498d8","type":"debug","z":"fc2c4745.3d9bb8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":810,"y":460,"wires":[]},{"id":"19b196f5.08c2d1","type":"subflow:74aed579.228d04","z":"fc2c4745.3d9bb8","name":"Resource Values","env":[],"x":590,"y":360,"wires":[["9c5ab621.5498d8","10b207ce.d086e8"]]},{"id":"2480aadf.fe5f76","type":"subflow:74aed579.228d04","z":"fc2c4745.3d9bb8","name":"Vehicle List","env":[],"x":570,"y":160,"wires":[["4e2ecc27.ba8874","2fd99f41.6339c8"]]},{"id":"abe0e8f9.d4fd2","type":"comment","z":"fc2c4745.3d9bb8","name":"Get resources values","info":"","x":360,"y":320,"wires":[]},{"id":"e1458998.134a1","type":"config","z":"fc2c4745.3d9bb8","name":"Config Domoticz IDX voor Volvo Extended VehicleAPI","properties":[{"p":"IDXaverageFuelConsumption","pt":"flow","to":"1","tot":"num"},{"p":"IDXaverageSpeed","pt":"flow","to":"2","tot":"num"},{"p":"IDXbackupBatteryRemaining","pt":"flow","to":"3","tot":"num"},{"p":"IDXbrakeFluid","pt":"flow","to":"4","tot":"num"},{"p":"IDXcarLocked","pt":"flow","to":"5","tot":"num"},{"p":"IDXdistanceToEmpty","pt":"flow","to":"6","tot":"num"},{"p":"IDXengineCoolantLevel","pt":"flow","to":"7","tot":"num"},{"p":"IDXengineCoolantTemp","pt":"flow","to":"8","tot":"num"},{"p":"IDXengineHoursToService","pt":"flow","to":"9","tot":"num"},{"p":"IDXengineRunning","pt":"flow","to":"10","tot":"num"},{"p":"IDXexternalTemp","pt":"flow","to":"11","tot":"num"},{"p":"IDXfrontLeftDoorOpen","pt":"flow","to":"12","tot":"num"},{"p":"IDXfrontLeftTyrePressure","pt":"flow","to":"13","tot":"num"},{"p":"IDXfrontLeftWindowOpen","pt":"flow","to":"14","tot":"num"},{"p":"IDXfrontRightDoorOpen","pt":"flow","to":"15","tot":"num"},{"p":"IDXfrontRightTyrePressure","pt":"flow","to":"16","tot":"num"},{"p":"IDXfrontRightWindowOpen","pt":"flow","to":"17","tot":"num"},{"p":"IDXfuelAmount","pt":"flow","to":"18","tot":"num"},{"p":"IDXhoodOpen","pt":"flow","to":"19","tot":"num"},{"p":"IDXkmToService","pt":"flow","to":"20","tot":"num"},{"p":"IDXmainBatteryStatus","pt":"flow","to":"21","tot":"num"},{"p":"IDXmonthsToService","pt":"flow","to":"22","tot":"num"},{"p":"IDXodometer","pt":"flow","to":"23","tot":"num"},{"p":"IDXoilLevel","pt":"flow","to":"24","tot":"num"},{"p":"IDXrearLeftDoorOpen","pt":"flow","to":"25","tot":"num"},{"p":"IDXrearLeftTyrePressure","pt":"flow","to":"26","tot":"num"},{"p":"IDXrearLeftWindowOpen","pt":"flow","to":"27","tot":"num"},{"p":"IDXrearRightDoorOpen","pt":"flow","to":"28","tot":"num"},{"p":"IDXrearRightTyrePressure","pt":"flow","to":"29","tot":"num"},{"p":"IDXrearRightWindowOpen","pt":"flow","to":"30","tot":"num"},{"p":"IDXserviceWarningStatus","pt":"flow","to":"31","tot":"num"},{"p":"IDXserviceWarningTrigger","pt":"flow","to":"32","tot":"num"},{"p":"IDXtailGateOpen","pt":"flow","to":"33","tot":"num"},{"p":"IDXtripMeter1","pt":"flow","to":"34","tot":"num"},{"p":"IDXtripMeter2","pt":"flow","to":"35","tot":"num"},{"p":"IDXwasherFluidLevel","pt":"flow","to":"36","tot":"num"},{"p":"IDXoilPressure","pt":"flow","to":"37","tot":"num"},{"p":"IDXbulbFailure","pt":"flow","to":"38","tot":"num"},{"p":"IDXcabOpen","pt":"flow","to":"39","tot":"num"}],"active":true,"x":720,"y":40,"wires":[]},{"id":"10b207ce.d086e8","type":"function","z":"fc2c4745.3d9bb8","name":"Prepare to Domoticz","func":"switch (msg.topic) {\n\n case \"averageSpeed\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.averageSpeed.value};\n break;\n\n case \"averageFuelConsumption\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.averageFuelConsumption.value};\n break;\n\n case \"brakeFluid\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.brakeFluid.value};\n break;\n\n case \"backupBatteryRemaining\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.backupBatteryRemaining.value};\n break;\n\n case \"carLocked\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.carLocked.value};\n break;\n\n case \"distanceToEmpty\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.distanceToEmpty.value};\n break;\n\n case \"engineCoolantLevel\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.engineCoolantLevel.value};\n break;\n\n case \"engineHoursToService\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.engineHoursToService.value};\n break;\n\n case \"engineCoolantTemp\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.engineCoolantTemp.value};\n break;\n\n case \"engineRunning\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.engineRunning.value};\n break;\n\n case \"externalTemp\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.externalTemp.value};\n break;\n\n case \"frontLeftDoorOpen\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.frontLeftDoorOpen.value};\n break;\n\n case \"frontLeftTyrePressure\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.frontLeftTyrePressure.value};\n break;\n\n case \"frontLeftWindowOpen\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.frontLeftWindowOpen.value};\n break;\n\n case \"frontRightDoorOpen\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.frontRightDoorOpen.value};\n break;\n\n case \"frontRightTyrePressure\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.frontRightTyrePressure.value};\n break;\n\n case \"frontRightWindowOpen\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.frontRightWindowOpen.value};\n break;\n\n case \"fuelAmount\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.fuelAmount.value};\n break;\n\n case \"hoodOpen\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.hoodOpen.value};\n break;\n\n case \"kmToService\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.kmToService.value};\n break;\n\n case \"mainBatteryStatus\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.mainBatteryStatus.value};\n break;\n\n case \"monthsToService\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.monthsToService.value};\n break;\n\n case \"odometer\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.odometer.value};\n break;\n\n case \"oilLevel\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.oilLevel.value};\n break;\n\n case \"oilPressure\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.oilPressure.value};\n break;\n\n case \"rearLeftWindowOpen\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.rearLeftWindowOpen.value};\n break;\n\n case \"rearRightDoorOpen\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.rearRightDoorOpen.value};\n break;\n\n case \"rearRightTyrePressure\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.rearRightTyrePressure.value};\n break;\n\n case \"rearLeftDoorOpen\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.rearLeftDoorOpen.value};\n break;\n\n case \"rearLeftTyrePressure\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.rearLeftTyrePressure.value};\n break;\n\n case \"washerFluidLevel\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.washerFluidLevel.value};\n break;\n\n case \"serviceWarningTrigger\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.serviceWarningTrigger.value};\n break;\n\n case \"tripMeter1\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.tripMeter1.value};\n break;\n\n case \"tripMeter2\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.tripMeter2.value};\n break;\n\n case \"serviceWarningStatus\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.serviceWarningStatus.value};\n break;\n\n case \"tailGateOpen\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.tailGateOpen.value};\n break;\n\n case \"rearRightWindowOpen\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.rearRightWindowOpen.value};\n break;\n\n case \"bulbFailure\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.bulbFailure.value};\n break;\n\n case \"cabOpen\":\n msg.payload = {\"command\":\"udevice\",\"idx\":flow.get(\"IDX\" + msg.topic),\"nvalue\":0,\"svalue\":msg.payload.cabOpen.value};\n break;\n\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":840,"y":360,"wires":[["abf0ba6a.04619"]]},{"id":"abf0ba6a.04619","type":"debug","z":"fc2c4745.3d9bb8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1070,"y":420,"wires":[]},{"id":"40715bb7.f232dc","type":"config","z":"fc2c4745.3d9bb8","name":"Config VCC API Key and Volvo Car Access Token","properties":[{"p":"vcc-api-key","pt":"global","to":"","tot":"str"},{"p":"authorization","pt":"global","to":"","tot":"str"}],"active":true,"x":270,"y":40,"wires":[]},{"id":"95d6631b.f1db7","type":"mqtt out","z":"fc2c4745.3d9bb8","name":"To Domoticz","topic":"domoticz/in","qos":"2","retain":"false","broker":"f9f13036.e28b58","x":1070,"y":360,"wires":[]},{"id":"8b47d185.2d8ad","type":"comment","z":"fc2c4745.3d9bb8","name":"Enable to read VIN","info":"","x":830,"y":120,"wires":[]},{"id":"13e36eda.378481","type":"comment","z":"fc2c4745.3d9bb8","name":"Enable to read Resources","info":"","x":850,"y":220,"wires":[]},{"id":"2601a3ab.cc1514","type":"comment","z":"fc2c4745.3d9bb8","name":"Enable to read Values","info":"","x":840,"y":420,"wires":[]},{"id":"f9f13036.e28b58","type":"mqtt-broker","name":"localhost","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
Code: Select all
[{"id":"74aed579.228d04","type":"subflow","name":"Volvo Extended API","info":"Subflow to provide Headers to HTTP request.\nRequires msg.url as input.","category":"","in":[{"x":120,"y":80,"wires":[{"id":"969e3345.457bf8"}]}],"out":[{"x":600,"y":80,"wires":[{"id":"11de1bbe.5ff6d4","port":0}]}],"env":[],"color":"#DDAA99"},{"id":"11de1bbe.5ff6d4","type":"http request","z":"74aed579.228d04","name":"","method":"GET","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","x":450,"y":80,"wires":[[]]},{"id":"969e3345.457bf8","type":"function","z":"74aed579.228d04","name":"","func":"msg.headers = {};\nmsg.headers['accept'] = 'application/json';\nmsg.headers['vcc-api-key'] = global.get(\"vcc-api-key\");\nmsg.headers['authorization'] = global.get(\"authorization\");\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":260,"y":80,"wires":[["11de1bbe.5ff6d4"]]}]
Code: Select all
msg.headers = {};
msg.headers['accept'] = 'application/json';
msg.headers['vcc-api-key'] = global.get("vcc-api-key");
msg.headers['authorization'] = global.get("authorization");
return msg;
Code: Select all
for (var i = 0; i < msg.payload.resources.length; i++) {
var newMsg = {};
newMsg.topic = msg.payload.resources[i].name;
newMsg.url = msg.payload.resources[i].href;
node.send(newMsg);
node.done();
}
return null;
I have been starting this thread more than 2 years ago, as, at that, time there was nothing about "connected" cars.Maybe create a separate ‘Volvo on Call API’ forum thread to continue?
Hi Filip,