Mercedes Me Component

Hi,

I can reproduce the problem. Looks like MB has changed the Authentication again. (like every november :-() - Its just a minimum version update - should be easy to fix

Give me some time to prepare a new version.

BR
Rene

2 Likes

it stopped working for me also. But now i have deleted the integration and i reinstalled but unable to connect with email. i get an error. also before download from hacs i see up on the left: ā€œvalidate with HACS failingā€

1 Like

Hi,

I have published a new version 0.6.9.

Bugfix:
Onboarding error: HTTPClientException - 418 - Iā€™m not a teapot
Canā€™t connect to MB APIs; Retrying in background

Minimum HA-version: 2022-11

Special ask to the US users: Do you see the same problem?

BR
Rene

Upgraded and resolved. Thanks so much!

1 Like

Great, it works now.

Thank you

Hi, I posted an issue on the GitHub but found the discussion here. Iā€™m getting the ā€œUnknown Error Occurredā€ as above after updating to 0.6.9

I am in North America

Hi,

I have published a new version 0.6.10 to make the needed changes for the US-Region too.

Bugfix:
Onboarding error: HTTPClientException - 418 - Iā€™m not a teapot
Canā€™t connect to MB APIs; Retrying in background

Minimum HA-version: 2022-11

BR
Rene

1 Like

Hi Rene,

I have been seeing the attached error for quite a while now. Iā€™ve now updated to 0.6.10 and still have the same error. Iā€™m in the UK.

Hi,
Do you get this error continuously?

I would propose that you stop HA, delete the file .mercedesme-token-cache in your HA-config folder. Then start HA and reonboard the integration.

BR
Rene

Super thatā€™s fixed it. Thanks for your prompt help Rene :slight_smile:

This worked for my issue. Thank you!

1 Like

Today is my last day with the employer that provided me with an EQC for the last two years.

I want to say a huge thank you to @ReneNulschDE not only for providing an excellent HA component but for giving up his time to support those of us who use it.

I also want to thank the other contributors to this topic who have helped so much to implement the component.

Next, I will have a Polestar 2, which is has a very basic App and no HA component or integration :frowning:

Good luck everyone and thanks for everything.

Rich

3 Likes

hello @Subia75 ,
Is it possible for you tu share the card code?
thanks from france.

Hi!

I have published a minor version update v0.6.11.

Bugfix Release:

  • Prevent parallel websocket requests - blocked user account #82 (@appit-online)

minimum HA-version: 2022.11.0

Thanks to appit-online

Hi Rene,

Tank you very much for this amazing integration.

I have a 250e car with preheat fonction and i search to have a switch for expose to Alexa or Google Home.
Can you give me some tips to implamente a switch ? (i have never modify a component)
I have try with services tab to check and it works.
But i donā€™t know how to create a similar fonction but in switch like the lock button.

Tank you very much again for all your work.

Hi @Jillian,

Thanks and welcome to the club.

Not sure if I got your question right. If you look for a way to implement the services-call with a switch then the ā€œswitch-templateā€ is a good starting point. With that you can create a switch and could execute services-calls.

If you look for general voice assistant integration, I would propose that you look around in the forum. This component is not special and just uses the HA-defaults.

BR
Rene
BTW: Here is an example for a ā€œLOCKā€ that is using the same template approach

yes, you just need to create sensors to extract the attributes you need.
the code is a bit long because I put some colors based on the status of some sensors

type: picture-elements
image: /local/FG135JH.png
style: |
  ha-card {
    --ha-card-border-radius: 5px;
    border: 1px solid #ffee58;
  }
elements:
  - type: custom:button-card
    icon: mdi:gas-station-outline
    color_type: icon
    entity: sensor.fg135jh_fuel_level
    show_state: true
    show_name: false
    state:
      - value: 5
        operator: <
        color: '#FF0000'
      - value: 10
        operator: <=
        color: '#ff6600'
      - value: 30
        operator: <=
        color: '#ffcc00'
      - value: 40
        operator: <=
        color: '#FFFF00'
      - value: 50
        operator: <=
        color: '#ccff33'
      - value: 65
        operator: <=
        color: '#e1ff00'
      - value: 85
        operator: <=
        color: '#66ff33'
      - value: 90
        operator: <=
        color: '#4bff0f'
    styles:
      card:
        - width: 125px
        - height: 80px
        - background-color: rgba(0, 0, 0, .1)
      label:
        - font-color: '#ffee58'
      state:
        - color: white
        - transform: translate(20%, -70%) scale(0.8, 0.6)
      icon:
        - transform: translate(-60%, 20%) scale(0.7, 0.7)
        - animation: |
            [[[ 
              var blink=states['sensor.fg135jh_fuel_level'].state; 
              if (blink<= '15' )  return 'blink 3s linear infinite'  
            ]]]
    style:
      left: 15.8%
      top: 12%
  - type: custom:button-card
    template: background_glass
    entity: sensor.fg135jh_km_range
    show_name: false
    show_icon: false
    show_state: false
    show_label: true
    layout: icon_label
    label: |
      [[[ return ' ' + states['sensor.fg135jh_km_range'].state + ' km'; ]]]
    state:
      - value: 20
        operator: <=
        color: red
      - value: 100
        operator: <
        color: yellow
      - value: 100
        operator: '>='
        color: green
    styles:
      card:
        - width: 200px
        - height: 50px
      label:
        - transform: translate(-15%, 0%) scale(0.7, 0.5)
      icon:
        - transform: translate(50%, -0%) scale(0.6, 0.6)
    style:
      left: 7%
      top: 7%
  - type: custom:button-card
    icon: mdi:car-traction-control
    color_type: icon
    entity: sensor.fg135jh_odometer
    show_state: true
    show_name: false
    styles:
      card:
        - width: 150px
        - height: 80px
        - background-color: rgba(0, 0, 0, .1)
      label:
        - font-color: '#ffee58'
      state:
        - color: white
        - transform: translate( -30%, -70%) scale(0.8, 0.6)
      icon:
        - transform: translate(-55%, 10%) scale(0.5, 0.4)
    style:
      left: 45.5%
      top: 12%
  - type: custom:button-card
    template: background_glass
    icon: mdi:clock-time-four-outline
    entity: sensor.fg135jh_service_interval
    show_name: false
    show_state: false
    show_label: true
    layout: icon_label
    label: >
      [[[ return 'service in: ' +
      states['sensor.fg135jh_service_interval'].state + ' days'; ]]]
    state:
      - value: 20
        operator: <=
        color: red
      - value: 100
        operator: <
        color: yellow
      - value: 100
        operator: '>='
        color: green
    styles:
      card:
        - width: 200px
        - height: 50px
      label:
        - font-size: 10px
        - transform: translate(-15%, -0%) scale(1.1, 0.8)
      icon:
        - transform: translate(50%, -0%) scale(0.6, 0.6)
    style:
      left: 70%
      top: 5.5%
  - type: custom:button-card
    template: background_glass
    entity: binary_sensor.fg135jh_engine_light_warning
    name: ' '
    show_header_toggle: false
    state_color: true
    state:
      - value: 'off'
        styles:
          icon:
            - color: rgb(0, 255, 17)
            - background-color: rgba(255, 255, 255, 0.01)
      - value: 'on'
        styles:
          icon:
            - color: rgba(252, 232, 50, 0.99)
    style:
      left: 57%
      top: 17.5%
      width: 12%
  - type: custom:button-card
    template: background_glass
    entity: binary_sensor.fg135jh_tire_warning
    name: ' '
    show_header_toggle: false
    state_color: true
    state:
      - value: 'off'
        styles:
          icon:
            - color: rgb(0, 255, 17)
            - background-color: rgba(255, 255, 255, 0.01)
      - value: 'on'
        styles:
          icon:
            - color: rgba(252, 232, 50, 0.99)
    style:
      left: 66.5%
      top: 17.5%
      width: 12%
  - type: custom:button-card
    template: background_glass
    entity: binary_sensor.fg135jh_low_brake_fluid_warning
    name: ' '
    show_header_toggle: false
    state_color: true
    state:
      - value: 'off'
        styles:
          icon:
            - color: rgb(0, 255, 17)
            - background-color: rgba(255, 255, 255, 0.01)
      - value: 'on'
        styles:
          icon:
            - color: rgba(252, 232, 50, 0.99)
    style:
      left: 76%
      top: 17.5%
      width: 12%
  - type: custom:button-card
    template: background_glass
    entity: binary_sensor.fg135jh_low_coolant_level_warning
    name: ' '
    show_header_toggle: false
    state_color: true
    state:
      - value: 'off'
        styles:
          icon:
            - color: rgb(0, 255, 17)
            - background-color: rgba(255, 255, 255, 0.01)
      - value: 'on'
        styles:
          icon:
            - color: rgba(252, 232, 50, 0.99)
    style:
      left: 85.5%
      top: 17.5%
      width: 12%
  - type: custom:button-card
    template: background_glass
    entity: binary_sensor.fg135jh_low_wash_water_warning
    name: ' '
    show_header_toggle: false
    state_color: true
    state:
      - value: 'off'
        styles:
          icon:
            - color: rgb(0, 255, 17)
            - background-color: rgba(255, 255, 255, 0.01)
      - value: 'on'
        styles:
          icon:
            - color: rgba(252, 232, 50, 0.99)
    style:
      left: 95%
      top: 17.5%
      width: 12%
  - type: custom:button-card
    template: background_glass
    entity: sensor.fg135jh_starter_battery_state
    name: ' '
    show_header_toggle: false
    state_color: true
    state:
      - value: 0
        styles:
          icon:
            - width: 25%
            - color: rgb(0, 255, 17)
            - background-color: rgba(255, 255, 255, 0.01)
      - value: 1
        styles:
          icon:
            - width: 20%
            - color: yellow
            - animation: blink 2s linear infinite
      - value: 2
        styles:
          icon:
            - width: 30%
            - color: red
            - animation: blink 0.5s linear infinite
      - value: 3
        styles:
          icon:
            - width: 50%
            - color: brown
            - animation: blink 0.5s linear infinite
      - value: 4
        styles:
          icon:
            - width: 50%
            - color: blue
            - animation: blink 0.5s linear infinite
    style:
      left: 38%
      top: 62%
  - type: state-label
    entity: sensor.fg135jh_tire_pressure_front_right
    style:
      transform: translate(-50%, -50%) scale(0.8, 0.8)
      color: lightgrey
      left: 38%
      top: 32%
  - type: state-label
    entity: sensor.fg135jh_tire_pressure_rear_right
    style:
      transform: translate(-50%, -50%) scale(0.8, 0.8)
      color: lightgrey
      left: 84%
      top: 32%
  - type: state-label
    entity: sensor.fg135jh_tire_pressure_front_left
    style:
      transform: translate(-50%, -50%) scale(0.7, 0.7)
      color: lightgrey
      left: 38%
      top: 90%
  - type: state-label
    entity: sensor.fg135jh_tire_pressure_rear_left
    style:
      transform: translate(-50%, -50%) scale(0.8, 0.8)
      color: lightgrey
      left: 84%
      top: 90%
  - type: custom:button-card
    template: background_glass
    entity: sensor.fg135jh_lock_front_left
    name: ' '
    show_header_toggle: false
    state_color: true
    state:
      - value: closed
        styles:
          icon:
            - color: rgb(0, 255, 17)
            - background-color: rgba(255, 255, 255, 0.01)
      - value: open
        styles:
          icon:
            - color: red
    style:
      left: 61%
      top: 83%
      width: 10%
  - type: custom:button-card
    template: background_glass
    entity: sensor.fg135jh_lock_front_right
    name: ' '
    show_header_toggle: false
    state_color: true
    state:
      - value: closed
        styles:
          icon:
            - color: rgb(0, 255, 17)
            - background-color: rgba(255, 255, 255, 0.01)
      - value: open
        styles:
          icon:
            - color: red
    style:
      left: 61%
      top: 38%
      width: 10%
  - type: custom:button-card
    template: background_glass
    entity: sensor.fg135jh_lock_rear_left
    name: ' '
    show_header_toggle: false
    state_color: true
    state:
      - value: closed
        styles:
          icon:
            - color: rgb(0, 255, 17)
            - background-color: rgba(255, 255, 255, 0.01)
      - value: open
        styles:
          icon:
            - color: red
    style:
      left: 68%
      top: 83%
      width: 10%
  - type: custom:button-card
    template: background_glass
    entity: sensor.fg135jh_lock_rear_right
    name: ' '
    show_header_toggle: false
    state_color: true
    state:
      - value: closed
        styles:
          icon:
            - color: rgb(0, 255, 17)
            - background-color: rgba(255, 255, 255, 0.01)
      - value: open
        styles:
          icon:
            - color: red
    style:
      left: 68%
      top: 38%
      width: 10%
  - type: custom:button-card
    template: background_glass
    entity: sensor.fg135jh_lock_trunk
    name: ' '
    show_header_toggle: false
    state_color: true
    state:
      - value: closed
        styles:
          icon:
            - color: rgb(0, 255, 17)
            - background-color: rgba(255, 255, 255, 0.01)
      - value: open
        styles:
          icon:
            - color: red
    style:
      left: 95%
      top: 60%
      width: 10%
  - type: custom:button-card
    template: background_glass
    entity: sensor.fg135jh_window_front_left
    name: ' '
    show_header_toggle: false
    state_color: true
    state:
      - value: closed
        styles:
          icon:
            - color: rgb(0, 255, 17)
            - background-color: rgba(255, 255, 255, 0.01)
      - value: open
        styles:
          icon:
            - color: red
    style:
      left: 56%
      top: 90%
      width: 10%
  - type: custom:button-card
    template: background_glass
    entity: sensor.fg135jh_window_front_right
    name: ' '
    show_header_toggle: false
    state_color: true
    state:
      - value: closed
        styles:
          icon:
            - color: rgb(0, 255, 17)
            - background-color: rgba(255, 255, 255, 0.01)
      - value: open
        styles:
          icon:
            - color: red
    style:
      left: 56%
      top: 31%
      width: 10%
  - type: custom:button-card
    template: background_glass
    entity: sensor.fg135jh_window_rear_left
    name: ' '
    show_header_toggle: false
    state_color: true
    state:
      - value: closed
        styles:
          icon:
            - color: rgb(0, 255, 17)
            - background-color: rgba(255, 255, 255, 0.01)
      - value: open
        styles:
          icon:
            - color: red
    style:
      left: 73%
      top: 90%
      width: 10%
  - type: custom:button-card
    template: background_glass
    entity: sensor.fg135jh_window_rear_right
    name: ' '
    show_header_toggle: false
    state_color: true
    state:
      - value: closed
        styles:
          icon:
            - color: rgb(0, 255, 17)
            - background-color: rgba(255, 255, 255, 0.01)
      - value: open
        styles:
          icon:
            - color: red
    style:
      left: 73%
      top: 31%
      width: 10%
  - type: custom:button-card
    template: background_glass
    entity: sensor.fg135jh_lock_fuel_hood
    icon: mdi:fuel
    name: ' '
    show_header_toggle: false
    state_color: true
    state:
      - value: open
        styles:
          icon:
            - color: rgb(0, 255, 17)
            - background-color: rgba(255, 255, 255, 0.01)
      - value: closed
        styles:
          icon:
            - color: red
    style:
      left: 85%
      top: 39%
      width: 10%
  - type: custom:button-card
    icon: mdi:car-brake-parking
    color_type: icon
    entity: sensor.fg135jh_parking_brake
    show_state: true
    show_name: false
    styles:
      card:
        - width: 150px
        - height: 50px
        - background-color: rgba(0, 0, 0, 0)
      name:
        - transform: translate(50%, -150%)
      state:
        - font-size: 10px
        - transform: translate(100%, -150%)
    state:
      - value: closed
        styles:
          icon:
            - width: 25%
            - color: rgba(0, 255, 17, 0.4)
      - value: open
        styles:
          icon:
            - width: 25%
            - color: rgba(255, 0, 0, 1)
    style:
      left: 5%
      top: 35%
  - type: custom:button-card
    icon: mdi:car-door
    color_type: icon
    entity: sensor.fg135jh_windows_state
    show_state: true
    show_name: false
    styles:
      card:
        - width: 150px
        - height: 50px
        - background-color: rgba(0, 0, 0, 0)
      name:
        - transform: translate(50%, -150%)
      state:
        - font-size: 10px
        - transform: translate(100%, -150%)
    state:
      - value: closed
        styles:
          icon:
            - width: 25%
            - color: rgba(0, 255, 17, 0.4)
      - value: open
        styles:
          icon:
            - width: 25%
            - color: rgba(255, 0, 0, 1)
    style:
      left: 5%
      top: 47%
  - type: custom:button-card
    icon: mdi:car-door-lock
    color_type: icon
    entity: sensor.fg135jh_door_lock
    show_state: true
    show_name: false
    name: sensore da trovare
    styles:
      card:
        - width: 150px
        - height: 50px
        - background-color: rgba(0, 0, 0, 0)
      name:
        - transform: translate(50%, -150%)
      state:
        - font-size: 10px
        - transform: translate(100%, -150%)
    state:
      - value: closed
        styles:
          icon:
            - width: 25%
            - color: rgba(0, 255, 17, 0.4)
      - value: open
        styles:
          icon:
            - width: 25%
            - color: rgba(255, 0, 0, 1)
    style:
      left: 5%
      top: 58%
  - type: custom:button-card
    icon: mdi:car-info
    color_type: icon
    entity: sensor.fg135jh_lock_status
    show_state: true
    show_name: false
    styles:
      card:
        - width: 150px
        - height: 50px
        - background-color: rgba(0, 0, 0, 0)
      name:
        - transform: translate(50%, -150%)
      state:
        - font-size: 10px
        - transform: translate(100%, -150%)
    state:
      - value: closed
        styles:
          icon:
            - width: 25%
            - color: rgba(0, 255, 17, 0.4)
      - value: internal lock
        styles:
          icon:
            - width: 25%
            - color: rgba(255, 255, 0, 1)
      - value: open
        styles:
          icon:
            - width: 25%
            - color: rgba(255, 0, 0, 1)
    style:
      left: 5%
      top: 70%
  - type: custom:button-card
    icon: mdi:map-marker
    color_type: icon
    entity: device_tracker.mercedes
    show_state: true
    show_name: false
    styles:
      card:
        - width: 150px
        - height: 50px
        - background-color: rgba(0, 0, 0, 0)
      name:
        - transform: translate(50%, -150%)
      state:
        - font-size: 10px
        - transform: translate(100%, -150%)
    state:
      - value: home
        styles:
          icon:
            - width: 25%
            - color: rgba(0, 255, 17, 0.4)
      - value: not_home
        styles:
          icon:
            - width: 25%
            - color: rgba(255, 255, 0, 1)
      - value: lavoro
        styles:
          icon:
            - width: 25%
            - color: rgba(255, 0, 0, 1)
    style:
      left: 5%
      top: 85%
  - type: state-label
    entity: sensor.mercedes_geocoded_location
    style:
      transform: translate(-40%, -50%) scale(0.7, 0.6)
      color: lightgrey
      left: 35%
      top: 97.5%

thanks a lot.

hi @ReneNulschDE
I have a error message like that:

Logger: homeassistant.setup
Source: setup.py:192
First occurred: 16:58:13 (1 occurrences)
Last logged: 16:58:13

Setup failed for custom integration mbapi2020: Unable to import component: cannot import name 'US_CUSTOMARY_SYSTEM' from 'homeassistant.util.unit_system' (/usr/src/homeassistant/homeassistant/util/unit_system.py)

could you help me to resolve this pb?
thanks

Hi,
I ā€™ fund the soluceā€¦ this was the version of HAā€¦