hdurdle / MMM-BMWConnected

Magic Mirror Module to display data from BMW Connected drive for your car.
MIT License
7 stars 11 forks source link

Multiple vehicles #2

Closed jansog closed 2 years ago

jansog commented 4 years ago

Thanks for a great plugin. I have multiple vehicles in bmw connected. Is there any way I can select what vehicle to be displayed?

I also have one electrical only vehicle. Any plans for an ev-only parameter?

Kind regards

Jan

jannekalliola commented 2 years ago

For electric only cars, check out my fork which allows you to select which information the module shows: https://github.com/jannekalliola/MMM-BMWConnected

kupraez commented 2 years ago

This module is a big deal. Is it possible to get two vehicles displayed? My wife has a BMW too, but i can't solve a solution for both vehicles!

nuttersrest commented 2 years ago

@kupraez

The node_helper.js for this module and all the forks I have seen, will only ever display the first vehicle you have. The reason for that is the coming back from BMW is in an array and the node helper code highlighted below vin = json[0].vin;

The [0] part pulls the first vehicles data back, if you change that to [1] it should in theory pull details on your second car back. Though I only have one BMW so cant test this.

The simplest way to get two displayed would be to duplicate the modules, create a MMM-BMWConnected2 folder and copy all the files from first folder to this new one. Then rename the main module to be MMM-BMWConnected2.js and ensure any references in other files are updated to point to the alternative. Then once you have two entries displaying for the same care, go into one of them and edit the node_helper.js and change the 0 to 1 as above.

Though for whatever reason my module has stopped working as it looks like BMW have changed some URLs and stopped the authenticating working for me.