Dielee/volvo2mqtt

Vehicle image data conflicts for multiple cars

Closed this issue · 3 comments

Describe the bug

  • There are two vehicles associated with my Volvo account, the volvo2mqtt integration finds both vehicles and creates the expected entities
  • The image.volvo_{vin}_exterior_imageand image.volvo_{vin}_interior_image entities are duplicated
    • One vehicle is mild-hybrid, the other is BEV. They are different colors. These differences are reflected in all the various entities except that:
    • The entities for both vehicles have the same interior / exterior images
    • After destroying / recreating the container a few times, which vehicle's images "win" is non-deterministic (I'm guessing it's a race condition where the first vehicle image to resolve gets set as the entity value for both)
    • The API responses in the logs indicate that the response values are correct (e.g. if I visit the data.images.{exteriorImageUrl,interiorImageUrl} URLs in the API response, they are accurate for each vehicle)

To Reproduce:

Steps to reproduce the behavior:

  1. US market (this integration just started working again now that Volvo API access is opening up)
  2. Run container, inspect entity values from within HA
  3. Observe that image.volvo_{vin}_exterior_imageand image.volvo_{vin}_interior_image entities are the same for both vehicles associated with my account

Expected behavior:

Each vehicle should have different exterior/interior photos based on entities. I have examined the logs, and the API responses point to the correct image URL for each vehicle (for both exterior and interior images) so this seems like a bug in the logic to transform Volvo API responses into MQTT messages

Screenshots:

If applicable, add screenshots to help explain your problem.

Version info:

volvo2mqtt at version sha-75db5da, running in a docker container alongside HA

Logs:

Redacted, I'd rather not share private vehicle data.

Oct 27 21:21:12 volvo2mqtt [1] - DEBUG: {
  "data" : {
    "vin" : "<vehicle_a>",
    "images" : {
      "exteriorImageUrl" : "<this value is accurate for this vin>",
      "internalImageUrl" : "<this value is accurate for this vin>"
    },
  }
}
Oct 27 21:21:12 volvo2mqtt [1] - DEBUG: {
  "data" : {
    "vin" : "<vehicle_b>",
    "images" : {
      "exteriorImageUrl" : "<this value is accurate for this vin>",
      "internalImageUrl" : "<this value is accurate for this vin>"
    },
  }
}

So it's working for you, now ?

Found the issue. Should be fixed in v1.10.5

Confirmed that v1.10.5 works as expected, thanks for your help!