Mercedes Me (Connected Vehicle)

Others (MiLight, Hue, Toon etc...)

Moderator: leecollings

User avatar
kiddigital
Posts: 435
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Mercedes Me (Connected Vehicle)

Post by kiddigital »

Remember that the authorization code that you received (in the browser) is only valid for a short period of time (an hour if I remember correctly, have to look it up).

So you might have to get a new auth code and fill it in within Domoticz and try again. (Disable and enable hardware module again).

The way you describe things, it seems that you did the steps correctly.

You could try to start Domoticz with some debug flags (command line) to see if some more details are shown.
(Unfortunately I am not near a good working internet connection, so unable at the moment to look at things in detail).
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
mbdeveloper
Posts: 9
Joined: Tuesday 08 September 2020 9:30
Target OS: Linux
Domoticz version:
Location: Germany
Contact:

Re: Mercedes Me (Connected Vehicle)

Post by mbdeveloper »

Hi JP, Hi Domoticz community,
prior to using the connected car products (BYOCAR) you need to enable your Mercedes me account accordingly. You need the product "Vehicle Setup" and within this product the "Remote Retrieval" service needs to be activated. And both the Mercedes me account (email) and the Mercedes-Benz /developers account must match 1:1.
I am not sure if this relates to this authorization issue. But I think it's worth to point this out.
Regards,
Olaf from Mercedes-Benz /developers
Mercedes-Benz /developers team
contact: [email protected]
honeywell
Posts: 1
Joined: Wednesday 20 November 2019 14:58
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11652
Contact:

Re: Mercedes Me (Connected Vehicle)

Post by honeywell »

Dear,
Where exactly can I see I have the product 'Vehicle setup ' and where do I activate the 'Remote retrieval'?
Br,D
User avatar
kiddigital
Posts: 435
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Mercedes Me (Connected Vehicle)

Post by kiddigital »

honeywell wrote: Wednesday 19 May 2021 21:06 Dear,
Where exactly can I see I have the product 'Vehicle setup ' and where do I activate the 'Remote retrieval'?
Br,D
You need to register yourself at the 'Mercedes Me' portal (which you probaly have done already) and make sure that your car is 'registered' to your account.

Within the 'car setting', there a (30+) services you can (de)activate and under the Comfort section their should be a service for 'remote vehicle data retrieval'. This one has to be active so data from the car can be retrieved at all.

The BYOCAR api's can than use this retrieved data as the input for the functionality of these API's.

Do you have the 'Mercedes Me' app (iOS, Android) installed on your phone/tablet? And does it show data?

As mentioned, you have to make sure that you use the same 'ID' (e-mailaddress + pass) to register as a Developer at mercedes, so the Developer functions (like BYOCAR) can be 'connected' to your Mercedes Me account and data.
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
mbdeveloper
Posts: 9
Joined: Tuesday 08 September 2020 9:30
Target OS: Linux
Domoticz version:
Location: Germany
Contact:

Re: Mercedes Me (Connected Vehicle)

Post by mbdeveloper »

Dear All,
we have provided a Postman Collection for BYOCAR https://www.postman.com/mbdevelopers/wo ... umentation.
Feel free to use it. We think it might also help you in identifying potential issues in your local implementation.
Regards,
Olaf from Mercedes-Benz /developers
Mercedes-Benz /developers team
contact: [email protected]
User avatar
kiddigital
Posts: 435
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Mercedes Me (Connected Vehicle)

Post by kiddigital »

JPY475 wrote: Thursday 13 May 2021 17:12 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.
...
Could you tell me what I did miss?
Thank you
Just wondering if you have been able to get everything working as it should? Let us know :)
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
User avatar
kiddigital
Posts: 435
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Mercedes Me (Connected Vehicle)

Post by kiddigital »

