Derive Compass Direction from GPS

Hi,

I’m thinking about what automations I can make that are useful for my car. I’m wanting to detect what direction I’ve parked. This should be easy enough as I can trigger an automation when Android Auto turns off. I should also have the GPS data from the phone, however I’m not sure how best to derive a compass direction from that.

I’m thinking if I combine that data, along with what street I’ve parked on, I can create alerts as to when I’m on the wrong side of the street for street cleaning.

Thanks for any tips or advice!

EDIT:
I think I have a solution, I wanted to use the “course” attribute from my android device, looks like this will work, I just always saw it set to 0, viewing the history of that attribute shows that it’s not always 0

Has this been working ok for you?

I’m interested in this as well, though I’m not sure I can rely as heavily on Android (auto or mobile) since my wife carries an iOS device, we have two vehicles that we use interchangeably, and only one of those has any “smart” features to it. I think I could probably make it work from the two phones with slightly different approaches, but I haven’t looked that closely at the sensors available from icloud3 (yet)…

I care about this primarily in front of my own home, where they hand out parking tickets for street sweeping – but only on one side of the street, depending on which week of which month it happens to be.

I’ve been thinking about mounting an esp32 with wifi and maybe a small lipo battery in each car, figuring that these devices might charge while driving, then upon parking though the 12v would cut out (I could wire them into an always-on circuit but if prefer to skip that.). Then (hopefully) they’d see and connect to the home Wi-Fi from outside, upload 1+ sensor readings, then call it quits.

I don’t really want to use a dedicated device though, so I’ve been mulling over things ranging from using GPS data, to some image analysis on the front door camera…
Overkill, maybe hardz but also maybe fun to try out?

The car do not need to have any smart capabilities, you just need a Bluetooth device in it.
Then you trigger an automation on the phone connected to and disconnected from the Bluetooth device.

And instead of using a compass then I suggest you use the GPS coordinates to open Google maps with them.
That way you get a map to find your way back to the car.