Page 2 of 8

Re: Mercedes Me (Connected Vehicle)

Posted: Wednesday 16 December 2020 19:44
by kiddigital
mbdeveloper wrote:Dear All,
we have solved some issues with the refresh token which should work now smoothly. The token validity will be 30 days.
Best,
Olaf from Mercedes-Benz /developers
Good to hear. Thank you.

Re: Mercedes Me (Connected Vehicle)

Posted: Friday 22 January 2021 13:54
by JimmyH1969
Hi,

I finally updatet my Domoticz so i was able to test it. It worked Yesterday, but now i get:

2021-01-22 13:49:40.866 Status: Mercedes: Executing command: Get All states
2021-01-22 13:49:42.058 Status: Received unhandled HTTP returncode 403 !
2021-01-22 13:49:42.058 Error: Failed to perform GET request (403)!
2021-01-22 13:49:42.058 Error: MercApi: Failed to get data electricvehicle.
2021-01-22 13:49:42.058 Error: Mercedes: Timeout requesting Get All states. Will retry.

And sometimes:
2021-01-22 13:52:02.903 Error: Failed to perform GET request (28)!
2021-01-22 13:52:12.908 Status: Found non-standard resultcode (28) in HTTP response statusline: HTTP/1.1 28 Timeout was reached
2021-01-22 13:52:12.908 Status: Found non-standard resultcode (28) in HTTP response statusline: HTTP/1.1 28 Timeout was reached
2021-01-22 13:52:12.908 Status: Received unhandled HTTP returncode 28 !

Any ideas?

Re: Mercedes Me (Connected Vehicle)

Posted: Friday 22 January 2021 14:06
by kiddigital
403 code means Unauthorized but I would expect that this is detected and the module tries to re-authenticatie.

Code 28 is a Domoticz (actually from the Curl library) internal time-out meaning Domoticz, and in this case the MercedesMe module, did not receive a response to its request to Mercedes.

I have seen those myself as well and looking into ways to deal better with these (too) long response times.

But for the 403; try to disable the module (so the worker stops) and re-enable it. The module will start again by doing the authentication again.

Re: Mercedes Me (Connected Vehicle)

Posted: Saturday 23 January 2021 0:56
by JimmyH1969
Here we go..... (i did change the token a bit ;) )

2021-01-23 00:54:05.988 Status: Mercedes: Worker started...
2021-01-23 00:54:07.003 MercApi: Attempting (re)login (using stored refresh token!).
2021-01-23 00:54:07.097 MercApi: Login credentials Refresh successful.
2021-01-23 00:54:07.097 Status: MercApi: Received new refresh token iq6DsM5hKf70Ba1ZQf5Yg5mvGXZ5oojKuDZvhcCXwN .
2021-01-23 00:54:08.581 Status: Found 25 resource fields: rangeliquid,tanklevelpercent,soc,rangeelectric,readingLampFrontRight,windowstatusfrontright,rooftopstatus,windowstatusfrontleft,sunroofstatus,doorstatusfrontright,doorstatusfrontleft,doorstatusrearright,interiorLightsFront,readingLampFrontLeft,decklidstatus,windowstatusrearright,windowstatusrearleft,lightswitchposition,doorstatusrearleft,interiorLightsRear,doorlockstatusdecklid,doorlockstatusvehicle,doorlockstatusgas,positionHeading,odo
2021-01-23 00:54:08.581 Status: Mercedes: Car awake detection: Car awake
2021-01-23 00:54:10.049 Status: Mercedes: Executing command: Get All states
2021-01-23 00:54:14.751 Status: Received unhandled HTTP returncode 403 !
2021-01-23 00:54:14.751 Error: Failed to perform GET request (403)!
2021-01-23 00:54:14.751 Error: MercApi: Failed to get data electricvehicle.
2021-01-23 00:54:14.751 Error: Mercedes: Timeout requesting Get All states. Will retry.
2021-01-23 00:54:20.141 Status: Mercedes: Executing command: Get All states
2021-01-23 00:54:21.047 Status: Received unhandled HTTP returncode 403 !
2021-01-23 00:54:21.047 Error: Failed to perform GET request (403)!
2021-01-23 00:54:21.047 Error: MercApi: Failed to get data electricvehicle.
2021-01-23 00:54:21.047 Error: Mercedes: Timeout requesting Get All states. Will retry.
2021-01-23 00:54:29.570 Status: Mercedes: Executing command: Get All states
2021-01-23 00:54:31.600 Status: Received unhandled HTTP returncode 403 !
2021-01-23 00:54:31.600 Error: Failed to perform GET request (403)!
2021-01-23 00:54:31.600 Error: MercApi: Failed to get data electricvehicle.
2021-01-23 00:54:31.600 Error: Mercedes: Timeout requesting Get All states. Will retry.