honeywell wrote: Wednesday 19 May 2021 21:06 Dear,
Where exactly can I see I have the product 'Vehicle setup ' and where do I activate the 'Remote retrieval'?
Br,D
And? Everything up and running now?
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
JPY475
Posts: 2
Joined: Wednesday 12 May 2021 13:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Mercedes Me (Connected Vehicle)

Post by JPY475 »

Hi,

Thank you for your help

I prepared another Raspberry with the last image of OS and Domoticz.
I could get a connection with my car but I lost it after 1 day.
I will try further.

Maybe one question: How can I define my Home position?


Regards
User avatar
kiddigital
Posts: 435
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Mercedes Me (Connected Vehicle)

Post by kiddigital »

JPY475 wrote:Hi,

Thank you for your help

I prepared another Raspberry with the last image of OS and Domoticz.
I could get a connection with my car but I lost it after 1 day.
I will try further.

Maybe one question: How can I define my Home position?


Regards
Great to hear it works (partly).

When you keep it running, the authorization tokens get refreshed automatically.

But if it is not connected for a longer period (I think more that 24 hours), you probably have to generate a new access token (login in via the browser) and put that token into Domoticz.

Way easier to just keep it running Image

The Home position is the Home position of Domoticz (settings screen).

But at the moment, the BYOcar API’s do not provide any location information so nothing is done with it. The car will always be ‘at home’ even when it isn’t. The reason it is there is because for other cars like Tesla a location is available and the MercedesMe integration on Domoticz shares a lot of code/functionality with other Domoticz car modules.
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
marcowork
Posts: 7
Joined: Wednesday 28 November 2018 12:55
Target OS: Linux
Domoticz version:
Contact:

Re: Mercedes Me (Connected Vehicle)

Post by marcowork »

dear team,

great initiative. I would like to add this to my domoticz environement however, I get this login error:

Code: Select all



2021-06-28 15:25:55.904 MercedesC220D: Attempting login (using provided Authorization code).
2021-06-28 15:25:56.162 Status: MercedesC220D: Received 400/401.. During authorisation proces. Aborting!
2021-06-28 15:25:56.162 Error: MercedesC220D: Failed to get token.
2021-06-28 15:25:56.162 Error: MercedesC220D: Login unsuccessful!
2021-06-28 15:25:56.162 Error: MercedesC220D: Aborting due to too many failed authentication attempts (and prevent getting blocked)!

I tested my username and password on the mercedes me site and they work. So I do not understand why I cannot login with the same credentials

I also checked the Vehicle setup: All service are enabled and valid to somewhere in 2022 or indefinite. So why doesn't it work.
I only have an mercedes me account and no developer account. Can this be it?
User avatar
kiddigital
Posts: 435
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Mercedes Me (Connected Vehicle)

Post by kiddigital »

marcowork wrote:dear team,

great initiative. I would like to add this to my domoticz environement however, I get this login error:

Code: Select all



2021-06-28 15:25:55.904 MercedesC220D: Attempting login (using provided Authorization code).
2021-06-28 15:25:56.162 Status: MercedesC220D: Received 400/401.. During authorisation proces. Aborting!
2021-06-28 15:25:56.162 Error: MercedesC220D: Failed to get token.
2021-06-28 15:25:56.162 Error: MercedesC220D: Login unsuccessful!
2021-06-28 15:25:56.162 Error: MercedesC220D: Aborting due to too many failed authentication attempts (and prevent getting blocked)!

I tested my username and password on the mercedes me site and they work. So I do not understand why I cannot login with the same credentials

I also checked the Vehicle setup: All service are enabled and valid to somewhere in 2022 or indefinite. So why doesn't it work.
I only have an mercedes me account and no developer account. Can this be it?
Hi @marcowork,

Where you able to follow the steps as described in the first posts of this topic?

Make sure you have all API’s activated.

Then use the login url (see start posts) to get your access code that should be entered within Domoticz.

And make sure that ‘enable new hardware’ is on for at least 2 hours as it takes a while before all available data is put into custom sensors (when enabled).

