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.
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.
@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:
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) [?:?]
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
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).
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.
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.
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.
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?