Not sure here. Maybe lock status is considered sensitive in Italy
Maybe try the fuel or vehicle status APIās?
Not sure here. Maybe lock status is considered sensitive in Italy
Maybe try the fuel or vehicle status APIās?
same error for all.
Iāve tried also to modify somethingā¦ but no luckā¦
this is my script: https://github.com/xraver/mercedes_me_apiā¦
That is a great script. Far more elegant than my attempt
Unfortunately I donāt think youāll get this working in Italy. See supported markets in this page:
yup still working for me. Although, I can already imagine my future post announcing it stopped working. Hope Iām wrong.
Hi Rene,
which proto file do i need to use (descriptor.proto, type.proto)?
Can you maybe share your coding?
BR
Sebastian
Today it starts to work also in Italy!!!
Dear.
after some experiments with new APIs I have a question.
Iām able to retrive the list of resources available. but retriving many of them I get 402 error (No Data). From documentatiom: āIf the vehicle did not send an update for a resource within 12 hours, the response will be emptyā. Do you have the same behaviour?
in any case I always receive empty message for fuel levelā¦
thanks
The original component will be fixed with this new API?
Yes, I have the exact same problemā¦I often get the 402 no data errorā¦ to troubleshoot I went and started the car and then turned off the car again and locked itā¦ the 402 went awayā¦(for a few days)ā¦ I cant be sure if my ādrivingā the car fixed it or if it was pure coincidence.
One problem that I am having often, my node red refesh token seems to work, and I all of a sudden get permission errorsā¦ then I have to go through the whole ordeal of getting a new tokenā¦ not sure if I am doing something wrongā¦ but this oAuth stuff is a pain in the butt.
I too had 402 errors today, driving my car fixed it. I think after a while it goes into a deep sleep mode and stops updating the server with data.
Iām working on a modified version of @kilters excellent NodeRed script to try and make getting the initial OAuth a little easier (saves having to use a REST client) and to allow checking of more data points - will post shortly
Sounds great! I had issue getting the syntax right for the auth code. I tried it in a function node and through a http node to no avail. Kept throwing a invalid code error.
Just to confirm I donāt think the BYO Car API feeds a historical database on the back end so if you donāt use your car for a while you wonāt get much data. Similarly I find that if I have not used a particular window in a few days, it doesnt appear in the data.
Iām hoping the connected vehicle API comes out of experimental status soon and that we can use it for our own car.
I had issues with the initial code for a while too! Kept getting āgrant type invalidā errors. All ended up being a formatting issue.
I donāt have the custom component installed so instead have fed the data into MQTT sensors. Basically if one of the sensors returns anything other than a 200 OK response it wonāt update the sensor, allowing for sensor data persistence in home assistant.
Speaking of data persistence - I tweaked the refresh code loop to allow persistent storage of the refresh token (otherwise if nodered stops then you need to redo everything). It just requires the persistent storage tweak to settings.js.
Will post once I get in front of my laptop!
Iām progressing with my script. now iāve moved into a python code and iām trying to integrate it inside home assistant. unfortunately iāve not a lot of time to work on itā¦ but iāll try to do all my best. In the standalone python script iāve create a temporary file to cllect the status of all resourcesā¦ Iāll update the status only if the value is different from 200. in this way iāve created an local historyā¦
Hereās my updated version of @kilters script - keen to hear how people get on with it. Instructions are included in the flow.
Iām primarily interested in the electric range and the SOC of my C 300de, SOC also can be used to predict how long the charging will take (remaining time).
I have modified the flow accordingly and it is running without problems for a week now.
Many thanks to you @ajoyce
Dear Holger,
Looks great!!!
Can you maybe plase share how you have done it? Which steps are necessary?
Many thanks!
Hi
I know alot have created their own solution and āwork aroundsā for getting data from the api, but i thought i would also post my solution.
Possible to get the data to MQTT and it also publishes a little api to get the data into fx. nodered
Really nice way of collecting the dataā¦
A few small notes:
ā¦ will leave the container running and collect the data for a while and see what I can do with it.
woops about the topic.
Fixed it now and it also includes the VIN
do a docker pull and you should be good to go
Well, use the nodered flow ajoyce provided above.
Change the scope in the initial code request URL to scope=mb:vehicle:mbdata:evstatus.
Subscribe to the API
Then query
https://api.mercedes-benz.com/vehicledata/v2/vehicles/{{payload.vin}}/resources/soc
https://api.mercedes-benz.com/vehicledata/v2/vehicles/{{payload.vin}}/resources/rangeelectric
and publish values to MQTT.
In HA, set up two MQTT sensors for soc and rangeelectric and display them.
Regarding the remaining time this is a simple calculation in a function node. I estimate 1% charge takes 200 seconds at 10A.
var charge = msg.payload.soc.value;
var remaining = 100 - charge;
if(remaining == 0) {
msg.payload = "--";
return msg;
}
var seconds = 200 * remaining;
var hours = Math.floor(seconds / 3600);
seconds = seconds - (3600 * hours);
var minutes = Math.floor((seconds+59)/60);
if(hours == 0) {
msg.payload = minutes + " Minuten";
}
else {
msg.payload = hours + " Stunden " + minutes + " Minuten";
}
return msg;
Charging power and temperature (in the plug) is measured by a switchable Shelly Plug S which is plugged into the wall socket. I assume when the wall socket ever gets too hot, the Shelly Plug S will detect this indirectly and switch off (overtemperature protection).