Let us know if you get it running…
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
User avatar
kiddigital
Posts: 435
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Mercedes Me (Connected Vehicle)

Post by kiddigital »

@marcowork,

Did you get it running :) ?
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
User avatar
rolandbreedveld
Posts: 156
Joined: Wednesday 09 March 2016 11:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Contact:

Re: Mercedes Me (Connected Vehicle)

Post by rolandbreedveld »

created my mercedes develop account, with multiple projects,
when using tis url with my ID :
https://id.mercedes-benz.com/as/authori ... state=test
I get:
Error
Oops
Looks like something is not right. Please contact your administrator.
400 - Invalid redirect_uri
looks like it's not working , or did I miss something

In Domoticz I get a login failure
Raspberry Pi(SSD)+UPS HAT,Dashticz on WallTablet,HomeBridge, P1, HarmonyHub,FritzBox,API to 123Solar+ABB-PowerOne+SMA,ESP-Leds(flashed LSC),Tasmota,Shelly,MQTT,Mosquito,Node-Red,http://wiki.breedveld.net/index.php?title=RPiWaterMeter, Mercedes-Me
User avatar
kiddigital
Posts: 435
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Mercedes Me (Connected Vehicle)

Post by kiddigital »

@rolandbreedveld

Did you configure the redirect_uri (https://localhost) also in your Project (see Project Credentials) within the Mercedes Developers Console?

The redirect_uri needs to be known, otherwise the redirect will not happen.
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
User avatar
rolandbreedveld
Posts: 156
Joined: Wednesday 09 March 2016 11:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Contact:

Re: Mercedes Me (Connected Vehicle)

Post by rolandbreedveld »

kiddigital wrote: Tuesday 27 July 2021 14:33 @rolandbreedveld

Did you configure the redirect_uri (https://localhost) also in your Project (see Project Credentials) within the Mercedes Developers Console?

The redirect_uri needs to be known, otherwise the redirect will not happen.
The rederect URL is :
https://localhost

In Domiticz:
2021-07-27 15:35:16.147 EQA250: Attempting login (using provided Authorization code).
2021-07-27 15:35:16.669 Status: EQA250: Received 400/401.. During authorisation proces. Aborting!
2021-07-27 15:35:16.669 Error: EQA250: Failed to get token.
Raspberry Pi(SSD)+UPS HAT,Dashticz on WallTablet,HomeBridge, P1, HarmonyHub,FritzBox,API to 123Solar+ABB-PowerOne+SMA,ESP-Leds(flashed LSC),Tasmota,Shelly,MQTT,Mosquito,Node-Red,http://wiki.breedveld.net/index.php?title=RPiWaterMeter, Mercedes-Me
User avatar
kiddigital
Posts: 435
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Mercedes Me (Connected Vehicle)

Post by kiddigital »

rolandbreedveld wrote: Tuesday 27 July 2021 15:34 ...
In Domiticz:
2021-07-27 15:35:16.147 EQA250: Attempting login (using provided Authorization code).
2021-07-27 15:35:16.669 Status: EQA250: Received 400/401.. During authorisation proces. Aborting!
2021-07-27 15:35:16.669 Error: EQA250: Failed to get token.
So you were able to get an authorization_token in the URL after logging in on the MercedesMe portal?
Just checking.. your account for MercedesME is the same as on the Dev Portal?
Once you get an authorization_token, this code is only valid for a short time (I thought 60 minutes). Try to get a new authorization_token and try again.
If the authorization_token contains a '+' or '/' character, apply for a new one as I think there might be an encoding issue with these characters.
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
User avatar
rolandbreedveld
Posts: 156
Joined: Wednesday 09 March 2016 11:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Contact:

Re: Mercedes Me (Connected Vehicle)

Post by rolandbreedveld »

@kiddigital
it finaly works,
The URL is changed, with the current one You'll get no login screen but a: "The requested scope is invalid"

you have to add "&prompt=login consent" to the URL, the correct URL will be:

Code: Select all

https://id.mercedes-benz.com/as/authorization.oauth2?response_type=code&client_id=<CLIENT-ID>&redirect_uri=https://localhost&scope=mb:vehicle:mbdata:vehiclestatus%20mb:vehicle:mbdata:fuelstatus%20mb:vehicle:mbdata:payasyoudrive%20mb:vehicle:mbdata:vehiclelock%20mb:vehicle:mbdata:evstatus%20offline_access&state=test&prompt=login%20consent
Had to do it twice, it's important that the car is "alive", first time I get "waking up the car", after a while the authentication was timed out.

regards Roland
Raspberry Pi(SSD)+UPS HAT,Dashticz on WallTablet,HomeBridge, P1, HarmonyHub,FritzBox,API to 123Solar+ABB-PowerOne+SMA,ESP-Leds(flashed LSC),Tasmota,Shelly,MQTT,Mosquito,Node-Red,http://wiki.breedveld.net/index.php?title=RPiWaterMeter, Mercedes-Me
User avatar
kiddigital
Posts: 435
Joined: Thursday 10 August 2017 6:52
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Mercedes Me (Connected Vehicle)

Post by kiddigital »

rolandbreedveld wrote: Wednesday 28 July 2021 17:17 @kiddigital
it finaly works,
Great :D
rolandbreedveld wrote: Wednesday 28 July 2021 17:17 The URL is changed, with the current one You'll get no login screen but a: "The requested scope is invalid"

you have to add "&prompt=login consent" to the URL, the correct URL will be:

Code: Select all

https://id.mercedes-benz.com/as/authorization.oauth2?response_type=code&client_id=<CLIENT-ID>&redirect_uri=https://localhost&scope=mb:vehicle:mbdata:vehiclestatus%20mb:vehicle:mbdata:fuelstatus%20mb:vehicle:mbdata:payasyoudrive%20mb:vehicle:mbdata:vehiclelock%20mb:vehicle:mbdata:evstatus%20offline_access&state=test&prompt=login%20consent
Had to do it twice, it's important that the car is "alive", first time I get "waking up the car", after a while the authentication was timed out.

regards Roland
Thx for reporting, new to me :) But that's the benefit of the refresh_token usage, once it is running and keeps running, no need to re-authenticate :)
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
User avatar
rolandbreedveld
Posts: 156
Joined: Wednesday 09 March 2016 11:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Contact:

Re: Mercedes Me (Connected Vehicle)

Post by rolandbreedveld »

Thx for reporting, new to me :) But that's the benefit of the refresh_token usage, once it is running and keeps running, no need to re-authenticate :)
That's right, it's only for the first time.
Found it on https://developer.mercedes-benz.com/con ... umentation right column.
Raspberry Pi(SSD)+UPS HAT,Dashticz on WallTablet,HomeBridge, P1, HarmonyHub,FritzBox,API to 123Solar+ABB-PowerOne+SMA,ESP-Leds(flashed LSC),Tasmota,Shelly,MQTT,Mosquito,Node-Red,http://wiki.breedveld.net/index.php?title=RPiWaterMeter, Mercedes-Me
User avatar
rolandbreedveld
Posts: 156
Joined: Wednesday 09 March 2016 11:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Contact:

Re: Mercedes Me (Connected Vehicle)

Post by rolandbreedveld »

@kiddigital
Is there a way to send commands to the car?
I'm looking for a way to stop/start charging, when my solar panels are producing energy.
Raspberry Pi(SSD)+UPS HAT,Dashticz on WallTablet,HomeBridge, P1, HarmonyHub,FritzBox,API to 123Solar+ABB-PowerOne+SMA,ESP-Leds(flashed LSC),Tasmota,Shelly,MQTT,Mosquito,Node-Red,http://wiki.breedveld.net/index.php?title=RPiWaterMeter, Mercedes-Me
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests