Sponsored

theUNSTABLE

Well-known member
First Name
Ryan
Joined
Feb 5, 2023
Threads
7
Messages
85
Reaction score
109
Location
Florida
Website
github.com
Vehicles
2023 F150 Lightning Lariat
Occupation
Cyber Engineer
Hello Internet strangers!

I am back after a good amount of going down through the rabbit holes.
After my initial post about vehicle data sharing link

I went down the rabbit hole of trying to find a way to self host my own App.
Hours of research later - yeah....you can, but it will be a pain, and its something I don't have time for.

However, a slight compromise I found was using HomeAssistant and creating your own Dashboard with lightning stats.
I posted about that here

After setting up a custom HomeAssistant card
Ford F-150 Lightning LightningROD - Better Charge Logs 1695872562804

I still wasn't happy.
I wanted a nice dashboard to display my charges.
I wanted a way to see all the data, from my Lightning, in a nice pretty interface.

During my research I found TeslaMate and thought it was beautiful, and exactly what I wanted.

So I decided to mirror it as best I can with my limited knowledge.

That is what brings me to this post, as I stay up way too late "coding".

I have put the scripts I created / used, automations (using Hass), and my own Grafana dashboard in my public Repo.
I'm calling it:

LightningROD
[R]ecord [o]f [D]ocks

Lightning Record of Docks (charges) because you dock when you plug in, and it's a Lightning
Yes, I'm a nerd

Here is the way it works for me and my setup
  • postgresql database running in a docker on Unraid
  • Grafana running in a docker on Unraid
  • HomeAssistant running in a VM with HACS and fordpass-ha
  • using HomeAssistant automation to kickoff my script, which will download the charge logs - and add them to my database


Anyway, I put a good amount of information in the github README

Here is a screenshot of what my current dashboard looks like
Ford F-150 Lightning LightningROD - Better Charge Logs LightningROD

I'm sure it will change over time
I'm sure other people will have better suggestions

I know other people are better developers than I am - this is my first time making a repo
I am open to collaboration

Theoretically this could probably work with the Mustang Mach-E, or any FordEV as long as they have an onboard modem. So feel free to share it to those forums or tell people about it.

Also one thing to note, the FordPass app, and by extension the API, appears to only store the last 20 or so charge logs.
So if you want some database of your charges, I recommend setting something up yourself

This is self hosted, but it does not stop Ford from also having your logs
This is just mimicking the FordPass App to make an API request (using the fordpass-ha) but downloading the data instead of displaying it

I initially planned on making it a standalone project, similar to TeslaMate but I just don't have that amount of time or skill so I figured I would post what I currently have an open myself up to collaboration.

I am happy to answer any questions

First one is probably going to be:
  • Q: Have you really only spent $85 on charging in 7 months?
  • A: Yes, I can charge for free at work - its great.
    • I also don't drive that often.... and these are the only logs I have available


Project can be found here:
https://github.com/SquidBytes/LightningROD
 

Grease Lightning

Well-known member
First Name
Johnathan
Joined
Sep 6, 2023
Threads
3
Messages
548
Reaction score
779
Location
Albany, Oregon USA
Vehicles
2023 F-150 Lightning XLT
I love it!!! I want this on may phone

Ford peeps, please pay this person and use this work and make a data app for us. I would happily pay a small monthly fee for access. Diversification of revenue sources 🤷‍♂️😊
 
OP
OP
theUNSTABLE

theUNSTABLE

Well-known member
First Name
Ryan
Joined
Feb 5, 2023
Threads
7
Messages
85
Reaction score
109
Location
Florida
Website
github.com
Vehicles
2023 F150 Lightning Lariat
Occupation
Cyber Engineer
Thanks! I'm really happy with it so far.