Re: Mercedes Me (Connected Vehicle)

Posted: Saturday 23 January 2021 9:30
by kiddigital
Hm.. typical. The first step confirms that you have a valid user as you are able to login and getting a new token.

But than the following calls fail because you are not authorized.

This could be because you did not receive authorization for all claims.

Which API’s do you have activated in the Mercedes Console? You should have 5 API’s. Also which list of claims did you pass initially to get your token?

Re: Mercedes Me (Connected Vehicle)

Posted: Sunday 24 January 2021 15:25
by kiddigital
JimmyH1969 wrote: Saturday 23 January 2021 0:56 Here we go..... (i did change the token a bit ;) )

2021-01-23 00:54:05.988 Status: Mercedes: Worker started...
2021-01-23 00:54:07.003 MercApi: Attempting (re)login (using stored refresh token!).
2021-01-23 00:54:07.097 MercApi: Login credentials Refresh successful.
2021-01-23 00:54:07.097 Status: MercApi: Received new refresh token iq6DsM5hKf70Ba1ZQf5Yg5mvGXZ5oojKuDZvhcCXwN .
2021-01-23 00:54:08.581 Status: Found 25 resource fields: rangeliquid,tanklevelpercent,soc,rangeelectric,readingLampFrontRight,windowstatusfrontright,rooftopstatus,windowstatusfrontleft,sunroofstatus,doorstatusfrontright,doorstatusfrontleft,doorstatusrearright,interiorLightsFront,readingLampFrontLeft,decklidstatus,windowstatusrearright,windowstatusrearleft,lightswitchposition,doorstatusrearleft,interiorLightsRear,doorlockstatusdecklid,doorlockstatusvehicle,doorlockstatusgas,positionHeading,odo
2021-01-23 00:54:08.581 Status: Mercedes: Car awake detection: Car awake
2021-01-23 00:54:10.049 Status: Mercedes: Executing command: Get All states
2021-01-23 00:54:14.751 Status: Received unhandled HTTP returncode 403 !
2021-01-23 00:54:14.751 Error: Failed to perform GET request (403)!
2021-01-23 00:54:14.751 Error: MercApi: Failed to get data electricvehicle.
2021-01-23 00:54:14.751 Error: Mercedes: Timeout requesting Get All states. Will retry.
...
I have been looking into your issue and I found the same problem. So it is not you :)

It seems that at the moment (24 Jan 2021) the 'Electric Vehicle Status' API always gives an 403 - Access Denied although you have valid credentials. I think a problem at API end at Mercedes (@mbdeveloper , is there a problem?)

Currently looking into ways to handle this better if possible, so a PR might follow.

Hope it gets resolved soon...

Re: Mercedes Me (Connected Vehicle)

Posted: Monday 25 January 2021 13:14
by kiddigital
Created a PR, which has been merged into Development. A prebuild Beta is available, look for build 12888 or higher.

This small update will ensure that in case of a 403 - Access Denied error on one of the API's, even after succesfull Identification and Authorization (meaning you have been granted access to the API as per claim request), the processing of other available data is continued and not aborted anymore.

Re: Mercedes Me (Connected Vehicle)

Posted: Monday 25 January 2021 21:47
by JimmyH1969
Thanks!

I use this on Windows and this Beta 12888 also has another problem. When you click on Settings it crashes Domoticz.
See https://github.com/domoticz/domoticz/issues/4593


This is what i get with the lastets Beta in the status log every minute:

Code: Select all

