FordPass Integration

Just change the Fordpass API interval to 600 seconds in the config

I tried this again and got working… can now start my F-150, lock.unlock almost instantly. Even with HomeKit bridge works and shows up as a lock and ignition is a switch. (I made a separate accessory only bridge for the lock).

However, it does not seem to auto refresh. I just tried changing it to 600 but I do not see why that would make a difference - I was thinking maybe the built-in refresh has an issue and I should just make my own automation for now and I tried that and does not refresh every time I call the service. I found that using call service reload sometimes updates but still not all the time. I made an automation that reloads every 15 min so will see how it works.

Locking and unlocking doors refreshes instant though. Think there is either a bug in the refresh, or maybe is not working on ford’s servers like it used to - ie. maybe they disabled it.

I did notice this integration offers more info than the fordpass iphone app does… like door and window open, and the actual status of doors locked or unlocked - which official app does not provide.

UPDATE: I think I figured out the refresh issue… not sure if this is something I misunderstood, or maybe I even have this all wrong, but it seems to be the case based on my observations and tests… If I am wrong, someone please let me know, or explain how it is supposed to work.

The setting in seconds that you put in the Integration seems to be a fail-safe, or master interval to poll that the integration allows. This prevents one from sending too many requests out manually or via automations, but It does not seem to do refresh/polling on its own and I had to make own automation. This contradicts what the docs imply, so this does not make sense to me, but it never refreshes on its own in my experience, and I left running all night!

I created an automation that refreshes every 15 minutes. Since I had set integration to default 900 seconds, which is 15 minutes, but this is not synced with the automation time interval, which is instead absolute 15 minutes from each hour vs. the fail-safe 15 minutes from whenever integration started, or last refreshed. Therefore, it will not seem like it is refreshing at the desired time, and could be up to 15 minutes later in this case (depending on when the integration’s interval was set in relation to the hour). As a test, I set integration config to 300 seconds (5 minutes), and now my automation refreshes shortly after every 15 minutes from the hour, since the integration’s interval is low enough to allow every 15 minutes (note, 600 seconds or 10 minutes would also fix as previously suggested but may cause bit more delay). So far has been work fine for the past hour. It also seems to queue it up if I manually call the service, it happens within 5 min later, not at a 15 minute interval - this seems to make sense now reading the message “Poll car for latest status (Takes up to 5mins to update once this function has been run!)”, which may have been when default refresh setting was 5 minutes?

2 Likes

I don’t know how you canculate but 900 seconds is not 20 minutes and 600 ain’t 15.

I changed the api interval to 600 seconds because the default 900 seconds gives me a timeout and so nothing gets refreshed. 600 Seconds works just fine

Ya I was off a bit when typing that - was confused with all my testing. I meant 15 and 10 minutes respectively. I have edited my post in hopes it makes more sense now.

Does anyone know if this integration could possibly stop an EV from charging?

Here’s my scenario:

  • My Powerwalls have an output limit of 10kW
  • My Ford Charge Station Pro charges at ~19kW when actively charging
  • If I lose grid power while my vehicle is actively charging, I risk my backup not working correctly and maintaining power because it will exceed the output limits

So, it’d be great if the FordPass Integration could expose the ability to start/stop charging the vehicle. This could then be used in some automations to conserve power when needed and prevent exceeding output limits. The same could be done proactively when Tesla issues a Severe Weather event to disable charging during that time.

Hi,

Anyone knows why my names are crappy? Do I really have to set each name?

Kind regards,

Frank

image

2 Likes

Hi All, i have fordpass avalible in South Africa but i see there is not a region option for South Africa, also in SA you register your fordpass account with a mobile number and not a email address, anyone know of a workaround for these two challenges ? Thanks G

Yes, be careful with update schedules (yours seem very reasonable). I have previously used the FordPass integration with homebridge, and its initial setting caused frequent polling, in turn causing Ford to block my account access to their servers (apparently hosted on *.ibmcloud.com). With a friendly intervention from FordPass support personnel my account was unlocked again, but I’ve since stopped using it with homebridge. Trying again now with Home Assistant, and your great guidance in this forum is truly appreciated!

Great instructions Obi, thanks for that contribution. Would you mind sharing the pictures (or a mock-up) that you use for the device tracker, namely the DeppBlue and the DeppBlue_away files, to give us an indication of what it would look like on a card? I would like to enhance my instance because right now it does not look very appealing as you can gather from the attached screenshot.

Ssure, of course.

here u are:


I think I screenshotted the Ford configurator back in the days to get my exact car…

KR Kai

1 Like

This is the #1 feature that I need. I also want to manage my powerwall energy and my TOU prices.

Start / Stop Charging Sessions with Fordpass.

in the mean time, i made this nice card for the front end.

type: entities
entities:
  - entity: sensor.fordpass_elveh
    name: Range
    secondary_info: none
  - type: attribute
    entity: sensor.fordpass_elveh
    attribute: Battery Fill Level
    name: Battery
    icon: mdi:battery
    suffix: '%'
  - entity: sensor.fordpass_elveh_plug_charging_status
    icon: mdi:lightning-bolt
  - entity: sensor.fordpass_elveh_plug_state
    icon: mdi:ev-plug-type1
  - entity: switch.fordpass_ignition_switch
    name: Start
  - entity: lock.fordpass_doorlock
    name: Door Locks
    icon: mdi:lock-outline
  - entity: sensor.fordpass_windowposition
    name: Windows
    icon: mdi:car-door
  - entity: device_tracker.fordpass_tracker
    name: Location
header:
  type: picture
  image: >-
    https://pictures.dealer.com/l/levittownfordfd/1545/ecf2d68c9eac42e902cfdc51fb31b11ex.jpg?impolicy=downsize_bkpt&w=412
footer:
  type: graph
  graph: line
  entity: sensor.fordpass_elveh
  hours_to_show: 24
  unit: '%'
  detail: 2
title: Mustang Mach-E GT

I made two template sensors to format the data in the attributes of sensor.fordpass_elveh

    fordpass_elveh_plug_state:
      friendly_name: 'Charging Cable'
      value_template: >
        {% if state_attr('sensor.fordpass_elveh', 'Plug Status') == 1 %}
        Plugged in
        {% elif state_attr('sensor.fordpass_elveh', 'Plug Status') == 0 %}
        NOT Plugged in
        {% else %}
        error
        {% endif %}

    fordpass_elveh_plug_charging_status:
      friendly_name: 'Charging Status'
      value_template: >
        {% if state_attr('sensor.fordpass_elveh', 'Charging Status') == 'ChargingAC' %}
        Charging
        {% elif state_attr('sensor.fordpass_elveh', 'Charging Status') == 'ChargeTargetReached' %}
        Charging Complete
        {% else %}
        NOT Charging
        {% endif %}
3 Likes

This is awesome. Thanks for sharing!

I added to this by creating a conditional row that shows me the power consumption and the toggle switch for my EVSE so I can stop it from charging if I don’t want it to charge. That second part is unfortunately not related to FordPass and directly from the EVSE, so it wouldn’t work for the official Ford Charge Stations.

1 Like

Amazing. Please share your code so I can learn.

I have a Ford Mach-E car but use Tesla Wall Connectors with J-1772 plugs. I wonder how I can control charging my wall connectors. I can’t seem to do it with the Tesla integrations to HA.

I don’t believe the Tesla Wall Connector has a power on/off toggle…I had one previously and could only control charging from the Tesla itself, but the Tesla integration for HA did provide this control over the vehicle…really wish this was possible with this FordPass integration for HA.

Here’s my card and code. I started it as a Vertical Stack in case I wanted to add a different card below, but haven’t added more yet. Also, I modified the following:

  • Used the template sensor for battery level I had previously configured
  • adjusted the door lock icon to the default
  • enabled color for sensor state
  • added secondary info for when the sensor was last updated
  • added conditional rows when charging to show several items such as how much energy is being transferred from the sensor on the EVSE, the Zwave switch to toggle EVSE on/off, the time until vehicle reaches 90%, and energy required to get to 90%. → I couldn’t figure out how to merge these into a more concise conditional statement, so ended up with what you can see below.
  • Used the image available on ford.com when I log in to my fordpass account, and I found that adjusting the number at the end from 1-5 changes the orientation of the vehicle.
  • added a tap action for the vehicle image to take me to the device integration page for this vehicle within HA for more information.

