-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Entities not created if FIN and VIN do not match #35
Comments
Hi Jonathan, thanks for this detailed analysis. You're right, this procedure is needed for the US only. I tried different ways in past to overcome this issue with the different VIN/FIN but never came to a stable solution without breaking changes for all the existing US users. Let me check it again and it is great that you can test possible solutions. Are you a member of the HA-community? If yes, we could use private messages as a comms platform. could you add the logs after
Normally, the code should wait for 30 seconds (4390 and 3825 are the wait times in ms) and then create the entities. BR |
Hi Rene, I see your point. It might be risky to make improvements, but I can test if any ideas work for at least 1 car in the US. It's a start, right? I ran through initialization again to get more log information, but after waiting a few minutes, the only messages I see in the logs are Good idea to chat on the HA-community. My handle is |
Fix implemented with 6849673 needs review and rework as we create unneeded entities and sensors. current fix focus is on preventing breaking changes |
I ran into an issue when setting this up where my car would be added, but there would be no entities. I managed to trace this down to my FIN and VIN being different, and the data not being loaded via the FIN. I am in the US, which I suspect is a factor in this.
The good news is that there is already a workaround for anyone who runs into this. By turning on debug logs in my HA configuration, the unrecognized FIN is reported. This FIN can be copied into the "VINs excluded" list in the integration options in HA. Restarting the integration and HA will let the car data load complete, and subsequently the entities will be created.
I am wondering if there is a way to update the logic so this will just work without a new user needing to turn on debug logging to figure out that they need to add the FIN to the exclusion list.
As I looked into this, I noticed that
async_setup_entry()
in__init__.py
uses the FIN for everything in this block, which adds a first car to the list of cars using the FIN. Later, a "second" car is added by the vin inClient._process_assigned_vehicles()
inclient.py
, but this is really the same car. The FIN seems to never be able to complete entry setup, so this block at the end ofClient._process_assigned_vehicle()
always setsload_complete
to False if at least 1 car does not complete, and therefore never executes the callback_on_dataload_complete()
that points toMercedesMeContext.on_dataload_complete()
in order to create the entities.Here is my HA log with the logger set for debug and filtered to only show items from mbapi2020. I've redacted anything that might have been personal information. Critically, I noted which items were the
<FIN>
and which were the<VIN>
for the single vehicle I have and confirmed via the debug json output ofmasterdata
inasync_setup_entry()
in__init__.py
.:I am unsure what the best way to address this would be, but I hope this is helpful. I can test any changes or get any more data needed, especially if a US tester is required.
Very cool project. Danke!
The text was updated successfully, but these errors were encountered: