Mercedes Me Component

Hello @ReneNulschDE

I have enabled auxheat in client.py with:

        car.auxheat = self._get_car_values(
            c, car.finorvin, Auxheat(), AUX_HEAT_OPTIONS, update_mode)

All attributes are shown, but when I start aux heat it shows only one or two of the attributes:

auxheat3a

Anything I can help to enable auxheat working correctly?
Thanks, Markus

Hi Markus,

This just old code from the old component. But you can help. I have no car with AuxHeat.

  1. Switch on the save to file mode to true. see https://github.com/ReneNulschDE/mbapi2020/blob/43161ff9124008a2b32f9a21e03920a13f3ab24b/custom_components/mbapi2020/client.py#L47

  2. restart HA, wait few minutes, start the auxheat on your mobile phone.

  3. send me the jsons out of the messages folder in the custom_components/mbapi2020.

Then I can check what needs to be adjusted.

BR
Rene

Hi Rene,
i think this has been discussed some days ago but i noticed that the state precondActive seems to be still broken. Starting precondition and the state attribute always returns false.

Hi,

I have published a new version 0.4.0.

New sensors:

  • Aux Heat Status (Thanks: @danielrheinbay)
  • oilLevel

New switch:

  • AuxHeat

New Lock

  • Lock (with Pin support if the pin is not stored in the integration options, restart required if you remove or add a pin the integration options)

New Services

  • Auxheat_start
  • Auxheat_stop

Changes:

Breaking changes:

  • Hopefully none :slight_smile:

Not solved yet:

  • precondActive
  • PreCond-Now does not work for older cars, we need to implement Precond-Immediate

Others:

  • I have initiated the onboarding process to HACS. Waiting to get the Brands, Wheels and HACS merged.
6 Likes

Auxheat works for me now. Thanks Rene!

1 Like

Wow, please share this ā€žCardā€œ ā€¦THX uwe

Thanks again RenƩ for your excellent work on this.
Today I was frustrated that the Mercedes app did not notify my that my window apparently was open, so I wondered, why canĀ“t I automate this myself. My thought was that I trigger a notification based on the ignition being off and when the window or lock open. The below code is what I was thinking of, but I could not find any documentation on the ignition_state, so itĀ“s based on the states I noticed. Has anyone tried this and a better way or suggestions?

- id: car_window_notification
  alias: Car window open notification
  initial_state: true
  trigger:
    - platform: state
      entity_id: sensor.xxxxxxx_ignition_state
      to: '0'
      for:
        minutes: 1
  condition:
    condition: not
    conditions:
      - condition: state
        entity_id: binary_sensor.xxxxxxx_windows_closed
        state: 'On'
  action:
    - service: notify.mobile_app_rene_s_iphone_11
      data:
        message: 'Car window open'
        data:
          attachment:
            url: https://www.car-brand-names.com/wp-content/uploads/2015/05/Mercedes-symbol.jpg

- id: car_lock_notification
  alias: Car unlocked notification
  initial_state: true
  trigger:
    - platform: state
      entity_id: sensor.xxxxxxx_ignition_state
      to: '0'
      for:
        minutes: 1
  condition:
    condition: not
    conditions:
      - condition: state
        entity_id: sensor.xxxxxxx_lock
        state: '2'
  action:
    - service: notify.mobile_app_rene_s_iphone_11
      data:
        message: 'Car unlocked'
        data:
          attachment:
            url: https://www.car-brand-names.com/wp-content/uploads/2015/05/Mercedes-symbol.jpg

here are the values

  • Ignition state
    Internal Name: ignitionstate
    
    Values     Description_short     Description_long
    "0"        "lock"                "Ignition lock"
    "1"        "off"                 "Ignition off"
    "2"        "accessory"           "Ignition accessory"
    "4"        "on"                  "Ignition on"
    "5"        "start"               "Ignition start"
    

based on MBSDK-CarKit-iOS/MBCarKit/MBCarKit/Common/Enums/Status/EngineTypes.swift at cbe02fc1322a6e7278b5ad1a3faafde2f36177c4 Ā· mercedes-benz/MBSDK-CarKit-iOS Ā· GitHub

1 Like

I like your approach. Other option could be to measure the distance between your phone and the car.

{{ distance('device_tracker.phone1', 'device_tracker.yourcar_device_tracker') }}

Nice one! That would however only work if you were the only one using the car. In my case itā€™s me or my wife.

This you could solve with the closest function. see https://www.home-assistant.io/docs/configuration/templating/

You learn something new every day! definitely worth a shot! Thanks!

I love this component and it really works well, but I do see comments mentioning some sensors, etc. that I donā€™t see, which Iā€™m sure is to do with my subscriptions.

Is there a guide which says which APIs and which services you need to subscribe to for the various devices and sensors?

Iā€™ve subscribed to the following APIs:

  • Electric Vehicle Status BYOCAR
  • Fuel Status BYOCAR
  • Vehicle Lock Status BYOCAR
  • Vehicle Status BYOCAR

In terms of Mercedes subscriptions I have:

  • Vehicle Setup

Are there any other APIs I should be subscribing to, or any other services?

What would the Vehicle Monitoring, Remove & Navigation Services, and Stolen Vehicle Help give me that I donā€™t already get?

I canā€™t see things like charging status or location.

Thanks

Hi @DerekO,

this component does not use the BYOD api currently, my component is imitating the mobile app. You should see all sensors that are available in the MercedesME App (US/CA: MercedesME Connect). Please check the service description of the additional services in the app as this depends by region/country/car.

Vehicle Setup is the core and enables most of the services.

But let me try to answer it high level:
Vehicle Monitoring = Location data is available (you could use the device tracker in HA)
Remote & Navigation Services = Focus on services around electric cars and charging

What do you miss?

BTW: If you would like to use the official API then @Giorgio_Ravera has done a lot of work. please check the posting in this thread around Octā€™ 2020.

Scroll up or klick Mercedes Me Component

2 Likes

thx holger, canā€™t find the pic without values ā€¦ yaml works well! thx again

Hi from Sydney Australia here. What settings should I be using for LOCALE and COUNTRY CODE for Australia/Asia Pacific?

I have added the integration successfully and it seemed to connect ok with en-AU , AU but no entities are showing up even after a HA restart.

Any Ideas?

Hi,

what mobile app do you use in Australia?

BR
Rene

Great work on the new update. For some reason I donā€™t seem to have the lock. Iā€™m trying to trouble shoot the cause. If I figure it out Iā€™ll come back to you.

Rene,

Which json value are you looking for to build the lock? I tried calling the door_lock service and received the following.

ā€œVIN unknown or feature not availabe for this car.ā€

Strange because it worked previously. In fact I had created my own lock template which worked perfectly

 lock:
   - platform: template
     name: GLS Lock
     value_template: "{{ is_state('binary_sensor.la221804_lock_status', 'off')}}"
     lock:
       service: mbapi2020.doors_lock
       data:
         vin: "{{ states.sensor.la221804_car.attributes.vin  }}"
     unlock:
       service: mbapi2020.doors_unlock
       data:
        vin: "{{ states.sensor.la221804_car.attributes.vin  }}"