type: vertical-stack
cards:
  - type: entities
    entities:
      - entity: sensor.fordpass_elveh
        name: Range
        secondary_info: last-updated
      - entity: sensor.fordpass_battery_level
        secondary_info: last-updated
      - entity: sensor.fordpass_charging_cable
        icon: mdi:ev-plug-type1
        secondary_info: last-updated
      - entity: sensor.fordpass_charging_status
        icon: mdi:lightning-bolt
        secondary_info: last-updated
      - type: conditional
        conditions:
          - entity: sensor.fordpass_charging_status
            state: Charging
        row:
          entity: sensor.direct_wire_indoor_outdoor_smart_switch_electric_production_w
          secondary_info: last-updated
      - type: conditional
        conditions:
          - entity: sensor.fordpass_charging_status
            state: Charging
        row:
          entity: switch.direct_wire_indoor_outdoor_smart_switch
          secondary_info: last-updated
      - type: conditional
        conditions:
          - entity: sensor.fordpass_charging_status
            state: Charging
        row:
          entity: sensor.fordpass_time_to_charge_battery_to_90
          secondary_info: last-updated
      - type: conditional
        conditions:
          - entity: sensor.fordpass_charging_status
            state: Charging
        row:
          entity: sensor.fordpass_energy_to_90
          secondary_info: last-updated
      - entity: switch.fordpass_ignition_switch
        name: Start
        secondary_info: last-updated
      - entity: lock.fordpass_doorlock
        name: Door Locks
        secondary_info: last-updated
      - entity: sensor.fordpass_windowposition
        name: Windows
        icon: mdi:car-door
        secondary_info: last-updated
      - entity: device_tracker.fordpass_tracker
        name: Location
        secondary_info: last-updated
    header:
      type: picture
      image: >-
        https://www.digitalservices.ford.com/fs/api/v2/vehicles/image/full?vin=REDACTED&year=2022&countryCode=USA&angle=1
      tap_action:
        action: navigate
        navigation_path: /config/devices/device/fa2868b9f882b1845ca13ea5e95dc1cd
    footer:
      type: graph
      entity: sensor.fordpass_elveh
      hours_to_show: 24
      detail: 2
    title: Dayman - Mustang Mach-E GT
    state_color: true

And if you’re interested, here are the template sensors I used to calculate the charge time and energy to 90%.

#--------------------------------------------------------------------------------------------------
# Fordpass Energy to 90%
#--------------------------------------------------------------------------------------------------
- sensor:
  - name: "Fordpass Energy to 90%"
    unique_id: "fordpass_energy_to_90"
    unit_of_measurement: "kWh"
    device_class: "energy"
    state: >
      {% set percent = states('sensor.fordpass_battery_level') | float(0) / 100.0 | float(0) %}
      {% set energy = 91 | float(0) %}
      {% set charge = ((0.9 - percent) * energy) | float(0) %}
      {{ charge }}

#--------------------------------------------------------------------------------------------------
# Forpass Time to Charge Battery to 90% 
#--------------------------------------------------------------------------------------------------
- sensor:
  - name: "Fordpass Time to Charge Battery to 90%"
    unique_id: "fordpass_time_to_charge_battery_to_90"
    state: >
      {% set a = states('sensor.fordpass_energy_to_90') | float(0.0001) %}
      {% set b = states('sensor.direct_wire_indoor_outdoor_smart_switch_electric_production_w') | float(0.0001) %}
      {% if b > 5 %}
        {% set decimal_hours = a / b * 1000 %}
      {% else %}
        {% set decimal_hours = 0.0 %}
      {% endif %}
      {% set minutes = (decimal_hours % 1 * 60) | round(0) %}
      {% set decimal_hours = decimal_hours| int(0) %}
      {% if minutes  <= 9 %}
        {% set min = '0' ~ minutes | string %}
      {% else %}
        {% set min = minutes | string %}
      {% endif %}
      {{ decimal_hours ~ ':' ~ min }}
4 Likes

Wow thanks for sharing. :clap:

Great, now I understand the concept, thanks again for sharing! I think I’ll use the following for when I’m parked on my driveway at home, and for when I’m on the road, respectively… :grinning_face_with_smiling_eyes:

MyPuma_home-small

MyPuma_ontheroad-small

Thank you for updating the integration to use new API and cleaning things.

I have a question about the difference between fordpass.poll_api and fordpass.refresh_status.
I’m guessing poll_api only reads cached data from the Ford API, while refresh_status queries a car for data?
If so, then calling one frequently without another doesn’t make sense at all. Am I right? But if I’m not, what is their exact functionality?

I think Ford changed the API, so the previously listed value templates need to change. Also, the fordpass plugin has another entity for eletric vehicles: fordpass_elvehcharging.

I changed my entity card to this:

type: entities
entities:
  - entity: sensor.fordpass_elveh
    name: Range
    secondary_info: none
  - type: attribute
    entity: sensor.fordpass_elvehcharging
    attribute: Charging State of Charge
    name: Battery
    icon: mdi:battery
    suffix: '%'
  - type: attribute
    entity: sensor.fordpass_elvehcharging
    attribute: Time To Full Charge
    name: Time to full charge
    icon: mdi:clock
  - type: attribute
    entity: sensor.fordpass_elveh
    attribute: Plug Status
    icon: mdi:ev-plug-type1
  - entity: sensor.fordpass_elvehcharging
    name: Charge Status
  - type: attribute
    entity: sensor.fordpass_elvehcharging
    attribute: Charging kW
    name: Charging kW
    icon: mdi:current-dc

Ever since the latest update, Ford keeps locking my account. Too many API requests? Had to delete the integration. Not a good week for me. Lost Mazda, Ford, and MyQ integrations.

Wonder if too many connection attempts. What’s your refresh?

Also, have you tried creating a second account for Ha?