Alright, now I have another issue. When I restart it seems to sometimes wipe out the integration and I have to click reload on the configuration at which time it re-appears, however, the entities are gone again. Seems to be sporadic. I’ll continue to look to see if I’m doing something wrong.
Here’s what I get. This is after updating to the latest version.
2022-01-30 16:51:46 INFO (MainThread) [custom_components.mbapi2020] Removing car from device registry: None, MYVIN
Thanks @jackgithome,
I need more time to make this cleanup right. I have published a version 0.6.2 and disabled the cleanup completely.
BR
Rene
Hi Rene,
Thanks for your hard work. Been using this integration for a while now.
An observation: Is it just me or has the attribute for outside temperature (outsideTemperature) disappeared from the Odometer Sensor?
Hi @Recon ,
I checked my logs and the MB-API stopped reporting outsideTemp on 13-01-22 around noon. This is in line with other API changes like missing liquid_range_critical.
However, I saw few new properties too. Let me check what value these could bring.
Thanks BR
Rene
Hello Rene,
Wirkt die Mercedes Me with model 230 aus 2008/9?
danke fuer ihr antwort,
Nico
Would it be ok to change the numerical states to string, so for example, instead of Ignition state being 1, 2 ,3, … , it would be the equivalent in Description_short.
Looking at the history in ha, this is the only integration that uses numbers. all the others have the correct value, for example, the weather says “cloudy”, or “sunny”, and not 1, 2, etc.
While it would break the current automations, it would be better for the future and for consistency, and avoid having to constantly look for the documentation to see what number 4 means in the ignition state for example.
Top: Other integrations
Bottom: This one
Hi,
2008? - an oldtimer from car connection and apps perspective? I would assume no.
BR
Rene
ALL Readers - please share your comment! My initial answer on github was:
Currently, I do not have a list of all the potential string-values for all the attributes. This would add additional problems from an translation perspective too. And, it would break all the stuff that the users have build before. Therefore, I’m not a fan of doing this. Why do you not start a discussion in the HA-Community for this integration.
Hi !
I just installed this great component. Just had to get my GLC to Home Assistant. However I think there’s a minor error in units.
Component reports Charging power as kWh, that’s energy consumption.
That should be power as kW. (Like Mercedes Me pp reports)
(Screenshot were made at a bit different time, power changed momentarily so don’t count that difference here)
Thanks for the info Rene, then it was just not me.
Looking forward to see what the new properties will add
BR
Recon
I published a bugfix release v0.6.3 to solve the “protobuf” issues with the appletv integration in HA2022.02. This is not a longterm fix for sure - looks like I’m in the dependency hell now too
Hi Nico,
don’t understand your link? This component has no relation to the odb interface or the related old MBme adapters. I’m focussed just on the cloud integration.
If I remember correct the author of the iobroker MB integration tried to integrate the old odb adapters. https://github.com/TA2k/ioBroker.mercedesme
BR
Rene
Hi,
thanks for reporting this error. I’ll change it in the next release to kW.
BR
Rene
commit: https://github.com/ReneNulschDE/mbapi2020/commit/c102beacff3c1c42c50aa560cb74870d47727199
Hi, sorry for late reply. Here is how I setup the Google sheet integration: Writting sensors' values to Google Sheets - #85 by otmezger
One problem is that I have to recreate the token once a week, but can live with it.
I have a automation that triggers when sensor.charging power is above 0.1, the action:
service: shell_command.record_sensors_startcharge
data:
sensor01: START_CHARGE
sensor02: ‘{{ now().strftime("%Y-%m-%d") }}’
sensor03: ‘{{ now().strftime("%H:%M") }}’
sensor04: ‘’’{{ states(’‘sensor.carlocation’’) }}’’’
sensor05: ‘{{ state_attr(’‘sensor._range_electric’’,’‘soc’’) }}’
sensor06: ‘{{ states(’‘sensor._odometer’’) }}’
sensor07: ‘{{ state_attr(’‘sensor._range_electric’’,’‘chargingPower’’) }}’
The
shell command in file /config/includes/shell_commands/record_sensors_sc.yaml:
record_sensors_startcharge:
python3 /config/includes/shell_scripts/gsheets_write_startcharge.py {{sensor01}} {{sensor02}} {{sensor03}} {{sensor04}} {{sensor05}} {{sensor06}} {{sensor07}}
And the specific rows in the shellscript:
sensor01 = sys.argv[1]
sensor02 = sys.argv[2]
sensor03 = sys.argv[3]
sensor04 = sys.argv[4]
sensor05 = sys.argv[5]
sensor06 = sys.argv[6]
sensor07 = sys.argv[7]
range_ = ‘Charges!A2:A’ # TODO: Update placeholder value.
value_input_option = ‘USER_ENTERED’ # TODO: Update placeholder value.
insert_data_option = ‘’ # TODO: Update placeholder value.
value_range_body = {“values”: [[sensor01, sensor02, sensor03, sensor04, sensor05, sensor06, sensor07]]}
And then I have a end charge command/script that triggers and logs some information on next line in the sheet. I have some calculations done there also
I have solved this in the other direction via a google sheets app script and the HA history Rest API. So Google sheets is asking HA to get all records.
function getCarHistory() {
var ha_longlive_access_token = "eyJ0eXAiOiJK....";
var ha_url = "https://URL_TO_HA";
var entity_id = "device_tracker.REPLACE_device_tracker"
var plusOptions = {
"headers" : {
"Authorization" : "Bearer " + ha_longlive_access_token
}
};
var url = ha_url + "/api/history/period/2020-02-05T08:00:00?filter_entity_id=" + entity_id + "&end_time=2022-12-31"
var response = UrlFetchApp.fetch(url, plusOptions);
//Logger.log(response.getContentText());
var results = JSON.parse(response.getContentText());
var output = []
var lastitem = ""
results.forEach(function(list,i) {
list.forEach(function(elem,j) {
//Logger.log(elem["entity_id"])
var entity_id = elem["entity_id"];
var state = elem["state"];
var latitude = elem["attributes"]["latitude"];
var longitude = elem["attributes"]["longitude"];
var timestamp = elem["attributes"]["timestamp"];
var last_changed = elem["last_changed"];
if (lastitem != timestamp) {
output.push([entity_id, state, latitude, longitude, timestamp, last_changed]);
}
lastitem = timestamp
});
});
var len = output.length;
//Logger.log(len)
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
// clear any previous content
sheet.getRange(2,1,3000,6).clearContent();
// paste in the values
sheet.getRange(2,1,len,6).setValues(output);
}
First of all thanks for this great integration!
I have two cars registered in the mercedesme app, but only one appears in the Home Assistant.
Is that a known limitation of the integration at the moment or am I doing something wrong?
Thanks!
Hi @florian-forster ,
the integration supports multiple cars as long as they are available in one single account (secondary driver). Not supported are the older Bluetooth MB-Me devices.
Please give us more information like your region, logs, car config. You can enable the logging on debug level via the HA-config (see readme on github) and you can also enable the “Save debug messages” in the options of the integration. Restart HA, wait 2min and share the logs via private message if you prefer.
BR
Rene
Hi @ReneNulschDE
first of all, many thanks for this great custom component.
I’m quite new to it but it seems to be working nicely with my S206.
However, after a restart of my HA system, all the entities are “not available” afterwards. As I’m doing nightly automated backups of my HA VM where this one gets stopped and then freshly booted after backup has completed, it’s a bit a pity that for some reason the integration does not work anymore.
Using your latest version on HA 2022.2.9
Any hints are much appreciated! Thanks.