Mercedes Me Component

Hi @HorizonKane,

please make sure that you have accepted the EULA/DPA in the IOS or Android app. Please start the MercedesMe App on a mobile phone and login once. After that restart your HA.

BR
Rene

1 Like

Thanks for your reply.

I did all this (am actively using App and Website for a while). Any other idea what could be wrong?

Hi @HorizonKane,

could you please set the logging level for the OAuth component to debug and check/share the output of the line “Step 2 result:”

logger:
  default: warn
  logs:
    custom_components.mercedesmeapi: debug
    custom_components.mercedesmeapi.OAuth: debug

Will check later today :slight_smile:

Update: Enabled logging, restarted, everything ran through fine. Changed in the meantime… whatever :smiley:

1 Like

Are there examples of nice integrations in Lovelace?

Hi Manuel,

that looks so fanstastic, would you mind to share the code?

edit: Nevermind,found the code and pictures in this endless thread :smiley:

Hi,

If I turn CLIMATE_CONTROL (=heating to me) on, it does activate it, but simultaneously sets the climate control to turn on at time of departure, and sets the time of departure to midnight. Any possibility to either turn climate control on without setting departure time (as in mobile app) or adjust the time of departure?

hi @jake,

I have seen two “Pre-Heating”-Options so far.

  1. Heating (“Standheizung” in German), normally available in Non-E cars as an extra option.
  2. Pre-Climate (“Vorklimatisierung” in German), seen for example in a B-class e-drive modell

What type of car do you have?

I have tested this with car of type 1 (Heating or Standheizung) and the departure time is not set.

Based on my tests, the api has to submit a departure time and I use the current time in the api.

Could you share the attributes of the “[License] auxheat status” before you switch on the heater and after the heater is active?

Thx
Rene

Hi Rene,

It’s a GLC 350e (hybrid). It doesn’t have auxiliary heater, but just uses batteries.

This is the switch that I can turn on and time for midnight:

[switch.xxx_111_climate_control]
off 
car: XXX-111 
retrievalstatus: VALID 
friendly_name: XXX-111 CLIMATE CONTROL

The mobile app has options:

  1. “Set departure time” (opens another menu)
    1.1. “off”
    1.2. “once”
    1.2.1. [time] (e.g. “17:00”)
    1.3. (and a “save” option)
  2. “Pre Air Condition at departure time” [on-off switch] (pre air conditioning directly translated from finnish, in reality both heating and cooling, i.e. climate control)
  3. [a button to activate / deactivate climate control]

…if that helps, possibly something similar in the api…

Hi @jake,

thanks. Let me check if i can access a different car to simulate this.

@jruoho: Do you have the same problems? Could I access your car again to test this?

Thx
Rene

Hi @ReneNulschDE ,

I think you are still active user for my car :slight_smile: I am now out of home (with other car), so please feel free to do any testing (I have now more limited subscription so door unlocking and such will not work). Precond should work.
Battery is now at 56%, and charging will start during the night (cheaper electricity).

I tried to do improve your code during the summer, but all MercedesMe stuff seems to be very unstable (on IOS at least). It works only sometimes (about 30%) from official application - this may be related to the fact that the car was imported from Holland (I tried to open an ticket to MB but gave up - I’ll try to get it fixed with next service visit). My plan was to return to this after the official app works more reliably.

Jarkko

Has anyone managed to get this to work in USA?

Hi, the US version of the mobile (IOS, Android) app was completly different in the past. What app do you use? What functions are available? What car (year, model) do you use?
BR
Rene

I use “Mercedes Me Connect”. I use it for a 2019 GLC350e plug-in hybrid. The app offers typical monitoring sensors (fuel, charge level, tire pressure, locks, windows, maintenance intervals, etc…) and control of climate, lock and charging (departure time).

ok, thanks. This app is more or less the same that we use in europe. the login and the used backend systems are different. Looks not so complicated to adapt the code. I will send you a private message.

Hi,

I have pushed a new version to the master branch.

Changes:

  • Support US market (2019er cars, App Name: “Mercedes Me Connect (USA)”)
    The Market will be selected based on Country Code: US
    Delete the .mercedesme-token-cache before market change
  • RangeElectric and Odometer are available based on the HA metric settings
  • Allow cars without License Plate data (fin will be used as descriptor if no lic-plate is available)

@kzaoaai: Thank you for the data.

Next steps:

  • Rewrite to async
  • Fix/Rewrite Precond
1 Like

Hi

I just like to share that it works fine in Denmark also … cool job mate.

Do any of you used node-red in this matter? ; please share :slight_smile: thx.

And , is it posible to see geo location ? send lock and unlock message to the car doors?

I see there is following Domains: SWITCH and LOCK. in your source code; it looks like i need to use the lock domain.

im not sure; if its a lock or switch i need to use, to LOCK the car.

below my node-red

[{"id":"2c317e35.cdfa22","type":"tab","label":"Mercedes Me","disabled":false,"info":""},{"id":"47c757f.9ad3ea8","type":"api-current-state","z":"2c317e35.cdfa22","name":"","server":"631d649.a412d9c","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"lock.bv51331_lock","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":380,"y":120,"wires":[["ea7cf0de.1dc38"]]},{"id":"c9d76b6f.6be958","type":"inject","z":"2c317e35.cdfa22","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":120,"wires":[["47c757f.9ad3ea8"]]},{"id":"ea7cf0de.1dc38","type":"debug","z":"2c317e35.cdfa22","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":550,"y":220,"wires":[]},{"id":"6b8b1bc7.311de4","type":"api-call-service","z":"2c317e35.cdfa22","name":"","server":"631d649.a412d9c","version":1,"debugenabled":false,"service_domain":"lock","service":"unlock","entityId":"lock.bv51331_lock","data":"{}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":280,"y":280,"wires":[["ea7cf0de.1dc38"]]},{"id":"f9e8a20a.59856","type":"api-call-service","z":"2c317e35.cdfa22","name":"","server":"631d649.a412d9c","version":1,"debugenabled":false,"service_domain":"lock","service":"lock","entityId":"lock.bv51331_lock","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":280,"y":220,"wires":[["ea7cf0de.1dc38"]]},{"id":"fd3afdba.f21d3","type":"inject","z":"2c317e35.cdfa22","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":80,"y":280,"wires":[["f9e8a20a.59856"]]},{"id":"73bec146.014d2","type":"inject","z":"2c317e35.cdfa22","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":100,"y":320,"wires":[["6b8b1bc7.311de4"]]},{"id":"631d649.a412d9c","type":"server","z":"","name":"Home Assistant Kongensgade 9","legacy":false,"hassio":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

Hi Janus,

Thanks. Have not tested this with node-red.

Geolocation is available when you have an active subscription for this. Please check the device_tracker.YOURCARVIN.

You can use the LOCK to lock and unlock when you have an active subscription for this. Please check the lock.YOURLICENSEPLATE. The LOCK and UNLOCK process takes a while (30-60 sec.).
Please setup a PIN in your MBme mobile app and configure the PIN in your HA config.

You can enable save_car_details: True to see what is available in your car(s).

thx. I use a pin, it’s by default i think.

I will update subscription; the me app did not work for locking the car; but i see the geo data.

I see following:
bv51331

" You can enable save_car_details: True to see what is available in your car(s)." Is tihs in the config I set this ?

I will play more and get back :slight_smile: