DevSecOps

Well-Known Member
First Name
Todd
Joined
Sep 22, 2021
Threads
69
Messages
4,741
Reaction score
11,510
Location
Sacramento, CA
Vehicles
'21 Audi SQ5 / '23 Rivian R1T / '23 M3P
Occupation
CISO
Country flag
Preface:

I'm writing this thread so that we can share some of the home assistant automations (only for the MME please) with other members. This can be a place to organize all of those automations and for others to glean info to help them improve on what they aleady have. I'll update the index on the first page with links to other members posts so that they can be easily found throughout the thread. If you don't have home assistant or don't know what it is, you can learn more here.

Guidelines for posting:
  • Please use the code brackets for yaml. You do this by using [*CODE=yaml*] without the asterisks (*)
  • Please post pictures of the integration notification if it triggers alerts
Index:

Suggestions:
  • Using the FP and your phone device trackers you could create an alert if your car is in motion without you in it, assuming you're the only one who drives it. That could alert you to theft.
Side note:

If anyone here is interested in home automation and seriously needs help or suggestions, send me a DM. I would be more than happy to help if I can. I use a number of home automation services including:

- Home Assistant
- Hubitat
- Frigate
- CompreFace
- Double Take
- Deepstack
- Node Red
- MQTT
- Axis (Entry Control and License Plate Reading)

And many, many different IOT devices connected to the aforementioned services.
Sponsored

 
Last edited:

mmap

Well-Known Member
Joined
Oct 9, 2021
Threads
5
Messages
199
Reaction score
324
Location
Maryland
Vehicles
2022 MachE Route1
Occupation
Software Guy
Country flag
I have a JuiceBox also connected up to HA. It reports its status (standby, charging, plugged) as a sensor. And using the basic fordpass through HACS.