2021-01-25 21:37:20.517 Status: Mercedes: Waking up car.
2021-01-25 21:37:35.517 Status: Found non-standard resultcode (28) in HTTP response statusline: HTTP/1.1 28 Timeout was reached
2021-01-25 21:37:35.517 Status: Found non-standard resultcode (28) in HTTP response statusline: HTTP/1.1 28 Timeout was reached
2021-01-25 21:37:35.517 Status: Received (Curl) returncode 28.. API request response took too long, timed-out!
2021-01-25 21:37:45.516 Status: Found non-standard resultcode (28) in HTTP response statusline: HTTP/1.1 28 Timeout was reached
2021-01-25 21:37:45.516 Status: Found non-standard resultcode (28) in HTTP response statusline: HTTP/1.1 28 Timeout was reached
2021-01-25 21:37:45.516 Status: Received (Curl) returncode 28.. API request response took too long, timed-out!
2021-01-25 21:37:55.508 Status: Found non-standard resultcode (28) in HTTP response statusline: HTTP/1.1 28 Timeout was reached
2021-01-25 21:37:55.508 Status: Found non-standard resultcode (28) in HTTP response statusline: HTTP/1.1 28 Timeout was reached
2021-01-25 21:37:55.508 Status: Received (Curl) returncode 28.. API request response took too long, timed-out!
2021-01-25 21:38:05.503 Status: Found non-standard resultcode (28) in HTTP response statusline: HTTP/1.1 28 Timeout was reached
2021-01-25 21:38:05.503 Status: Found non-standard resultcode (28) in HTTP response statusline: HTTP/1.1 28 Timeout was reached
2021-01-25 21:38:05.503 Status: Received (Curl) returncode 28.. API request response took too long, timed-out!
2021-01-25 21:38:05.503 Status: Mercedes: Car awake detection: Car asleep
2021-01-25 21:38:05.503 Status: Mercedes: Waking up car.
2021-01-25 21:38:20.505 Status: Found non-standard resultcode (28) in HTTP response statusline: HTTP/1.1 28 Timeout was reached
2021-01-25 21:38:20.505 Status: Found non-standard resultcode (28) in HTTP response statusline: HTTP/1.1 28 Timeout was reached
2021-01-25 21:38:20.505 Status: Received (Curl) returncode 28.. API request response took too long, timed-out!
2021-01-25 21:38:30.511 Status: Found non-standard resultcode (28) in HTTP response statusline: HTTP/1.1 28 Timeout was reached
2021-01-25 21:38:30.511 Status: Found non-standard resultcode (28) in HTTP response statusline: HTTP/1.1 28 Timeout was reached
2021-01-25 21:38:30.511 Status: Received (Curl) returncode 28.. API request response took too long, timed-out!
2021-01-25 21:38:40.509 Status: Found non-standard resultcode (28) in HTTP response statusline: HTTP/1.1 28 Timeout was reached
2021-01-25 21:38:40.509 Status: Found non-standard resultcode (28) in HTTP response statusline: HTTP/1.1 28 Timeout was reached
2021-01-25 21:38:40.509 Status: Received (Curl) returncode 28.. API request response took too long, timed-out!
2021-01-25 21:38:50.507 Status: Found non-standard resultcode (28) in HTTP response statusline: HTTP/1.1 28 Timeout was reached
2021-01-25 21:38:50.507 Status: Found non-standard resultcode (28) in HTTP response statusline: HTTP/1.1 28 Timeout was reached
2021-01-25 21:38:50.507 Status: Received (Curl) returncode 28.. API request response took too long, timed-out!
2021-01-25 21:38:50.507 Status: Mercedes: Car awake detection: Car asleep
And in the Problem log i see:

Code: Select all

2021-01-25 21:33:54.284 Error: Failed to perform GET request (28)!
2021-01-25 21:34:04.301 Error: Failed to perform GET request (28)!
2021-01-25 21:34:14.317 Error: Failed to perform GET request (28)!
2021-01-25 21:34:24.326 Error: Failed to perform GET request (28)!
2021-01-25 21:34:24.326 Error: Failed to get awake state (available resources)!
2021-01-25 21:34:35.341 Error: Failed to perform GET request (28)!
2021-01-25 21:34:45.363 Error: Failed to perform GET request (28)!
2021-01-25 21:34:55.377 Error: Failed to perform GET request (28)!
2021-01-25 21:35:05.386 Error: Failed to perform GET request (28)!
2021-01-25 21:35:05.386 Error: Failed to get awake state (available resources)!
Should it be that busy every minute?

