04-13-2021, 01:40 PM | #1 |
Lieutenant
250
Rep 581
Posts |
[SOLVED] BMW API techy question - BMW Custom alerts
My BMW or BMW Connected app seems to have continuous data from my car’s location. I wish the BMW app itself, had a way to setup notifications when my car moves away from its current location.
Question is does BMW provide a public API that can be used to get these information? I want to build an app that will ping the BMW server every minute and get the car’s location and I can set to send a notification or critical alerts when my car moves away from my phone. UPDATE: I was able to achieve this myself through an app. Refer to this post for details https://g05.bimmerpost.com/forums/sh...72&postcount=7 Last edited by jonatious; 04-19-2021 at 12:25 PM.. |
04-13-2021, 01:53 PM | #2 | |
Lieutenant Colonel
1163
Rep 1,773
Posts |
Quote:
|
|
Appreciate
0
|
04-13-2021, 04:18 PM | #3 |
Private First Class
70
Rep 131
Posts |
There is an automation available for home assistant. Since this is open source you should be able to check that source for more info on the API. Or you can simply use home assistant for what you plan to do.
https://www.home-assistant.io/integr...nnected_drive/ |
Appreciate
1
jonatious249.50 |
04-13-2021, 04:42 PM | #4 |
Lieutenant
262
Rep 504
Posts
Drives: 2019 X5 xDrive40i
Join Date: Feb 2013
Location: California
|
Happy to see another engineer with similar interest! If you need hand would love to participate on this
|
Appreciate
0
|
04-13-2021, 06:41 PM | #5 | ||
Lieutenant
250
Rep 581
Posts |
Quote:
Quote:
Sure will let you know |
||
Appreciate
0
|
04-15-2021, 04:35 PM | #6 |
Private First Class
39
Rep 115
Posts |
I would assume you could probably reverse engineer their api as well without that much effort. The question is whether or not it's a violation of their ToS and whether or not they monitor for it or limit connections to known signatures or some other method of validation on the inbound which might make your attempt moot - but no way to know without trying
Curious what you learn. |
Appreciate
1
maxim38rus11.00 |
04-18-2021, 06:22 PM | #7 |
Lieutenant
250
Rep 581
Posts |
I was able to reverse engineer the open source app.
https://github.com/bimmerconnected/bimmer_connected I spent a good time on Home Assistance understanding what it is. Looks like it is a popular automation tool and seems pretty powerful and has a wide variety of uses. https://www.home-assistant.io/ https://www.home-assistant.io/integr...rive/#services Anyway, instead of building the tool myself after reverse engineering, I felt it is safe and easier to just reuse this source. I did the following and now, I have the locations of my car when moving saved in a database for future and I have setup alerts to send me a text message to tell me when my car leaves home and when it moves from a static location(say after I stop for overnight at a hotel). NOTE: This might not be trivial for non techy person. This is what I did 1. Setup Home Assistant on AWS EC2 micro instance - https://www.home-assistant.io/installation/linux 2. Integrate BMW Connected to the Home Assistant app with your login to get your car connected 3. Setup REST API connection and be able to update the car’s state and get the location through the bimmer_connected integration. 4. Setup a simple console app that pings the home assistant through a HTTP request for the location of my car 5. Save the location to a DB and send alerts if necessary based on the last location and current location. Let me know if you need any assistance to set up such things. A small pic of the alerts I got today attached. |
Appreciate
7
|
04-19-2021, 10:23 AM | #8 |
X5 Enthusiast
459
Rep 762
Posts
Drives: 2021 X5
Join Date: Aug 2020
Location: Neighbourhood of Santa
|
This is amazing! Thanks for providing the details. I don't have enough basic knowledge to set this up, but I am sure a lot of experienced enthusiasts will benefit from your insights.
A friend of mine - another forum member- and I was brainstorming somewhat similar automation goals for dashcam power on/off. We installed a remote controlled (RF 433 mHz) relay to cut the dashcam power on/off from a battery-pack. When we don't need to run the dashcam we simply cut the power to the dashcam using the remote controlled relay(instead of unplugging the cam or switching off the battery pack manually). We were thinking if we could automate this manual remote controlled on/off process, perhaps using the geo/WiFi location, NFC tagging etc. and also to get some sort of confirmation that inform us about the power status of the cam (on/off), but my software/API knowledge is rather limited. I'll study your instructions above and see if I could learn a thing or two. Nonetheless, greatly appreciated you sharing the technical steps.
__________________
2021 X5, Excellence, M Sport, DHP, DAP, RSE, MW, Merino.
|
Appreciate
1
jonatious249.50 |
04-19-2021, 12:22 PM | #9 | |
Lieutenant
250
Rep 581
Posts |
Quote:
I am also planning on setting up another alert that will alert me when the doors are unlocked for too long, in case I forget to lock my car doors. Any other ideas are also welcome I feel great having the ability to setup any kind of monitors or alerts on my car all the time |
|
Appreciate
0
|
04-21-2021, 01:32 AM | #10 |
Lieutenant
250
Rep 581
Posts |
I love the automation power I have on hand. I have set alerts on car’s non CLOSED states for windows, doors, hood and trunk. I forgot to fully close my window today and got this critical alert on my phone
|
Appreciate
4
|
04-24-2021, 01:12 AM | #12 |
Lieutenant
250
Rep 581
Posts |
Updating one last achievement I wanted to do. Plotting my cars recent locations on a map
|
Appreciate
5
|
04-24-2021, 09:07 AM | #13 | |
Private First Class
76
Rep 194
Posts |
Quote:
Would it be possible to do this for a car that has all the hardware but is in a region where connected drive is not active (my car is available on MYBMW app but I don't have the updated location anymore)? |
|
Appreciate
0
|
04-24-2021, 09:45 AM | #14 | |
Lieutenant
250
Rep 581
Posts |
Quote:
|
|
Appreciate
0
|
04-24-2021, 11:05 AM | #15 | ||
Private First Class
76
Rep 194
Posts |
Quote:
I think the connection isn't established as the car isn't in a location served by Connected Drive. For illustration, the navigation in the car doesn't have the updated maps in the country where I'm but when I zoom out, I see the car recognize where it is on the world map. Would you be willing to help me try this out? |
||
Appreciate
0
|
04-24-2021, 12:27 PM | #16 |
Lieutenant
219
Rep 480
Posts |
Nice to see more automation fans in here! :-)
I've wrote a script that will fetch and email the total milage at the end of every months obtained from the api. |
04-24-2021, 12:59 PM | #17 |
Lieutenant
250
Rep 581
Posts |
|
Appreciate
0
|
04-24-2021, 01:01 PM | #18 | |
Lieutenant
250
Rep 581
Posts |
Quote:
|
|
Appreciate
0
|
04-25-2021, 12:28 AM | #19 | |
Lieutenant
219
Rep 480
Posts |
Quote:
https://pypi.org/project/bimmer-connected/ |
|
Appreciate
3
|
05-31-2021, 10:45 PM | #21 |
Lieutenant
250
Rep 581
Posts |
You definitely can.
https://www.home-assistant.io/installation/raspberrypi |
Appreciate
1
hdahman236.50 |
Post Reply |
Bookmarks |
Thread Tools | Search this Thread |
|
|