Mercedes Me Component

Hi @Subia75,

I can’t reproduce this in my environments. I propose, that you first restart your HA and check again. If this does not work, start your car engine and open/close the window and check the status again. Sometimes, the values are not uptodate on the MB-server side and the status is not delivered on start-up of HA.

Thanks for the reply, I’ll test this

I have an EQA350, and I don’t see maxsoc unfortunately. I see it in the ME app of course, but not in attributes.

Is this missing?

device_class: battery
friendly_name: State of Charge
unit_of_measurement: '%'
car: 
vin: 
retrievalstatus: VALID
timestamp: '2023-02-12T15:20:38'
unit: PERCENT
maxSocLowerLimit: '50'

Lock used to work (below v0.8) when pin code was not saved in options. If code is not saved and entered with lock.lock service parameters it gives following errors

Failed to call service lock.open. Entity lock.licenceplate_lock does not support this service.

or something like no math pattern for /d 1-9 4x...

Luckily it works when code is saved. But it might be safer to give option to pass code throu service parameter

HI all,

Today I updated the HA MBAPI2020 and suddenly nothing is working. Is there an extra step I had to do after updating or is this a known issue? Would love to get this App working again. Any suggestions?

Thanks

Hi Justin,

sorry, to hear that - can you give us a little bit more information? What was your old version, what is your HA version, what errors do you see in the log? What happens when you enable the debug logging?

BR
Rene

I see this in the Error log.

’ 2023-02-15 17:55:18.520 INFO (MainThread) [custom_components.mbapi2020.oauth] Start async_refresh_access_token() with refresh_token
2023-02-15 17:55:18.698 ERROR (MainThread) [custom_components.mbapi2020.oauth] ClientError requesting data from https://id.mercedes-benz.com/as/token.oauth2: 400, message=‘Bad Request’, url=URL(‘https://id.mercedes-benz.com/as/token.oauth2’)
2023-02-15 17:55:18.699 DEBUG (MainThread) [custom_components.mbapi2020] Can not connect to MB OAuth API ’

I only installed it about 3 weeks ago so a very recent version.

As for HA version, I upgraded to the latest only earlier tody. But I am sure the MBaPI was working after the HA update.

mmhhh, token refresh is working on my side in Europe. What is your region/country? Could you please delete the file .mercedesme-token-cache in your HA-config directory and restart HA? After the restart you should see a notification that a reauth is needed. Please reauthenticate and share the logs if this does not work (switch on the debug log - see readme on github)

That worked, thanks Rene.

Once I re-authorised it, I then had 2 x red Mercedes Me 2020 Reconfigure boxes appearin my Integrations. I restarted the hardware and they were gone. All working again. :clap::raised_hands:

Thank you very much for the great work so far.

I ordered an EQE and i should get it around april and now i looked for an integration into HA. But i wondered whats the reason that Seat heating, steering wheel heating or trunk is not controllable through this integration? Afaik that is possible through the app right?

The reason is simple, no one asked for this so far and shared the details. Let me know if you would like to share your car details with me and I can check if an integration is possible.

Thanks! Thats the answer i was hoping for. I will contact you as soon as i get the car and will provide you with all input you might need.

Hi, first of all thanks for your great work. I successfully added my vehicle to Home Assistant and was able to have the car lock available in HomeKit.
Unfortunately I am unable to get the preheat service configured into a switch in order to turn it off and on.
This is my configuration.yaml:

# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

# Text to speech
tts:
  - platform: google_translate

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

# Example configuration.yaml entry
switch:
  - platform: template
    switches:
      preheat:
      friendly_name: "Vorklimatisierung"
      turn_on:
        service: mbapi2020.preheat_start
        data:
          vin: Wxxxxxxxxxxxxxxxx
      turn_off:
        service: mbapi2020.preheat_stop
        data:
          vin: Wxxxxxxxxxxxxxxxx

This isn’t working as Home Assistant refuses to restart with this error message:

argument of type ‘NoneType’ is not iterable

Can you please help me as I would really like to be able to tell Siri to preclimate my car.

Best regards

David Scheffler

Hi David,

please add the type = “0” attribute to the service call and try again:

service: mbapi2020.preheat_start
data:
  vin: Wxxxxxxxxxxxxxx
  type: "0"

Hi Rene, unfortunately this didn’t solve it.

Hi David,

sorry, I missed a different error in your template yesterday. The spacing is not right. You have to add two spaces to lines below preheat

switch:
  - platform: template
    switches:
      preheat:
        friendly_name: "Vorklima an"
        turn_on:
          service: mbapi2020.preheat_start
          data:
            vin: "Wxxxxxxxxxxxxxx"
            type: "0"
        turn_off:
          service: mbapi2020.preheat_stop
          data:
            vin: "Wxxxxxxxxxxxxxx"

PS: I propose that you remove your VIN/FIN in your post. We do not know, if in the future a security problem with VIN/FIN will occours

Thank you, @ReneNulschDE, for a great component!

I’m trying to turn on the pre-entry climate control in an EQV. I’m calling mbapi2020.preheat_start with my VIN. I’ve tried both types (0 and 1). Neither works. I’m getting this error message in the log:

2023-02-22 20:37:46.698 WARNING (MainThread) [custom_components.mbapi2020.client] Car action: PRECONDSTART failed. error_code: CMD_FAILED, error_message: Command failed. Normally, there should be additional business errors detailing what exactly went wrong

Using the official app to turn on the heat works. Trying to turn off the heat doesn’t work either:

2023-02-22 20:58:24.907 WARNING (MainThread) [custom_components.mbapi2020.client] Car action: PRECONDSTOP failed. error_code: CMD_FAILED, error_message: Command failed. Normally, there should be additional business errors detailing what exactly went wrong
2023-02-22 20:58:24.909 WARNING (MainThread) [custom_components.mbapi2020.client] Car action: PRECONDSTOP failed. error_code: 4051, error_message: None

Hi guys. So, my goal is to Lock/unlock my Mercedes E 2018 with Siri (“hey siri, lock my car”). I am using MercedesMe2020 integration and lock/unlock works from Home Assistant, but I can’t get it to my Apple Home app via HA HomeBridge. Any ideas?
I also came across Mercedes Me API integration. Does this one work better? But I can’t set it up…

Hi Andreas,

The error message indicates that the MB backend had a problem to initiate the commands. Is your SOC state high enough?

I‘ll check it with my car tomorrow but I don’t have access to an eqv.

BR
René

Hi @speen ,

What have you tried so far? Config examples?

I can’t help with the other integration but the creator @Giorgio_Ravera can comment this eventually.

I‘m not using the homebridge but maybe someone else can give an answer after you shared more information.

BR
Rene