Re: Mercedes Me (Connected Vehicle)

Posted: Monday 25 January 2021 21:54
by kiddigital
Normal interval is every 10 minutes, but you can specify this in the settings (when it works).

But I have the same issues and it seems that there is a problem at Daimler

I have been in contact with them and they said that they are looking into it. (Problem became a little bigger, not only some 403’s on EV but now general gateway time-outs).

Hopefully they fix it soon...

Re: Mercedes Me (Connected Vehicle)

Posted: Monday 25 January 2021 21:56
by JimmyH1969
Great, tnx for the quick reply.. we just have to wait 8-)

Re: Mercedes Me (Connected Vehicle)

Posted: Wednesday 27 January 2021 16:52
by mbdeveloper
Dear all,
sorry, but again we have trouble with some technical issues on a subsequent backend system. It's a new kind of problem.
The team is working on it. We already test some fast bug fixes and hopefully, we can fix it soon.
Best whishes,
Olaf from Mercedes-Benz /developers

Re: Mercedes Me (Connected Vehicle)

Posted: Wednesday 27 January 2021 20:11
by kiddigital
mbdeveloper wrote: Wednesday 27 January 2021 16:52 Dear all,
sorry, but again we have trouble with some technical issues on a subsequent backend system. It's a new kind of problem.
The team is working on it. We already test some fast bug fixes and hopefully, we can fix it soon.
Best whishes,
Olaf from Mercedes-Benz /developers
Thank you for keeping us informed. Appreciated and good luck solving the issues.

Re: Mercedes Me (Connected Vehicle)

Posted: Friday 26 February 2021 15:28
by mbdeveloper
Congrats on what you achieved with the Mercedes-Benz integration.
We really appreciate your engagement.
We would like to promote your solution on our developer portal https://developer.mercedes-benz.com/inspire section.
Are you interested?
If yes, please send us a short notice ([email protected]). I will contact you to further discuss the what, how and when.
Cheers,
Olaf from Mercedes-Benz /developers

Re: Mercedes Me (Connected Vehicle)

Posted: Sunday 28 February 2021 20:23
by kiddigital
mbdeveloper wrote: Friday 26 February 2021 15:28 Congrats on what you achieved with the Mercedes-Benz integration.
We really appreciate your engagement.
We would like to promote your solution on our developer portal https://developer.mercedes-benz.com/inspire section.
Are you interested?
If yes, please send us a short notice ([email protected]). I will contact you to further discuss the what, how and when.
Cheers,
Olaf from Mercedes-Benz /developers
Thank you for your interest and invitation. After discussing this with the core maintainers, I am happy to assist. Already send the notice :)

Re: Mercedes Me (Connected Vehicle)

Posted: Sunday 28 February 2021 20:32
by kiddigital
JimmyH1969 wrote: Monday 25 January 2021 21:56 Great, tnx for the quick reply.. we just have to wait 8-)
Runs smooth for some time now on my side.. How does it perform on your end?

Re: Mercedes Me (Connected Vehicle)

Posted: Sunday 28 February 2021 20:34
by kiddigital
sieth wrote: Monday 31 August 2020 18:42 Ok, so clearly I did something wrong than.

...
Did you get everything up-and-running fine now?

Re: Mercedes Me (Connected Vehicle)

Posted: Thursday 22 April 2021 12:13
by Herre
Hi I've installed the latest stable release (2021.1) and I've added Mercedes Me as Hardware. I've now several new devices added as well as one can expect. In my log I get the following information:
Status: GLA180: Worker started...
Status: GLA180: Received new refresh token 4--------------------------i .
Status: GLA180: Found 25 resource fields: rangeliquid,tanklevelpercent,soc,rangeelectric,readingLampFrontRight,windowstatusfrontright,rooftopstatus,windowstatusfrontleft,sunroofstatus,doorstatusfrontright,doorstatusfrontleft,doorstatusrearright,interiorLightsFront,readingLampFrontLeft,decklidstatus,windowstatusrearright,windowstatusrearleft,lightswitchposition,doorstatusrearleft,interiorLightsRear,doorlockstatusdecklid,doorlockstatusvehicle,doorlockstatusgas,positionHeading,odo
Status: GLA180: Car awake detection: Car awake
Status: GLA180: Executing command: Get All states
Status: GLA180: Received (204) No Content.. likely because of no activity/updates in the last 12 hours!


