I will swapping my Mercedes for a Lexus around August 2022 so if anyone wants to take over the Mercedes Me App then let me know. I will do my best to support it after that if nobody volunteers but without a car it will be harder to test.
Unfortunately it takes a bit of work to setup as Mercedes have locked down the API very tightly.
You will need to create an application in https://developer.mercedes-benz.com/
The following steps should get you started:
Login using your Mercedes Me account details
Click on “CONSOLE.”
Click on “Add Project”
Enter a Project Name such as “Homey{yourname}” where {yourname} is your name. Every project name has to be globally unique so you might need to change it if it is already taken
Fill in the Business purpose box with something like “Adding my Mercedes to my home automation system”
Click on “CREATE”.
Click on “APIs”
Scroll down until you see “Electric Vehicle Status” and click on the image.
Click on “GET ACCESS”.
Click on “GET FOR FREE”.
Click on “BYOCAR”.
Make sure your project name is shown
Click on “SUBSCRIBE”.
Click on “BACK TO PRODUCT OVERVIEW”
Repeat steps 8 to 14 for the following APIs: Fuel Status, Pay As You Drive Insurance, Vehicle Lock Status, Vehicle Status and Connected Vehicle (from experimental).
Once you have add all the APIs, click on “CONSOLE” again
Click on “Project details”. You should now see your Client ID and Client Secret that will be required by the Homey app.
Note: One user has reported they had to also add the Connected Vehicle API from the Experimental products section. Without that API he was getting an error message when adding the car to Homey.
You can now add a new device in Homey and select the car.
On the first screen, enter your Client ID and Client Secret that was shown in the Mercedes Me app setup.
You will also need to enter your vehicles VIN number. You can find this in the Mercedes Me phone app by taping on the menu button, tap on the image of your car, select Vehicle information and the number is displayed just above your registration plate number.
If the app has not already been authorised, you will see a page from Mercedes asking you to grant access permissions. Make sure all the options are turned on and then accept.
Next, one device should be present for you to select and add.
The status values will only update once they are available from Mercedes. You might need to unlock and lock the car and put windows up and down, etc to make the car send the status updates to the server so they are given to the Homey app.
Version Log
0.1.1
Added trigger flow cards for vehicle locked / unlocked and condition card for vehicle is / is not locked
0.1.2
Added condition card for any window or sunroof open.
0.1.3
Added trigger cards for a window or sunroof open / closed.
Added trigger cards for a door or deck lid open / closed
0.1.4
Added extra logging
0.1.5
Failed data collection now retries on the next poll
Improved OAuth error reporting.
0.1.6
Added more logging to try and detect cause of failed connections.
0.1.7
Removed unused scopes.
Added connection credentials stage to add device wizard.
0.1.8
Updated a store image.
0.1.9
Replaced a scope that allowed the token refresh
1.0.0
Updated for new Mercedes authentication
1.0.1
Fix for high retry speed when API call fails.
Added setting to device to control the polling interval.
At the final step of adding the car as device in the Homey app I get an error (from Homey) stating “Authorization code is malformed.” What am I doing wrong?
Could you try adding the Connected Vehicle API from the Experimental products section. It seems that solved the problem for another user with the same error message.
Implemented using the test version of the app: - send a notification when the car has been unlocked and it is at home/within geofence and nobody is at home/all are asleep
(for now to be solved with boolean)
Looking at the available values I am pretty sure not all will be possible and of course some parts of these flows/user-stories will come from other apps. There may also be a big difference in a query for information and sending commands… Anyway, here are a few ideas for filling the backlog
I would love to: - get a notification when the car has been locked but not all windows/sunroof are closed - have all windows/sunroof closed when rain is expected for my location - get a notification if the planned route that was sent to the car exceeds the fuel range - have the sunroof open itself when a planned route is sent to the car and the (outside) temperature is above x degrees
By no means I am trying to create assignments, but this is on my mind when it comes to using the car info for automation. Happy to buy you more beers when things evolve
So the test version has the when card for the car has been locked and the window states are available using logic cards with the tags. But i will add a condition card for “A window or sunroof is open” as I can see that will reduce thenumbe rof conditions to check for.
The API doesn’t currently allow any commands to be sent but if Mercedes add that feature I will jump on it.
The fuel range is available via a tag but the API has no way to get the planned route information. I will keep checking in on the API changes to see what features they add and implement them when possible.
Again no way to get the route or send commands.
Thank you for the suggestions though. The only way I will know what users want is if they ask so all feedback is good. However, as in this case some of the features are not possible due to the restrictions in the API.
Ah I didn’t realize, that’s great! This opens up possibilities already! Thanks for the swift reply, adding the “aggregated condition” and keeping an eye on the API capabilities!
Could you enable the diagnostic log, try adding the car and then send the log.
Also I would recommend copy and paste to enter the Client Id, Client Secret and VIN no details as they are very long and easy to make a mistake.
I have received the log but it is empty. Was there something in the list below the buttons when you sent it?
Was the tick a blue colour?
Homey style for checkboxes uses a grey tick for disabled and a blue tick for enabled which has caught out a lot of users.
I forgot to add the insurance api. After i added that api, i got to a screen asking for permission to access. I accepted and got an generic error. Logging is enabled(blue tick) but the box is still empty. Will logging info appear there?
Success! Car added, but only 1 box have any info. But wife is out driving the car now, will investigatw further when the car is parked. Thany you for your swift response!
Excellent. The app is still new so I am learning how thing can fail as well
The API only sends changes when they occur. So to get things to populate you might need to use them. E.g. lock / unlock the car so the new status is sent to the server and then it should filter through to the app.
The car is an B250e, was interested in getting the battery status, but it is still blank. Unlock status have updated itself. I see great potential in automating the charge to just finish before i leave in the morning.
With the log enabled do you see a section with any of the charge status information?
I have just spotted an error in my logging so it will show two sections for “VS:[” instead of one for “EV:”, copy and paste error
As I don’t have an EV I haven’t been able to test that section, so it could be the names of various things don’t match.
Again, could you keep the logging enabled for a while and then send it to me.