Where have i parked my car?

Hi, i wanted to share something i made today :slight_smile:

It’s the first thing i did, and it actually works… so that alone makes me very happy.
I have been using several different things to make it work, and probably there is an even better, easier, more elegant way to do it… if so… please let me know

Back to Topic: I wanted to have an overview on my Hassio Pannel to see where i have parked my car. My first idea was to use the Audi Connect Website and scrape it, but i had no idea how to achieve this since it required a login everytime.

So my workaround uses my Android Smartphone. Everytime i disconnect from my cars Bluetooth, the Phone will create a google Calendar entry with the location. Hassio will then read out the entry, and paste it into the googlemaps api and displays it on the panel.

On my phone im using the APP “Automate” but im sure it will also work with Tasker or any other similar app.

Components im using in Hassio:

google:
  client_id: XXXXX
  client_secret: XXXXX
camera:
  name: Parking
  platform: generic
  still_image_url: https://maps.googleapis.com/maps/api/staticmap?center={{ states.calendar.parking.attributes.location }}&zoom=18&size=500x500&maptype=roadmap&markers=color:blue%7Clabel:P%7C{{ states.calendar.parking.attributes.location }}
  limit_refetch_to_url_change: true

In the app, im basically checking for Bluetooth disconnect, then getting the longitude and latidue, parsing this into an address, and finally sending the full address in a new calendar entry on gmail that hassio can find and use.

5 Likes

Hi, I wanted to use something similar, but how do I get past event information in the calendar?
Or maybe you create an all-day event, but if you have two locations on the same day, how do you know which show?

Thanks

Hi, right now i have set the event to span over 3 days. It seems to always use the newest event.
However, the Calendar Event looks to be not 100% reliable. Im currently trying to upload a txt file with the location to Google Drive and then Download and use this TextFile as Sensor within Hassio.

Problem right now, is that Google Drive always changes the direct link when you change the file.

Could this not be done with IFTTT?
I use it now to track my hours at work and also display a map.

why dont you create a sensor in HA and use the HA api to update the sensor?

1 Like

I have read a lot about the HA Api. Still havent understood it 100%. As i understand it i need the home assistant to be available under a public url for it to work correct?

With IFTTT i have not been able to tell it when i disconnect my car BT to save the location. As i see it only has the trigger “disconnect from any BT device”

Update It works really well now by using the EMAIL Sensor.
My phone sends an email with the location as soon as i leave the car.
Hassio then updates the EMAIL Sensor with the location as state, and displays the correct map :slight_smile:

This solution is much more reliable than the Calendar integration.

1 Like

Nice, can you give us all the configuration needed to make it work?
do you use Automate in android? can you share the automation too?

thanks

It’s an awesome idéa and I would want to implement it aswel! Feel free to post your code, sharing a project without the actual ways of achieving it is not very useful :slight_smile:

i dont think there is any code to post and i think his sharing is very usefull.

  1. he uses an app (and you can pick out any taskerlike app that you prefer to do it) that sends an email as soon as the mobile disconnects bluetooth from his car.
    to do such a thing you need to chose the app of your liking and read their manual to set your settings.

  2. he uses an email sensor to read out emails.
    no new code involved here. go to the components page from HA and install an email sensor (settings on that page)

thats it.

1 Like

No problem to share. I know how it is to read something cool, and then not see the full setup and trying to figure out the missing pieces… this usually gives me a headache
So please find it below:

configuration.yaml

#Where is my car? Actual image of the map
camera:
name: Parking
platform: generic
still_image_url: https://maps.googleapis.com/maps/api/staticmap?center={{ states(‘NAMEOFSENSOR’) }}&zoom=18&size=500x500&maptype=roadmap&markers=color:red%7Clabel:P%7C{{ states(‘NAMEOFSENSOR’) }}
limit_refetch_to_url_change: true

#Gmail integration for Parking Sensor
sensor:

The Automate App is a bit harder to share. So i made a screenshot of it:

3 Likes

much appreciated! Thats exactly whats nice with this forum, cool idéas and a guide for the ones who does not have all the skill to create it by them self.

ReneTode: Really? Whats the point of even having this section, “Hey guys I managed to control the auxiliary heater in my car from HA”

Is that useful for anything or just bragging? Of course people expect to see some kind of how-to, like soldering cables on the remote and plugging it into an arduino, the code for the arduino to simulate a push of the remote and possibly specific events that triggers the heater (like triggering it with your alarm) inside HA.

he did not brag, he told how he did it.

sorry, sometimes i get a little tired of people who want every detailed presented. i like about this forum that there are a lot off persons who are creative and share their ideas of what they have done. i have a lot less appreciation for people who are not willing to use a bit of their own intelligence.

and sorry if that offends you, but i thought you were very rude to say that his posting wasnt usefull.
because it was for people who dont need every detail spitt out for them.

1 Like

One Update to the Automation. This adds a double check: You get in the Car (Bluetooth changes to Car, and then once you leave the car the GPS Location is triggered)

Before it happend that there was a location update everytime Bluetooth changed and you were not connected to Car.

Thank you for all the info.
I was testing Automate and how to create automation for the car. I was able to use HASS Restful Api to update the longitude and latitude to a bluetooth device_tracker for my car directly, without using a sensor. I am using the Automate http request object to call the hass api.

1 Like

What is the code for the “Bluetooth connection Made with the car” trigger?

I’m having a bit of issue here, I have sensor.carmail which has a longitude and latitude set 12.12345, -12.12345 (shown as a state in HA).

platform: generic
name: Parking
still_image_url: https://maps.googleapis.com/maps/api/staticmap?center={{ states.sensor.carmail }}&zoom=18&size=500x500&maptype=roadmap&markers=color:red%7Clabel:P%7C{{ states.sensor.carmail }}
limit_refetch_to_url_change: true

However I keep on getting: “Parking(Image not available)” when I try and look at the camera.

Edit: And… solved.