This pushes a phone notification (to `mobile_app_pixel`) at 5:44pm again at and 6:58pm if the car is under 60% and not plugged in. (With ER and a short-ish commute, I don't need to plug in every day.)

YAML:
alias: Car Charge Reminder
description: ''
trigger:
  - platform: time
    at: '17:44:00'
  - platform: time
    at: '18:58:00'
condition:
  - condition: state
    entity_id: sensor.charging_status
    state: standby
  - condition: numeric_state
    entity_id: sensor.fordpass_elveh
    attribute: Battery Fill Level
    above: '0'
    below: '60'
action:
  - service: notify.mobile_app_pixel
    data:
      title: EVSE Reminder
      message: Plug in your car!
mode: single
The screenshot is not all that interesting, but it gets the job done:
Ford Mustang Mach-E Home Assistant Automations - Show them off!!! Screenshot_20220702-203104
 
Last edited:
OP
OP
DevSecOps

DevSecOps

Well-Known Member
First Name
Todd
Joined
Sep 22, 2021
Threads
69
Messages
4,741
Reaction score
11,510
Location
Sacramento, CA
Vehicles
'21 Audi SQ5 / '23 Rivian R1T / '23 M3P
Occupation
CISO
Country flag
Nightly charge cable not plugged in notification

@mmap did something similar, but different to what I did. Here's an automation for a nightly reminder using chargepoint. Note that for people who don't have an EVSE integration you can also use the attribute to ELVEH which is Plug Status, where 0=unplugged.

Here's some of the key takeaways from my version:
  • Only alerts when at home. I have to be home and so does the car
  • Notifies to my phone and to an ecobee thermostat using voice
  • Continues to remind me until I go and plug it in
YAML:
alias: EVSE Not Plugged In - Announce
description: ''
trigger:
  - platform: time
    at: '22:00:00'
condition:
  - condition: state
    entity_id: device_tracker.fordpass_tracker
    state: home
  - condition: state
    entity_id: device_tracker.pixel_6_pro
    state: home
  - condition: state
    entity_id: sensor.cph50_charging_cable
    state: Unplugged
action:
  - service: notify.mobile_app_pixel_6_pro
    data:
      message: Please plug-in the car for nightly charging!
      title: Car is unplugged!
      data:
        notification_icon: mdi:ev-plug-ccs1
        color: green
  - repeat:
      until:
        - type: is_motion
          condition: device
          device_id: 12345
          entity_id: binary_sensor.garage_motion_motion
          domain: binary_sensor
      sequence:
        - service: notify.alexa_media
          data:
            message: The car is unplugged.  Please plug it in for nightly charging.
            target:
              - media_player.todd_ecobee_smart_thermostat_premium
            data:
              type: tts
        - wait_for_trigger:
            - type: motion
              platform: device
              device_id: 12345
              entity_id: binary_sensor.garage_motion_motion
              domain: binary_sensor
              id: Garage Motion
          timeout: '00:05:00'
          continue_on_timeout: true
mode: single
Ford Mustang Mach-E Home Assistant Automations - Show them off!!! 1656809915135
 

Gimme_my_MME

Well-Known Member
Joined
Oct 12, 2020
Threads
11
Messages
1,729
Reaction score
5,505
Location
Dearborn
Vehicles
Grabber Blue First Edition Mustang Mach-E
Occupation
Engineer
Country flag
I have a JuiceBox also connected up to HA. It reports its status (standby, charging, plugged) as a sensor. And using the basic fordpass through HACS.

This pushes a phone notification (to `mobile_app_pixel`) at 5:44pm again at and 6:58pm if the car is under 60% and not plugged in. (With ER and a short-ish commute, I don't need to plug in every day.)

YAML:
alias: Car Charge Reminder
description: ''
trigger:
  - platform: time
    at: '17:44:00'
  - platform: time
    at: '18:58:00'
condition:
  - condition: state
    entity_id: sensor.charging_status
    state: standby
  - condition: numeric_state
    entity_id: sensor.fordpass_elveh
    attribute: Battery Fill Level
    above: '0'
    below: '60'
action:
  - service: notify.mobile_app_pixel
    data:
      title: EVSE Reminder
      message: Plug in your car!
mode: single
The screenshot is not all that interesting, but it gets the job done:
Ford Mustang Mach-E Home Assistant Automations - Show them off!!! 1656809915135


View attachment 71196
Why those oddly specific times?
 
OP
OP
DevSecOps

DevSecOps

Well-Known Member
First Name
Todd
Joined
Sep 22, 2021
Threads
69
Messages
4,741
Reaction score
11,510
Location
Sacramento, CA
Vehicles
'21 Audi SQ5 / '23 Rivian R1T / '23 M3P
Occupation
CISO
Country flag
Doors left unlocked notification

Here's an automation alerting you to the car being left unlocked for more than 10 minutes.

Here's some of the key takeaways:
  • Only alerts when away from home. For those who don't park in a garage, remove that.
  • Normally doesn't trigger when in motion because the door lock command usually gets sent to Ford.
YAML:
alias: MachE Door Unlock Notification
description: ''
trigger:
  - platform: device
    device_id: 12345
    domain: lock
    entity_id: lock.fordpass_doorlock
    type: unlocked
    for:
      hours: 0
      minutes: 10
      seconds: 0
condition:
  - condition: device
    device_id: 12345
    domain: device_tracker
    entity_id: device_tracker.pixel_6_pro
    type: is_not_home
  - condition: device
    type: is_off
    device_id: 12345
    entity_id: switch.fordpass_ignition_switch
    domain: switch
action:
  - service: notify.mobile_app_pixel_6_pro
    data:
      title: MachE Doors Left Unlocked
      message: Check the car doors - Unlocked for 10 minutes!
      data:
        notification_icon: mdi:car-key
        color: yellow
mode: single
Ford Mustang Mach-E Home Assistant Automations - Show them off!!! 1656810279663
 
Last edited:


mmap

Well-Known Member
Joined
Oct 9, 2021
Threads
5
Messages
199
Reaction score
324
Location
Maryland
Vehicles
2022 MachE Route1
Occupation
Software Guy
Country flag
Why those oddly specific times?
lol, that's when I am most likely to be standing in my kitchen rather than sitting on my couch. I found that when it goes off when I'm on the couch, I don't actually get up to plug it in. :)
 
OP
OP
DevSecOps

DevSecOps

Well-Known Member
First Name
Todd
Joined
Sep 22, 2021
Threads
69
Messages
4,741
Reaction score
11,510
Location
Sacramento, CA
Vehicles
'21 Audi SQ5 / '23 Rivian R1T / '23 M3P
Occupation
CISO
Country flag
lol, that's when I am most likely to be standing in my kitchen rather than sitting on my couch. I found that when it goes off when I'm on the couch, I don't actually get up to plug it in. :)
Hence my nagging reminder ...
 

mmap

Well-Known Member
Joined
Oct 9, 2021
Threads
5
Messages
199
Reaction score
324
Location
Maryland
Vehicles
2022 MachE Route1
Occupation
Software Guy
Country flag
Here's some of the key takeaways from my version:
  • Only alerts when at home. I have to be home and so does the car
I did not even think of this!

I am embarrassed that I hate that mine goes off when I'm not at home but I never thought about trying to fix it.
 
OP
OP
DevSecOps

DevSecOps

Well-Known Member
First Name
Todd
Joined
Sep 22, 2021
Threads
69
Messages
4,741
Reaction score
11,510
Location
Sacramento, CA
Vehicles
'21 Audi SQ5 / '23 Rivian R1T / '23 M3P
Occupation
CISO
Country flag
Window Left Down - Rain Forecasted

Here's an automation alerting you to rain in the forecast if your windows are down/cracked. This integration is a bit more complicated because you have to query the weather service for the actual location of the car. Using the "home" location might not be where the car is.

Here's some of the key takeaways:
  • Dynamically determines where the car is and queries the weather every 10 minutes for that location.
  • Will not trigger while the car is at home. If you don't have a garage then maybe you should disable that.
First you have to get an API key from Open Weather Map. It's completely free and easy.

Next you have to add the API call with dynamic location to your configuration.yaml file:

YAML:
# For the Weather at Vehicle Location (current only)
sensor:
  - platform: rest
    resource_template: >
      {% set lat = state_attr('device_tracker.fordpass_tracker', 'latitude') | float(0) %}
      {% set lon = state_attr('device_tracker.fordpass_tracker', 'longitude') | float(0) %}
      {{ 'https://api.openweathermap.org/data/2.5/onecall?lat={}&lon={}&units=imperial&appid=yourapikeyhere'.format(lat, lon) }}
    json_attributes:
      - current
    name: openweather_api
    value_template: '{% if value_json[0] is defined %}{{ value_json[0].name }}{% endif %}'
    headers:
      Accept: 'application/json'
    scan_interval: 600
Next you need to restart HA

And here's the automation:

Note: I just have rain listed because I'm in a rain only area. If you have other types of weather that you might want to look out for then duplicate the value template and include any of the below options (first letter is caps). The automation will trigger on any "true" event.

Rain
Snow
Thunderstorm
Drizzle

If you wanted to get even more detailed you could change "main" below to "description" and then use any number of the hundreds of specific weather events like "light rain".

YAML:
alias: MachE Window Left Down - Rain Forecasted
description: ''
trigger:
  - platform: template
    value_template: >-
      {% if state_attr('sensor.openweather_api', 'current')["weather"][0]["main"] == "Rain" %}true{% endif %}
condition:
  - condition: device
    device_id: 12345
    domain: device_tracker
    entity_id: device_tracker.fordpass_tracker
    type: is_not_home
  - condition: state
    entity_id: sensor.fordpass_windowposition
    state: Open
  - condition: device
    type: is_off
    device_id: 12345
    entity_id: switch.fordpass_ignition_switch
    domain: switch
action:
  - service: notify.mobile_app_pixel_6_pro
    data:
      title: Don't Flood the Car!
      message: Weather forecast shows rain.  Close the windows!
      data:
        notification_icon: mdi:weather-pouring
        color: red
mode: single
Ford Mustang Mach-E Home Assistant Automations - Show them off!!! 1656813305975
 
Last edited:

Mach-Lee

Well-Known Member
First Name
Lee
Joined
Jul 16, 2021
Threads
210
Messages
7,980
Reaction score
16,082
Location
Wisconsin
Vehicles
2022 Mach-E Premium AWD
Occupation
Sci/Eng
Country flag
I don't use home assistant, but I made one that reminds me in the morning if the car didn't charge for some reason. Better to find out when you wake up rather than when you get in the car to leave.
 
OP
OP
DevSecOps

DevSecOps

Well-Known Member
First Name
Todd
Joined
Sep 22, 2021
Threads
69
Messages
4,741
Reaction score
11,510
Location
Sacramento, CA
Vehicles
'21 Audi SQ5 / '23 Rivian R1T / '23 M3P
Occupation
CISO
Country flag
I don't use home assistant, but I made one that reminds me in the morning if the car didn't charge for some reason. Better to find out when you wake up rather than when you get in the car to leave.
Do you have DCFC at home (wouldn't put it past you)? Or do you just wake up many hours before you leave? šŸ˜‚

But more seriously, what platform did you use?
 

Mach-Lee

Well-Known Member
First Name
Lee
Joined
Jul 16, 2021
Threads
210
Messages
7,980
Reaction score
16,082
Location
Wisconsin
Vehicles
2022 Mach-E Premium AWD
Occupation
Sci/Eng
Country flag
Do you have DCFC at home (wouldn't put it past you)? Or do you just wake up many hours before you leave? šŸ˜‚

But more seriously, what platform did you use?
Nah, just a L2 here, DCFC would be cool but a waste of money. My schedule varies, sometimes I don't leave right away. Usually have at least an hour which would charge enough range to get me to work. More so I just want to know if charging didn't happen as expected. I used Apple Shortcuts which recently broke with the server API changes, I'll figure it out later...
 

Gullwingdmc

Well-Known Member
First Name
Chip
Joined
May 15, 2021
Threads
77
Messages
2,742
Reaction score
3,769
Location
Boston, MA
Vehicles
2022 Mustang Mach E GT AWD ER - Grabber Blue
Country flag
Is Home Assistant still working? Iā€™ve never used it, but I know the recent API changes caused the Apple Shortcuts to stop working and some of the widgets are being reworked.
 
OP
OP
DevSecOps

DevSecOps

Well-Known Member
First Name
Todd
Joined
Sep 22, 2021
Threads
69
Messages
4,741
Reaction score
11,510
Location
Sacramento, CA
Vehicles
'21 Audi SQ5 / '23 Rivian R1T / '23 M3P
Occupation
CISO
Country flag
Is Home Assistant still working? Iā€™ve never used it, but I know the recent API changes caused the Apple Shortcuts to stop working and some of the widgets are being reworked.
Yes. It was just an API Auth change. The nice thing about HA is the MASSIVE community behind it. Ford changes something and in less than 24 hours it's updated. A widget maintained by a single person may stop working at any time.
 

Gullwingdmc

Well-Known Member
First Name
Chip
Joined
May 15, 2021
Threads
77
Messages
2,742
Reaction score
3,769
Location
Boston, MA
Vehicles
2022 Mustang Mach E GT AWD ER - Grabber Blue
Country flag
Yes. It was just an API Auth change. The nice thing about HA is the MASSIVE community behind it. Ford changes something and in less than 24 hours it's updated. A widget maintained by a single person may stop working at any time.
That is great! I have home bridge running on a Pi, but maybe Iā€™ll spin another up with HA. I had a bunch of scripts setup through Apple shortcuts that now donā€™t work because of the changes Ford made.

My last one ran every night at 9, if I was at home, and told me if the car was locked, if it was plugged in, and if it was whether it was charging or done charging. It worked for 2 days and then then ford changed everything lol.
Sponsored

 
 




Top