The last two message Get all states and Received (204) are recurring with the set interval. In my Mercedes app on my phone I have newer data than I have received in the devices in Domoticz. Anyone with the same issues?

Re: Mercedes Me (Connected Vehicle)

Posted: Friday 23 April 2021 7:05
by kiddigital
The BYOcar API’s only provide data when there is ‘new’ data meaning the data has to have been updated in the last 12 hours.

This is a ‘problem’ when you instantiate the Domoticz module and no new data is available. It will generate a few basic devices (but not all) but no data.

Easiest way to test is to drive around the block for a few minutes and open/close all doors, windows, etc.

Make sure you have ‘enable new hardware/sensors’ as the module will try to add new sensor for each reading it can successfully do (if add custom sensors is turned on in the module settings).

Also good to know that the official MercedesMe app uses a different API than the BYOcar API’s and therefore might have other/newer/different data.

This ‘issue’ is something Mercedes said they are working on to ensure that the BYOcar API’s have the same data.

Hope the above clarifies a few things :) Happy driving...

Re: Mercedes Me (Connected Vehicle)

Posted: Friday 23 April 2021 10:00
by Herre
Hi,

Thank you for your response. The data today has been updated. Strange though that my car was used yesterday morning, so the data should have been updated. Nevertheless, even when the information is somewhat outdated it is still nice to have it in my dashboard.

Re: Mercedes Me (Connected Vehicle)

Posted: Thursday 13 May 2021 17:12
by JPY475
Hi,

I have installed the last version of Domoticz 2021.1 on a Raspberry PI and tried to have a connection with my Mercedes, following the explanation in this post.
I have created a project on the site of Mercedes Developper and the 5 BYOCAR products.
I have given the authorization.
I have also created a hardware Mercedes Me Connect in Domoticz with as username [client ID]:[client secret] and as password the token I found in the the title bar of the web page opened after the authorization process.

When I try to connect to Mercedes, I have the following log messages:

2021-05-10 23:08:34.220 Mercedes: Attempting login (using provided Authorization code).
2021-05-10 23:08:34.578 Status: Mercedes: Received 400/401.. During authorisation proces. Aborting!
2021-05-10 23:08:34.578 Error: Mercedes: Failed to get token.
2021-05-10 23:08:34.578 Error: Mercedes: Login unsuccessful!
2021-05-10 23:08:35.578 Mercedes: Attempting login (using provided Authorization code).
2021-05-10 23:08:35.878 Status: Mercedes: Received 400/401.. During authorisation proces. Aborting!
2021-05-10 23:08:35.879 Error: Mercedes: Failed to get token.
2021-05-10 23:08:35.879 Error: Mercedes: Login unsuccessful!
2021-05-10 23:08:36.879 Mercedes: Attempting login (using provided Authorization code).
2021-05-10 23:08:37.260 Status: Mercedes: Received 400/401.. During authorisation proces. Aborting!
2021-05-10 23:08:37.261 Error: Mercedes: Failed to get token.
2021-05-10 23:08:37.261 Error: Mercedes: Login unsuccessful!
2021-05-10 23:08:38.261 Mercedes: Attempting login (using provided Authorization code).
2021-05-10 23:08:38.610 Status: Mercedes: Received 400/401.. During authorisation proces. Aborting!
2021-05-10 23:08:38.610 Error: Mercedes: Failed to get token.
2021-05-10 23:08:38.610 Error: Mercedes: Login unsuccessful!
2021-05-10 23:08:38.610 Error: Mercedes: Aborting due to too many failed authentication attempts (and prevent getting blocked)!

Could you tell me what I did miss?
Thank you