Mercedes Me Component

@robertklep I am fully aware of that. The system is IN the car. With

going from the home wifi to the car’s 4G modem

I mean that the Pi in the car (further up in the thread the system is explained a bit better) has a separate Pi running OpenWRT and connecting to the home wifi when it’s parked at home and to 4G with a Huawei USB modem when it’s not at home. The car can’t connect to wifi. So when parked at the cabin, if the component has to connect to the server and can’t at a set time it will assume that sync is lost, I believe. How often does it need to connect for this? And can it be set up to try again x number of hours later instead of assuming that sync is lost?

Hi @Mastiff, @robertklep ,

I had added some code to try to reconnect in the past and looks like this code is not good enough. I’m checking for clienterrors and I have to extend this to this error type too.

let me check or feel free to prepare a PR.

BR
Rene

Thanks, that sounds great! I’ll put it right into the car system when you have something ready. And I apologize for my ignorance, but I have no idea what a PR is…

Apologies, I misunderstood the situation :woozy_face:

No worries. :grin: I considered writing an answer to you that was a bit more sarcastic, but decided you couldn’t be expected to have read my message higher up in the thread about how I was building this to get a keyless entry system in the car.

1 Like

Energy Dashboard Integration is one the more often asked questions that I get here, on Github or via private messages. Currently, the MB-API has no valid sensor to integrate directly into the energy management of HA.

Let me explain how I tried to solve it with standard HA functionality and the changes to the charging_power sensor integrated in v0.6.5. The charging_power sensor reports the values in kW now.

However we need the values in kWh to use it in the energy dashboard. There is a standard sensor in HA that calculates the “Riemann sum”.

Configuration.yaml:

sensor:
  - platform: integration
    source: sensor.XXXX_charging_power

This will create a new sensor “sensor.sensor_XXXX_charging_power_integral’” and the value is in kWh.

Means you can use this sensor then in your energy dashboard.

Let me know your opinion if this fits to your needs.

I have published a new version 0.6.6.

  • In case the MBAPI is not reachable on HA-start, the component will now retry to load in the background (reported in HA-Community)

Thanks to @Mastiff for reporting and testing the release in the last 14 days.

This is just a bugfix release, so still no option to change the interior lightning… (but yes, may car interior lights are changing already based on unread emails - I hate this feature :slight_smile: )

1 Like

Glad to help, and honestly I think I’m probably the only one, or at least one of the few that would ever have this problem. So thank you! :+1:

Is there a way to detect if a key is in or near the car? Or isn’t that the integration can find?

Hi @Mastiff , this is AFAIK not possible.

OK, thanks. It was worth a shot. It would make it easier with my ESPresense setup just to set it not to lock the car when a key was in it or near it.

Hi guys,

First of all, thanks @ReneNulschDE for creating, maintaining and making this integration evolves.
I’ve quite new to HA, yet I managed to have your Mercedes Me Component working properly, and it rocks.

I just can’t figure what the AuxHeat switch is supposed to do. When I’m trying to switch it on, it just get back to off after a few seconds.

Just to give some insights, I have a CLA Shooting Brake 250e, so, compatible with preheat (I’m actually doing it with the Mercedes Me App on iOS).
Log viewer is giving me this (I’ve anonymized the chassis number) :

2022-04-22 15:50:22 WARNING (MainThread) [custom_components.mbapi2020.client] Car action: AUXHEATSTART failed. error_code: RIS_COMMAND_UNAVAILABLE, error_message: Command is not supported in this vehicle

Any clue ?
Thanks a lot :slight_smile:

Got some issues with this wonderful integration today.

Any ideas?

This error originated from a custom integration.

Logger: custom_components.mbapi2020.oauth
Source: custom_components/mbapi2020/oauth.py:243
Integration: MercedesME 2020 (documentation, issues)
First occurred: 16:36:43 (4 occurrences)
Last logged: 16:37:26

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')

Nevermind. After deleting and reinstalling the integration is back on track.

I just had the same issue.

To fix it without a reinstall, I removed the .mercedesme-token-cache file (in the HA root folder) and restarted HA. It asked me to reauthenticate, and now it’s working again.

Good tip :ok_hand:

Hi @mpontie ,

thanks for the flowers. Just ignore AUX_HEAT switch. Your car has the preheat and not the aux_heat option. There is a HA-Service “MercedesME 2020: preheat_start” - you can integrate this service with a button or in automations for example.

Note to myself: Add the capability check to the switch…

And btw: For some cars the name preheat is misleading - preclimate would be better as it can cool down your car too…

Thanks @ReneNulschDE, and indeed, in french the name, is more like “pre-climate”.
Super cool feature actually.
I’ll get a switch to active the service then, thanks for the info.
Do not hesitate if you need to test anything in France on my CLA SB :slight_smile:

Hi Guys, Not hijacking the topic but more an addition. A couple of years ago I created this small card for this integration. Initial set-up is a bit tricky with all the Mercedes entities. SInce a couple of weeks I am using a new Dashboard for HA, and it is fully automatic and can be edited within the gui. Really nice. Another advantage is that it can use Blueprints for cards and more pages as well. Currently someone in the enthusiasts group (@Bourner) converted this Mercedes card to a Blueprint. Making it really easy to have this card up and running. I will keep you guys posted on this development. (link to the dashboard V3 is the one to use-> GitHub - dwainscheeren/dwains-lovelace-dashboard: An fully auto generating Home Assistant UI dashboard for desktop, tablet and mobile by Dwains for desktop, tablet, mobile

Also some screenshots. The template only needs the licence plate number to fill all the entities in the card currently (next to the installment of the excellent @ReneNulschDE Mercedesme integration). I will update you guys here when finished. If interested just join the discord of this dashboard


3 Likes

So, these guys at Dwains Dashboard moved fast. special thanks to @Bourner to make this possible. please have a look at Dwains Dashboard and have a look at this blueprint card. Talk to you guys later!

2 Likes