Grafana displays the data on a webpage, so for viewing on your phone you have a few options.
  1. Using Webpage cards in Hass
  2. Exposing the ports through your router (I wouldn't recommend)
  3. Cloudflare reverse tunnel
  4. VPN
  5. Some other option like a auto screenshot upload to Google drive or something if you just want to see the data once a day or something
  6. Some other way I haven't thought about
As I said above I would love to make it a standalone install where a user can just run a command to get it all setup, I'm just not there yet
 

bub

Well-known member
Joined
Sep 20, 2023
Threads
1
Messages
54
Reaction score
49
Location
Canada
Vehicles
F150 Lightning Plat
Very cool. Not to knock on what you've done by any means. But just to throw possible alternative ways to achieve the same thing.
HomeAssistant has a InfluxDB integration
https://www.home-assistant.io/integrations/influxdb/

You can use that to log changes to HA entities (or all of them). Without any code written it would then log all your fordpass-ha integration data into influx. Which you could then graph in grafana.

Ive been using these integrations for some whole house power monitoring and temperature graphs.
Ford F-150 Lightning LightningROD - Better Charge Logs 1695878461284
 
Last edited:
OP
OP
theUNSTABLE

theUNSTABLE

Well-known member
First Name
Ryan
Joined
Feb 5, 2023
Threads
7
Messages
85
Reaction score
109
Location
Florida
Website
github.com
Vehicles
2023 F150 Lightning Lariat
Occupation
Cyber Engineer
Very cool. Not to knock on what you've done by any means. But just to throw possible alternative ways to achieve the same thing.
HomeAssistant has a InfluxDB integration
https://www.home-assistant.io/integrations/influxdb/

You can use that to log changes to HA entities (or all of them). Without any code written it would then log all your fordpass-ha integration data into influx. Which you could then graph in grafana.

Ive been using these integrations for some whole house power monitoring and temperature graphs.
1695878461284.png
Yes, I looked into this.
The "problem" I ran into was it was reliant on what HomeAssistant sensors are able to gather - and currently there isn't any charging data integrated into the `fordpass-ha` integration.

I initially started going that route, but I have goals for what I want my dashboard to monitor and it became clear I was probably best to do a "standalone" option.

I did actually put a PullRequest and FeatureRequest out for the fordpass-ha integration and will happily work with that dev to integrate more sensors into Hass, I just do not have the knowledge on how to properly integrate things into Hass.
 
  • Like
Reactions: bub

Sponsored

mr.Magoo

Well-known member
Joined
May 27, 2022
Threads
21
Messages
554
Reaction score
631
Location
Michigan
Vehicles
2022 Lariat ER, AMB
Yes, I looked into this.
The "problem" I ran into was it was reliant on what HomeAssistant sensors are able to gather - and currently there isn't any charging data integrated into the `fordpass-ha` integration.

You could simply integrate it into Python directly, if you want.
https://www.influxdata.com/blog/getting-started-python-influxdb/

and/or pass your data to hass via mqtt.

Or use Node-red (I'm running all of my black box in node Red).

Both NodeRed and grafana are available as add-ons in hass.
 
Last edited:

MurphysLaww

Well-known member
Joined
Jan 20, 2022
Threads
6
Messages
130
Reaction score
79
Location
Austin, TX
Vehicles
2023 Lariat Lightning ER,Cayman,Q7 Overlanded
Occupation
Systems Engineer
Pretty cool. I’m going to have to see if I can implement this. We’re building a 3600 watt offgrid solar array who’s sole electrical purpose(it’s also going to be an Agrivoltaic/ML project) is to charge the Lightning, and power a mini-split/heat pump for the garage. I’m going to want to track breakeven pretty closely. This looks like the ticket, or close to it.
Although it looked like we were dropping Grafana at work, it looks like it’s making a comeback, so I need to jump back in anyway after some Wavefront time.
 
OP
OP
theUNSTABLE

theUNSTABLE

Well-known member
First Name
Ryan
Joined
Feb 5, 2023
Threads
7
Messages
85
Reaction score
109
Location
Florida
Website
github.com
Vehicles
2023 F150 Lightning Lariat
Occupation
Cyber Engineer
You could simply integrate it into Python directly, if you want.
https://www.influxdata.com/blog/getting-started-python-influxdb/

and/or pass your data to hass via mqtt.

Or use Node-red (I'm running all of my black box in node Red).

Both NodeRed and grafana are available as add-ons in hass.
I'm actually working on the `fordpass-ha` integration to add sensors specific to EV's. I've opened a pull request that has a charge_log function, and one that creates a charge status sensor.

For Influx, I'm working on moving LightingROD over to Influx so the end user would have multiple choices.
Hass with Influx - just use the Sensors from `fordpass-ha`
Influx no Hass - run LightningROD to put charge data into Influx

I'm running into a good amount of issues with my InfluxDB docker and inserting data via python, but I'm working on it.
 
OP
OP
theUNSTABLE

theUNSTABLE

Well-known member
First Name
Ryan
Joined
Feb 5, 2023
Threads
7
Messages
85
Reaction score
109
Location
Florida
Website
github.com
Vehicles
2023 F150 Lightning Lariat
Occupation
Cyber Engineer
Pretty cool. I’m going to have to see if I can implement this. We’re building a 3600 watt offgrid solar array who’s sole electrical purpose(it’s also going to be an Agrivoltaic/ML project) is to charge the Lightning, and power a mini-split/heat pump for the garage. I’m going to want to track breakeven pretty closely. This looks like the ticket, or close to it.
Although it looked like we were dropping Grafana at work, it looks like it’s making a comeback, so I need to jump back in anyway after some Wavefront time.
I'm working on integrating proper EV / Lighting sensors into the `fordpass-ha` integration.
Currently I was able to add a function that downloads the charge logs
I also added a charge status sensor that displays the available data - but mainly the charging speed.

I'm hoping to be able to get a few switches in place to `Start Chaging` , `Stop Charging`, `Charge to 100%` , any other options I can find.

These will work best being integrated into HomeAssistant - which then could be integrated into automation..... probably perfect for your situation.

For Example:
If you're generating excess solar - Start Charging
If you need more power - Stop Charging
Charging already started and you still have excess solar - Charge to 100%
etc

Obviously you would need HomeAssistant and have your solar setup integrated.

If charging sensors are integrated into HomeAssistant, either by me or someone else, it would make LightningROD obsolete other than specific Grafana dashboards, but I'm still going to try to make it a nice easy standalone install for people only doing self hosting.
If someone has Hass, then they could easily use their own Dashboard or LightningROD as a template.
 
OP
OP
theUNSTABLE

theUNSTABLE

Well-known member
First Name
Ryan
Joined
Feb 5, 2023
Threads
7
Messages
85
Reaction score
109
Location
Florida
Website
github.com
Vehicles
2023 F150 Lightning Lariat
Occupation
Cyber Engineer
ALSO Slight update...somewhat.

The `fordpass-ha` integration is currently not working.
It appears as though Ford has changed their API backed.
Issue Here

It looks like the moved over to `api.autonomic.ai`
If you visit https://autonomic.com/ it says
" In 2023, Autonomic became fully integrated with Ford Motor Company."

I'm working on seeing if I can help the dev fix the API issues since I've been in this code adding sensors.

I'm also curious if this means Ford could possibly be close to opening the API, which would mean there is no Lockout risk - provided the integration is able to use OAuth
 

Sponsored

Avocadodude

Well-known member
First Name
Kurt
Joined
Feb 24, 2022
Threads
12
Messages
674
Reaction score
731
Location
Fallbrook, CA
Vehicles
F150 Lariat
Hello Internet strangers!

I am back after a good amount of going down through the rabbit holes.
After my initial post about vehicle data sharing link

I went down the rabbit hole of trying to find a way to self host my own App.
Hours of research later - yeah....you can, but it will be a pain, and its something I don't have time for.

However, a slight compromise I found was using HomeAssistant and creating your own Dashboard with lightning stats.
I posted about that here

After setting up a custom HomeAssistant card
1695872562804.png

I still wasn't happy.
I wanted a nice dashboard to display my charges.
I wanted a way to see all the data, from my Lightning, in a nice pretty interface.

During my research I found TeslaMate and thought it was beautiful, and exactly what I wanted.

So I decided to mirror it as best I can with my limited knowledge.

That is what brings me to this post, as I stay up way too late "coding".

I have put the scripts I created / used, automations (using Hass), and my own Grafana dashboard in my public Repo.
I'm calling it:

LightningROD
[R]ecord [o]f [D]ocks

Lightning Record of Docks (charges) because you dock when you plug in, and it's a Lightning
Yes, I'm a nerd

Here is the way it works for me and my setup
  • postgresql database running in a docker on Unraid
  • Grafana running in a docker on Unraid
  • HomeAssistant running in a VM with HACS and fordpass-ha
  • using HomeAssistant automation to kickoff my script, which will download the charge logs - and add them to my database


Anyway, I put a good amount of information in the github README

Here is a screenshot of what my current dashboard looks like
LightningROD.png

I'm sure it will change over time
I'm sure other people will have better suggestions

I know other people are better developers than I am - this is my first time making a repo
I am open to collaboration

Theoretically this could probably work with the Mustang Mach-E, or any FordEV as long as they have an onboard modem. So feel free to share it to those forums or tell people about it.

Also one thing to note, the FordPass app, and by extension the API, appears to only store the last 20 or so charge logs.
So if you want some database of your charges, I recommend setting something up yourself

This is self hosted, but it does not stop Ford from also having your logs
This is just mimicking the FordPass App to make an API request (using the fordpass-ha) but downloading the data instead of displaying it

I initially planned on making it a standalone project, similar to TeslaMate but I just don't have that amount of time or skill so I figured I would post what I currently have an open myself up to collaboration.

I am happy to answer any questions

First one is probably going to be:
  • Q: Have you really only spent $85 on charging in 7 months?
  • A: Yes, I can charge for free at work - its great.
    • I also don't drive that often.... and these are the only logs I have available


Project can be found here:
https://github.com/SquidBytes/LightningROD
Do we have to get @Lightning Rod to sign off on the name 🤣
Kidding aside, looks like another project I'll have to investigate (when I get my truck back). Been trying to get a better charging/cost log.
 
Last edited:
OP
OP
theUNSTABLE

theUNSTABLE

Well-known member
First Name
Ryan
Joined
Feb 5, 2023
Threads
7
Messages
85
Reaction score
109
Location
Florida
Website
github.com
Vehicles
2023 F150 Lightning Lariat
Occupation
Cyber Engineer
Project update:
Ford has moved over to their new API.
This broke everything, including the `fordpass-ha` HomeAssistant integration.

I have been working with the `fordpass-ha` developer to implement EV specific sensors.
I have plans to continue working on, and contributing, to the `fordpass-ha` integration. I would love to being able to add a bunch of cool new sensors specific to EV's from what the new API returns.

If you're not using HomeAssistant - I recommend it.

Currently LightningROD, as available from my repo, does not work.

Moving forward I plan on having 2 setup options for someone if they want to setup a self hosted log & display (LightningROD)

1) Alongside an existing HomeAssistant install. This would be instructions on how to get a database setup, and map fordpass sensors into the database. Then it would still use a grafana dashboard to display everything. This would be an easy install provided someone is already using HomeAssistant and the `fordpass-ha` integration

2) Standalone, or bypassing HomeAssistant. This setup wouldn't rely on sensors in HomeAssistant, instead it would use python to grab your json data, add the specific items of interest to a database, and use grafana to display everything. This would be "harder", but wouldn't need any existing installations.

The data should be exactly the same for both installations, because they would both be logging the same information, and both be displaying from grafana. The only difference is how that data is obtained.


If people are interested in this, or want something similar; I would love to get some feedback about things they would like to see logged. This will help me see if I'm able to obtain that information, and how to go about displaying it.
The items in the current dashboard are what I'm still planning on targeting, It would just be helpful if there are people that might have other suggestions.

One of my goals is to have a "regenerative braking" section. That, over time, would show how much energy / miles gained from regen braking.
 
Last edited:

MurphysLaww

Well-known member
Joined
Jan 20, 2022
Threads
6
Messages
130
Reaction score
79
Location
Austin, TX
Vehicles
2023 Lariat Lightning ER,Cayman,Q7 Overlanded
Occupation
Systems Engineer
ALSO Slight update...somewhat.

The `fordpass-ha` integration is currently not working.
It appears as though Ford has changed their API backed.
Issue Here

It looks like the moved over to `api.autonomic.ai`
If you visit https://autonomic.com/ it says
" In 2023, Autonomic became fully integrated with Ford Motor Company."

I'm working on seeing if I can help the dev fix the API issues since I've been in this code adding sensors.

I'm also curious if this means Ford could possibly be close to opening the API, which would mean there is no Lockout risk - provided the integration is able to use OAuth
Hmm.

As we start the Solar Truck charger Array project, (two test panels up, with actuators for sun tracking!) I'm not sure I want to be at the Whim of Ford.

Most of my projects use the Arduino cloud, and I may add my own shunt to track charging and integrate it into that. For me, tracking payback on the project, won't matter if it's Lightning charging or Mini-split usage. We've picked up an EG4 hybrid inverter which, it appears, is integrated into Solar Assistant. I may use that while I build something for myself.
 
OP
OP
theUNSTABLE

theUNSTABLE

Well-known member
First Name
Ryan
Joined
Feb 5, 2023
Threads
7
Messages
85
Reaction score
109
Location
Florida
Website
github.com
Vehicles
2023 F150 Lightning Lariat
Occupation
Cyber Engineer
Hmm.

As we start the Solar Truck charger Array project, (two test panels up, with actuators for sun tracking!) I'm not sure I want to be at the Whim of Ford.

Most of my projects use the Arduino cloud, and I may add my own shunt to track charging and integrate it into that. For me, tracking payback on the project, won't matter if it's Lightning charging or Mini-split usage. We've picked up an EG4 hybrid inverter which, it appears, is integrated into Solar Assistant. I may use that while I build something for myself.
Replying to you, but also another project update.

I'm now an official contributor to the 'fordpass-ha' integration. I have been helping the dev with issues, documentation, and additional features. It's just me and him.

I have been going through all the data and mapping new sensors, expanding attributes, and ensuring functionality. Specifically tailored to EV and the Lightning.

It's coming along very well. The new API has its difficulties, but there is a lot of extra data available to be obtained.

Last night I added trip report attributes under the elVeh sensor. I've previously added a dedicated charging sensor, motor voltage, amperage, temperature , etc.

I still highly recommend HomeAssistant, take a look at what we've been working on. https://github.com/itchannel/fordpass-ha

Once we get the HA integration into a stable point with the features we want - I plan on getting LightningROD back into a working state.

I want to implement a way to upload past json data (what's returned from the API) because as time goes on my graphs are not updated.

In the meantime, if you're wanting vehicle charging logs and other things, I recommend at least every 10 charges to grab your logs from the API. (I believe Ford is only storing around 20 charges in the API, so that data can be lost if it's not personally saved) I believe the charging data is in the new API return, but I haven't fully verified and looked into it, I have been very busy.

The HA integration includes a script to download the API return to a json. It can be run independently with a few tweaks, and doesn't need a HA setup. The Wiki has a tutorial on how to run it.

If anyone is wanting to run this, and is having difficulties reach out to me and I am happy to help. I just don't know the interest and if people know how to run it.

If I have the time I'll have a dedicated tutorial on the LightningROD page, with updates to make it entirely standalone. But currently all of my development efforts, and minimal free time, have been focused on the HA integration.

Once I get LightningROD up and running I plan on having a way to run it with and without HA.

Considering it is mainly just Grafana graphs, and various queries, the hard part is grabbing the data. This is basically already created by either the script, or the integration. It's just in json format and not in a database. That is the work in progress.
 
Last edited:

bmwhitetx

Well-known member
First Name
Bruce
Joined
May 21, 2021
Threads
40
Messages
1,658
Reaction score
2,306
Location
DFW-Texas
Vehicles
2022 F150 Lightning Lariat ER
Occupation
Retired engineer
I’m going to try this when I get a chance. The one thing I wish the charge logs would store is odometer reading. Is that available? I’m old school in that I treat my charge sessions like gas fillups and store in Excel. And if you have odometer you can do all sorts of calculations like trip mi/kWh, avg miles/year, etc. Sometimes I forget to get the odometer reading at charge time.
Sponsored

 
 





Top