Sponsored

Home Assistant - Ford F150 Lightning Dashboard.

Aminorjourney

Well-known member
Joined
Jun 6, 2022
Threads
10
Messages
176
Reaction score
351
Location
Internet
Vehicles
vehicles that go
[EDIT: Dec 9, 2023]

Please see THIS POINT in the thread for the latest notes. If you're running old code, please consider updating it with the new code posted in the YAML on that post.

[/EDIT]



Happy Thanksgiving (albeit a day late) for those celebrating. And Happy Friday for those who aren't!

I spent some time yesterday playing with Home Assistant and the FordPass-HA integration, and with a little playing, I've ended up with quite a usable start for a custom card for my Home Assistant Dashboard.

I would LOVE to take all the credit, but it's not actually my doing. I basically adapted this card (from a Tesla owner) with the relevant data from FordPass-HA. I also had to make some templates in order to pull the right data out of the right status messages. It's not finished yet, and ultimately, I'd love to make it work with our Home Integration System so that I can record when power is being fed out of the truck and into the house. Now it's working, I need to figure out some logic to fix things.

Note: Below is my current code - but it's certainly NOT finished yet and there are MANY errors that I need to go back and fix, including some of the conditional statements (which won't work in HA picture cards unless there's just one main status). Please be patient with my terrible code, and if you're going to use it, know that it will break...

The first image was from this morning, when I was running the house off the truck - but I had to fake the status because I've not yet written the right templates to make it work automatically.

The second one was snapped this afternoon while I was grabbing a coffee while my Vectrix VX-1 charged, (and my wife had just returned back home with the truck from the DIY store). I also know that some of the elements are off - and that's going to be in my ToDo list.

Also in my ToDo: Make a similar card for our Chevrolet Bolt EV (which also has a Home Assistant integration), and eventually, do something similar for my Motorbike (which currently doesn't have any telematics, but I have plans...)

FYI, the THIRD image shows the status of the F150 Lightning battery pack on the Energy Flow Plus card, but again, needs work to be super usable. It is NOT recording power flow OUT of the house, or indeed all the consumption, because we don't have current meters on everything yet, and while I have now found a way to potentially pull data from the Home Integration System's Delta Inverter - I haven't looked into it yet. Based on my knowledge of the Delta invert that's part of the HIS, and reading the manuals for installation, I believe we can use the same hybrid ethernet/modbus setup to pull data from it for home automation. But that's for someone better than me.

YAML:
title: Adira Tal - Ford F150 Lightning
type: picture-elements
image: /local/F150Lightningoverhead.jpg
elements:
  - type: state-icon
    icon: mdi:update
    entity: sensor.fordpass_lastrefresh
    tap_action: none
    action: none
    double_tap_action: none
    hold_action:
      action: call-service
      service: script.refresh_ford
    style:
      top: 6.5%
      left: 10%
      color: '#039be5'
  - type: state-label
    entity: sensor.fordpass_lastrefresh
    tap_action: none
    double_tap_action: none
    hold_action:
      action: call-service
      service: script.refresh_ford
    style:
      top: 96%
      left: 53%
      font-size: 100%
      font-weight: normal
      color: rgb(0,0,0)
    prefix: 'Status Last updated: '
  - type: state-label
    entity: device_tracker.fordpass_tracker
    tap_action: none
    double_tap_action: none
    hold_action: none
    style:
      top: 7%
      left: 92%
      font-size: 100%
      font-weight: normal
      color: black
  - type: state-label
    entity: sensor.ford_charge_station_power_flow_template
    tap_action: none
    double_tap_action: none
    hold_action: none
    style:
      top: 6.5%
      left: 28%
      color: black
    prefix: null
  - type: conditional
    conditions:
      - entity: sensor.ford_charge_station_power_flow_template
        state: DISCHARGING
    elements:
      - type: icon
        icon: mdi:home-import-outline
        style:
          top: 6.5%
          left: 49%
          color: green
  - type: conditional
    conditions:
      - entity: sensor.ford_charge_station_power_flow_template
        state: IN_PROGRESS
    elements:
      - type: icon
        icon: mdi:home-export-outline-outline
        style:
          top: 6.5%
          left: 49%
          color: red
  - type: conditional
    conditions:
      - entity: sensor.ford_charge_station_power_flow_template
        state: COMPLETED
    elements:
      - type: icon
        icon: mdi:battery-charging-100
        style:
          top: 6.5%
          left: 49%
          color: green
  - type: conditional
    conditions:
      - entity: sensor.fordpass_firmwareupginprogress
        state: true
    elements:
      - type: icon
        icon: mdi:car-connected
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 6.5%
          left: 83%
          color: green
  - type: conditional
    conditions:
      - entity: sensor.fordpass_firmwareupginprogress
        state_not: true
    elements:
      - type: icon
        icon: mdi:car-connected
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 6.5%
          left: 83%
          color: light grey
  - type: conditional
    conditions:
      - entity: sensor.fordpass_alarm
        state: ARMED
    elements:
      - type: icon
        icon: mdi:shield-car
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 7%
          left: 77%
          color: red
  - type: conditional
    conditions:
      - entity: sensor.fordpass_alarm
        state_not: ARMED
    elements:
      - type: icon
        icon: mdi:shield-alert-outline
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 7%
          left: 77%
          color: black
  - type: conditional
    conditions:
      - entity: lock.fordpass_doorlock
        state: locked
    elements:
      - type: icon
        icon: mdi:lock
        tap_action: none
        double_tap_action: none
        hold_action:
          action: call-service
          service: script.unlock_f150_lightning
        style:
          top: 7%
          left: 70.5%
          color: black
  - type: conditional
    conditions:
      - entity: lock.fordpass_doorlock
        state_not: locked
    elements:
      - type: icon
        icon: mdi:lock-open-variant
        tap_action: none
        double_tap_action: none
        hold_action:
          action: call-service
          service: script.lock_f150_lightning
        style:
          top: 7%
          left: 70.5%
          color: '#039be5'
  - type: conditional
    conditions:
      - entity: status.fordpass_deepsleepinprogress
        state: ACTIVE
    elements:
      - type: icon
        icon: hass:power-sleep
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 7%
          left: 64%
          color: black
  - type: conditional
    conditions:
      - entity: sensor.fordpass_deepsleepinprogress
        state: DISABLED
    elements:
      - type: icon
        icon: hass:power-plug
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 7%
          left: 64%
          color: '#039be5'
  - type: conditional
    conditions:
      - entity: sensor.fordpass_remotestartstatus
        state: Inactive
    elements:
      - type: icon
        icon: hass:power
        tap_action: none
        double_tap_action: none
        hold_action:
          action: call-service
          service: script.remote_start_f150
        style:
          top: 7%
          left: 58%
          color: black
  - type: conditional
    conditions:
      - entity: sensor.fordpass_remotestartstatus
        state: Active
    elements:
      - type: icon
        icon: hass:power
        tap_action: none
        double_tap_action: none
        hold_action:
          action: call-service
          service: script.remote_start_f150
        style:
          top: 7%
          left: 58%
          color: green
  - type: conditional
    conditions:
      - entity: sensor.ford_left_front_tyre_template
        condition: numeric_state
        below: 38
    elements:
      - type: icon
        icon: mdi:car-tire-alert
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 6.9%
          left: 51.5%
          color: red
  - type: conditional
    conditions:
      - entity: sensor.ford_right_front_tyre_template
        condition: numeric_state
        below: 38
    elements:
      - type: icon
        icon: mdi:car-tire-alert
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 6.9%
          left: 51.5%
          color: red
  - type: conditional
    conditions:
      - entity: sensor.ford_left_rear_tyre_template
        condition: numeric_state
        below: 38
    elements:
      - type: icon
        icon: mdi:car-tire-alert
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 6.9%
          left: 51.5%
          color: red
  - type: conditional
    conditions:
      - entity: sensor.ford_right_rear_tyre_template
        condition: numeric_state
        below: 38
    elements:
      - type: icon
        icon: mdi:car-tire-alert
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 6.9%
          left: 51.5%
          color: red
  - type: state-label
    entity: sensor.fordpass_doorstatus
    attribute: REAR_LEFT
    tap_action: none
    double_tap_action: none
    hold_action: none
    style:
      top: 23%
      left: 40%
      color: black
  - type: state-label
    entity: sensor.fordpass_doorstatus
    attribute: DRIVER
    tap_action: none
    double_tap_action: none
    hold_action: none
    style:
      top: 23%
      left: 55%
      color: black
  - type: state-label
    entity: sensor.fordpass_doorstatus
    attribute: REAR_RIGHT
    tap_action: none
    double_tap_action: none
    hold_action: none
    style:
      top: 53%
      left: 40%
      color: black
  - type: state-label
    entity: sensor.fordpass_doorstatus
    attribute: PASSENGER
    tap_action: none
    double_tap_action: none
    hold_action: none
    style:
      top: 53%
      left: 55%
      color: black
  - type: state-label
    entity: sensor.fordpass_doorstatus
    attribute: HOOD
    tap_action: none
    double_tap_action: none
    hold_action: none
    style:
      top: 37%
      left: 74%
      color: white
  - type: state-label
    entity: sensor.fordpass_doorstatus
    attribute: TAILGATE
    tap_action: none
    double_tap_action: none
    hold_action: none
    style:
      top: 37%
      left: 30%
      color: white
  - type: conditional
    conditions:
      - entity: sensor.fordpass_elvehcharging
        attribute: Plug Status
        state: CONNECTED
      - entity: sensor.fordpass_elvehcharging
        attribute: Charge Type
        state_not: AC_BASIC
    elements:
      - type: icon
        icon: mdi:ev-plug-type1
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 24%
          left: 68%
          color: green
  - type: conditional
    conditions:
      - entity: sensor.fordpass_elvehcharging
        attribute: Plug Status
        state_not: CONNECTED
    elements:
      - type: icon
        icon: mdi:ev-plug-type1
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 24%
          left: 68%
          color: red
  - type: conditional
    conditions:
      - entity: sensor.ford_charge_station_power_flow_template
        state: IN_PROGRESS
    elements:
      - type: state-label
        entity: sensor.fordpass_elvehcharging
        attribute: Charging kW
        tap_action: none
        double_tap_action: none
        hold_action: none
        prefix: 'Charging At: '
        suffix: kW
        style:
          top: 19.5%
          left: 82%
          font-size: 100%
          font-weight: normal
          color: green
  - type: state-label
    entity: sensor.fordpass_outsidetemp
    prefix: 'Outside Temperature: '
    tap_action: none
    double_tap_action: none
    hold_action: none
    style:
      top: 16%
      left: 51%
      font-size: 100%
      font-weight: normal
      color: rgb(0,0,0)
  - type: icon
    icon: mdi:thermometer
    tap_action: none
    double_tap_action: none
    hold_action: none
    style:
      top: 16%
      left: 24%
      font-size: 100%
      font-weight: normal
      color: rgb(0,0,0)
  - type: custom:bar-card
    entity: sensor.fordpass_elvehcharging
    attribute: State of Charge
    severity:
      - color: Red
        from: 0
        to: 10
      - color: Orange
        from: 11
        to: 20
      - color: Green
        from: 21
        to: 100
    entity_row: true
    positions:
      icon: 'off'
      name: 'off'
      indicator: 'off'
    animation:
      state: 'on'
      speed: 5
    width: 270px
    tap_action: none
    hold_action: none
    double_tap_action: none
    stack: vertical
    style:
      top: 65%
      left: 53%
      font-size: 100%
      font-weight: normal
      color: rgb(0,0,0)
  - type: conditional
    conditions:
      - entity: sensor.ford_charge_station_power_flow_template
        attribute: Charging Status
        state: IN_PROGRESS
      - entity: device_tracker.fordpass_tracker
        state: home
    elements:
      - type: icon
        icon: mdi:home-lightning-bolt-outline
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 65%
          left: 55%
          color: black
  - type: conditional
    conditions:
      - entity: sensor.ford_charge_station_power_flow_template
        state: IN_PROGRESS
      - entity: device_tracker.fordpass_tracker
        state_not: home
    elements:
      - type: icon
        icon: mdi:ev-station
        tap_action: none
        double_tap_action: none
        hold_action: none
        style:
          top: 65%
          left: 55%
          color: black
  - type: state-label
    entity: sensor.fordpass_elveh
    attribute: null
    style:
      top: 74%
      left: 53%
      font-size: 100%
      font-weight: normal
      color: rgb(0,0,0)
    prefix: 'Estimated range: '
For custom templates, I've added the following into my sensors.yaml file (the file where you custom-define special sensors or parse out data from other states as their own sensors).

YAML:
-platform: template
  sensors:
     battery_percent_template:
        friendly_name: "Ford battery charge"
        value_template: "{{ state_attr('sensor.fordpass_elveh', 'Battery Charge') }}"
        unit_of_measurement: "%"
        icon_template: mdi:battery

     12v_battery_template:
        friendly_name: "Ford 12V battery"
        value_template: "{{ state_attr('sensor.fordpass_battery', 'Battery Voltage') }}"
        unit_of_measurement: "V"
        icon_template: mdi:battery

     ford_left_rear_tyre_template:
        friendly_name: "F150 rear left tyre"
        value_template: "{{states.sensor.fordpass_tirepressure.attributes.REAR_LEFT}}"
        unit_of_measurement: "PSI"
        icon_template: mdi:car-tire-alert

     ford_left_front_tyre_template:
        friendly_name: "F150 front left tyre"
        value_template: "{{states.sensor.fordpass_tirepressure.attributes.FRONT_LEFT}}"
        unit_of_measurement: "PSI"
        icon_template: mdi:car-tire-alert

     ford_right_rear_tyre_template:
        friendly_name: "F150 rear right tyre"
        value_template: "{{states.sensor.fordpass_tirepressure.attributes.REAR_RIGHT}}"
        unit_of_measurement: "PSI"
        icon_template: mdi:car-tire-alert

     ford_right_front_tyre_template:
        friendly_name: "F150 front right tyre"
        value_template: "{{states.sensor.fordpass_tirepressure.attributes.FRONT_RIGHT}}"
        unit_of_measurement: "PSI"
        icon_template: mdi:car-tire-alert
   
     ford_charging_power_template:
        friendly_name: "Ford_F150_Lightning_Charge_Rate"
        value_template: "{{ state_attr('sensor.fordpass_elvehcharging', 'Charging kW') | float }}"
        unit_of_measurement: "kW"
        icon_template: mdi:truck
   
     ford_charge_station_power_flow_template:
        friendly_name: "Charge_Station_Pro_Power_Flow"
        value_template: "{{ state_attr('sensor.fordpass_elvehcharging', 'Charging Status') }}"



Ford F-150 Lightning Home Assistant - Ford F150 Lightning Dashboard. IMG_5254
Ford F-150 Lightning Home Assistant - Ford F150 Lightning Dashboard. IMG_5262.PNG


Ford F-150 Lightning Home Assistant - Ford F150 Lightning Dashboard. energyflow
 
Last edited:

bmwhitetx

Well-known member
First Name
Bruce
Joined
May 21, 2021
Threads
39
Messages
1,551
Reaction score
2,153
Location
DFW-Texas
Vehicles
2022 F150 Lightning Lariat ER
Occupation
Retired engineer
Mine's not as nice looking. Will have to look closer at yours.
Ford F-150 Lightning Home Assistant - Ford F150 Lightning Dashboard. 1700885721727
 
OP
OP
Aminorjourney

Aminorjourney

Well-known member
Joined
Jun 6, 2022
Threads
10
Messages
176
Reaction score
351
Location
Internet
Vehicles
vehicles that go
Mine's not as nice looking. Will have to look closer at yours.
1700885721727.png
Thank you for the kind words! I'm still tweaking the code base (and made some tweaks to what I'd put earlier).

For ease of use, I'm just updating the code in the original post, as I'm hoping it will become more useful as time goes on.

YAML is killing me right now - the formatting is ...VERY_picky.
 

queuewho

Well-known member
Joined
Oct 27, 2022
Threads
4
Messages
514
Reaction score
564
Location
Western PA
Vehicles
F150 Lightning Lariat SR
Pretty cool. If the api doesn't lock us out anymore for using this integration, then I am going to have to get this set up.
 
OP
OP
Aminorjourney

Aminorjourney

Well-known member
Joined
Jun 6, 2022
Threads
10
Messages
176
Reaction score
351
Location
Internet
Vehicles
vehicles that go
AFAIK, I think the FordPass API issues were caused by frequent accessing of the API. The current FordPass-HA is set to 900 sec polling (15 min intervals.)
 

Sponsored

queuewho

Well-known member
Joined
Oct 27, 2022
Threads
4
Messages
514
Reaction score
564
Location
Western PA
Vehicles
F150 Lightning Lariat SR
AFAIK, I think the FordPass API issues were caused by frequent accessing of the API. The current FordPass-HA is set to 900 sec polling (15 min intervals.)
Awesome. Looks like door locks and remote start are the only things that are actionable, correct?
 

bmwhitetx

Well-known member
First Name
Bruce
Joined
May 21, 2021
Threads
39
Messages
1,551
Reaction score
2,153
Location
DFW-Texas
Vehicles
2022 F150 Lightning Lariat ER
Occupation
Retired engineer
Thank you for the kind words! I'm still tweaking the code base (and made some tweaks to what I'd put earlier).

For ease of use, I'm just updating the code in the original post, as I'm hoping it will become more useful as time goes on.

YAML is killing me right now - the formatting is ...VERY_picky.
Yes YAML is very picky, never know when to use the leading dash. Mostly I copy and paste from others! Also had to figure out the attributes and getting those into their own sesnsor. These threads have been useful seeing what others have done.
https://www.f150lightningforum.com/forum/threads/downloading-charge-logs.16760
https://www.f150lightningforum.com/forum/threads/lightningrod-better-charge-logs.16807/
 

bmwhitetx

Well-known member
First Name
Bruce
Joined
May 21, 2021
Threads
39
Messages
1,551
Reaction score
2,153
Location
DFW-Texas
Vehicles
2022 F150 Lightning Lariat ER
Occupation
Retired engineer
Pretty cool. If the api doesn't lock us out anymore for using this integration, then I am going to have to get this set up.
I set up a second FordPass account and gave it access to my truck just in case. I use that with HA.
Also the integration has stopped working once or twice but the developer is good about fixing it. Just need to go into HA and update to the latest beta.
 

james_carey

Member
First Name
James
Joined
Mar 4, 2023
Threads
0
Messages
22
Reaction score
13
Location
Brentwood
Vehicles
2022 Ford F-150 Lightning
Occupation
Contractor
Love this! I am a complete newbie to this. Where do I begin?
 

Nick503955

Well-known member
First Name
Nick
Joined
Aug 31, 2022
Threads
6
Messages
119
Reaction score
104
Location
San Diego, CA
Vehicles
2023 Ford Lightning Lariat, 2021 Tesla Model Y

Sponsored

Nick503955

Well-known member
First Name
Nick
Joined
Aug 31, 2022
Threads
6
Messages
119
Reaction score
104
Location
San Diego, CA
Vehicles
2023 Ford Lightning Lariat, 2021 Tesla Model Y
Where can I find the image asset "/local/F150Lightningoverhead.jpg"?
 

Computermedic78

Well-known member
Joined
Nov 19, 2023
Threads
4
Messages
87
Reaction score
119
Location
NY
Vehicles
23 Lariat ER
This is way nicer than what I have set up. I have fordpass set up in HA, and know where to add the card yaml but it's giving me an error but doesnt tell me where. I didnt have a sensors.yaml before so I created one and added "sensors: !include sensors.yaml" to my configuration.yaml. Is that the correct thing to do?

Ford F-150 Lightning Home Assistant - Ford F150 Lightning Dashboard. Screenshot 2023-11-25 at 1.29.31 PM


Ford F-150 Lightning Home Assistant - Ford F150 Lightning Dashboard. Screenshot 2023-11-25 at 1.30.08 PM
 

Nick503955

Well-known member
First Name
Nick
Joined
Aug 31, 2022
Threads
6
Messages
119
Reaction score
104
Location
San Diego, CA
Vehicles
2023 Ford Lightning Lariat, 2021 Tesla Model Y
This is way nicer than what I have set up. I have fordpass set up in HA, and know where to add the card yaml but it's giving me an error but doesnt tell me where. I didnt have a sensors.yaml before so I created one and added "sensors: !include sensors.yaml" to my configuration.yaml. Is that the correct thing to do?

Screenshot 2023-11-25 at 1.30.08 PM.png
Sounds right. I followed this video's instructions on adding the custom sensors config include file:
 
 





Top