MyBMW Binding

Thanks for your work - I can confirm as well that most channels are working again (PHEV: 530e)
That’s great! :ok_hand:

There are two channels which are not showing data anymore. This is no complain, just feedback! :slight_smile:

status#charge-info and range#hybrid did work with old binding, now it is showing UNDEF and -1
But range#electric is working well.

Again: thank you very much for your work! :slight_smile:

Best, Kai

Hi Kai,

Thanks for the feedback.

To be honest I was expecting this. Could you please share your fingerprints with me?

1 Like

Top job Martin, like others have said your efforts are really appreciated.

I use the code below to transform Metres into Miles at present, it maybe of use to others.

(function(x) {
    return (parseInt(x)/1609).toFixed(1) + " Miles";
})(input)

I sent the log via PM to you. Hope it helps.
regards, Kai

1 Like

Hi Garry,

Thanks for sharing. In the bimmer_connected project I saw that you can ask the API to return miles and gallons. I’m planning to implement the same so you can configure it in the bridge.

1 Like

I don’t think that’s required. You can simply create a default stateDescription for the item you link to the channel and put another unit on it. OH will do the converison for you. Instead of %unit% in the state description, put km or mi (for miles). The channels are already defined with UOM.

1 Like

Hi @Mherwege, I just changed the base settings of Openhab to imperial and now the values are converted to ft instead of miles :smiley:

Yes, because that is the base unit in imperial. But put mi in the state description of your item, and it should show miles.

1 Like

@MartinOpenhabFan : By the way - if anybody has problems with some remote commands - the options for the remote command are misspelled in the docs as of 2022-01-17. I created a diff here:

The corrected ones are:

  • light-flash (was: flash-lights)
  • horn-blow (was: horn-low)

Thanks for the binding!

Thanks. I mentioned this im my long post and fixed it in the beta

Hi,

thanks for all your feedback and contribution. I uploaded a new version to GitHub - martingrassl/openhab-mybmw with some fixes.

Thanks,
Martin

I have also this same issue with my G20 330e. I uploaded the new jar and restarted OH3.4 but these two channels are not working.

Many thanks for your great work.

Many thanks for your efforts and great job Martin, really appreciated!

Following your installation description, I have reinstalled the binding getting it as a bridge online immediately.

Unfortunately, the thing is showing an UNKNOWN status, the channels are not working, the log the following entries:

2023-01-19 14:15:03.167 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.StringIndexOutOfBoundsException: begin 0, end 10, length 0
at java.lang.String.checkBoundsBeginEnd(String.java:3319) ~[?:?]
at java.lang.String.substring(String.java:1874) ~[?:?]
at org.openhab.core.library.types.DateTimeType.(DateTimeType.java:106) ~[?:?]
at org.openhab.core.library.types.DateTimeType.valueOf(DateTimeType.java:123) ~[?:?]
at org.openhab.binding.mybmw.internal.handler.VehicleHandler.selectService(VehicleHandler.java:549) ~[?:?]
at org.openhab.binding.mybmw.internal.handler.VehicleHandler.updateServices(VehicleHandler.java:535) ~[?:?]
at org.openhab.binding.mybmw.internal.handler.VehicleHandler.updateVehicleStatus(VehicleHandler.java:326) ~[?:?]
at org.openhab.binding.mybmw.internal.handler.VehicleHandler.triggerVehicleStatusUpdate(VehicleHandler.java:254) ~[?:?]
at org.openhab.binding.mybmw.internal.handler.VehicleHandler.lambda$9(VehicleHandler.java:213) ~[?:?]
at java.util.Optional.ifPresentOrElse(Optional.java:201) ~[?:?]
at org.openhab.binding.mybmw.internal.handler.VehicleHandler.lambda$7(VehicleHandler.java:206) ~[?:?]
at java.util.Optional.ifPresentOrElse(Optional.java:201) ~[?:?]
at org.openhab.binding.mybmw.internal.handler.VehicleHandler.getData(VehicleHandler.java:205) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:829) [?:?]

vehicleDriveTrain: COMBUSTION.

Any idea what the issue could be?

Hi Martin,
Many thanks for your efforts.

Since I’m not too experienced with OH3 it took me a while to figure out how to install the new addon
(maybe for others who are also wondering:
openhab commandline bundle:list, bundle:uninstall and bundle:install/bundel:start will do the job - just placing the .jar to addons folder did not work for me)
Second, I scrubbed the json dB files from all BMW entries manually (after annouying experiences getting rid off things, models and items via UI).
Finally, reestablishing the thing, model and items where according to cook book. However, existing widgest had to be linked again to the new items.
I own currently an BMW X3 xDrive30e, PHEV, the available data seems to be OK, at least I haven’t noticed any issues so far.

So, again, good work, well appreciated and many thanks,
Udo

1 Like

Hi Josef,

it looks like the data of your services have an empty date which can’t be formatted properly. Without having the fingerprints, I can only assume that. I uploaded a new version to GitHub - martingrassl/openhab-mybmw which should fix your issue. Anyhow, if it is not working afterwards, I would appreciate if you could enable debugging and share with me the logs (happy to get them via direct message).

Thanks,
Martin

Many thanks for the update.

status#charge-info is still showing UNDEF and range#hybrid is partly fixed but the value is the same as for fuel range.

EDIT: I think that the range#fuel is wrong because it increases while charging up my car.

Hi Martin,

sometimes the binding changes the following Channel values to UNDEF until the next update.

location#gps
location#address
location#heading

Example:
Update at 3 pm receives the normal values from the car.
Update at 4 pm receices UNDEF for the three Channels.
Update at 5 pm receives the normals values again.

The car wasn´t moved in the time between these updates and there was no interaction from my side through the MyBMW app.

Cheers
Michael

I updated the jar-file this morning and I’m now charging up my car. It seems that fuel range is increasing and it shows same range as for hybrid range.

Hi Jari,

thanks for the information. At least from what I could see from another PHEV fingerprint, it looks like the API sends the same range for fuel range as well as for whole range. The electric range isn’t added. But I didn’t know that the fuel range increases. If you like I can take a look at your fingerprint data. My next comment will show how to get the fingerprint more easily then before.

Thanks,
Martin

Hi Michael,

unfortunately I didn’t see this behavior before. I added a new channel “last-fetched” which shows when was the last successful fetch of the data. The last-updated channel shows the last change initiated by the car. Maybe if you face this issue again you can check if the last-fetched timestamp is more than 5 minutes ago?

Thanks,
Martin