Sponsored
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
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.
Yeah, odometer is very easy to grab. Its already a sensor in HA, but I planned on also using it in LightningROD.
For some conversions you don't need the odometer, because the distance traveled is already reported, but doesn't hurt to have extra values.

Once I get things running in a DB, the queries should be easy because it will based off time.
Time of odometer here, charge here, difference, etc

I just need the time to run through things and getting it working properly.
Sponsored

 

sstevetx

Well-known member
First Name
Steve
Joined
Sep 3, 2023
Threads
2
Messages
216
Reaction score
342
Location
Dallas, TX
Vehicles
2022 Lariat ER w/Max Tow - Atlas Blue
Very nice. I just setup the HA integration and I like the extra info like 12v battery percentage and windows position. I setup a 2nd Ford account like your Github wiki outlines just to be safe. Here is how mine looks currently. I only charged to 100% last night, because I am heading out to my parent's house today which is a longer drive than normal.

Ford F-150 Lightning LightningROD - Better Charge Logs 1697890968234
 

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
@sstevetx Here's mine - just the FP integration turned on. Took a while to realize I had to authorize the second account I set up from the first account. Looks like coolant temp is 59 for both of us - maybe an issue? Not sure what fordpass_oil correlates to. And the last_refresh doesn't make sense.

Ford F-150 Lightning LightningROD - Better Charge Logs 1697930978294
 

sstevetx

Well-known member
First Name
Steve
Joined
Sep 3, 2023
Threads
2
Messages
216
Reaction score
342
Location
Dallas, TX
Vehicles
2022 Lariat ER w/Max Tow - Atlas Blue
I just checked HA and mine still shows 59, so that must be a bug. I used car scanner (screenshot below) and my engine coolant is actually 91.4F currently.

Refresh is odd on mine too showing 5 hours. If you go into settings, devices, ford pass and click device you can see a logbook section at the bottom showing refreshes. Mine is refreshing every 15 minutes in reality. I know this is a work in progress still, but it is promising.
Ford F-150 Lightning LightningROD - Better Charge Logs Screenshot_20231021_192145
 
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
Looks like coolant temp is 59 for both of us - maybe an issue? .
Coolant temp is mapped to `engineCoolantTemp`. However, now that you mention yours is 59F, I went through and checked all my logs. My `engineCoolantTemp` is ALWAYS 15C (C is default in the json) in my logs. It must not be accurately mapped to the High Voltage Coolant. I took a look around and didn't see anything related to battery coolant, so that might not be returned in the API. I can add a check for that sensor to remove it if the vehicle is an EV.

Not sure what fordpass_oil correlates to
Oil correlates to `oilLifeRemaining`, which is going to always be 100% for an EV. Similar to the, now known wrong CoolantTemp, I can add an EV check.

last_refresh doesn't make sense.
Known bug with the way HomeAssistant displays time, I recently fixed this and will be fixed in the next release.

I know this is a work in progress still, but it is promising.
It is, but its going well. If you have any specific requests, or an issue please post them to the GitHub, it is easier to track there.

I've opened issues / requests for the CoolantTemp, and Oil. Will probably fix those so they won't show up for EV's in next release.
 

Sponsored
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:
I have VERY minimal free time (new baby) but I'll try to update as I can.

I basically rewrote the entire code using things I worked with on the Fordpass-ha integration, and a setup for InfluxDB. The integration is now using InfluxDB to store the logs.

I haven't had any free time to update the Grafana dashboard, or ensure this is working after the recent authentication change.
I also haven't had any free time to work more on the fordpass-ha integration.

So its basically stalled right now, but if the auth method still works, it is logging charges. If it isn't, it should be simple to move over to the new auth method and I should be able to do that soon.

Once I get the auth method fixed/confirmed working I'll have a new Grafana dashboard.

Then I'll probably make a new repo with various custom HA cards from the community and some of my own, provided people are okay either contributing or having me add them.

Will continue to update as I can
 

r81stl1n

Member
Joined
Nov 9, 2023
Threads
0
Messages
6
Reaction score
2
Location
NJ
Vehicles
2023 F150 Lightning Lariat ER
Project Update:
I have VERY minimal free time (new baby) but I'll try to update as I can.

I basically rewrote the entire code using things I worked with on the Fordpass-ha integration, and a setup for InfluxDB. The integration is now using InfluxDB to store the logs.

I haven't had any free time to update the Grafana dashboard, or ensure this is working after the recent authentication change.
I also haven't had any free time to work more on the fordpass-ha integration.

So its basically stalled right now, but if the auth method still works, it is logging charges. If it isn't, it should be simple to move over to the new auth method and I should be able to do that soon.

Once I get the auth method fixed/confirmed working I'll have a new Grafana dashboard.

Then I'll probably make a new repo with various custom HA cards from the community and some of my own, provided people are okay either contributing or having me add them.

Will continue to update as I can
I wanted to say, reading this entire thread, this is awesome work.
 

Zprime29

Well-known member
First Name
Brandon
Joined
Jul 26, 2022
Threads
37
Messages
2,033
Reaction score
2,113
Location
Tucson, AZ
Vehicles
2022 Lightning ER, 2025 XC90 Recharge
Project Update:
I have VERY minimal free time (new baby) but I'll try to update as I can.

I basically rewrote the entire code using things I worked with on the Fordpass-ha integration, and a setup for InfluxDB. The integration is now using InfluxDB to store the logs.

I haven't had any free time to update the Grafana dashboard, or ensure this is working after the recent authentication change.
I also haven't had any free time to work more on the fordpass-ha integration.

So its basically stalled right now, but if the auth method still works, it is logging charges. If it isn't, it should be simple to move over to the new auth method and I should be able to do that soon.

Once I get the auth method fixed/confirmed working I'll have a new Grafana dashboard.

Then I'll probably make a new repo with various custom HA cards from the community and some of my own, provided people are okay either contributing or having me add them.

Will continue to update as I can
Appreciate the updates, enjoy the new baby!
 

ziptbm

Well-known member
Joined
Jan 4, 2023
Threads
8
Messages
89
Reaction score
37
Location
Michigan
Vehicles
'22 MME GT & '22 F150 Lightning Lariat ER
Project Update:
I have VERY minimal free time (new baby) but I'll try to update as I can.

I basically rewrote the entire code using things I worked with on the Fordpass-ha integration, and a setup for InfluxDB. The integration is now using InfluxDB to store the logs.

I haven't had any free time to update the Grafana dashboard, or ensure this is working after the recent authentication change.
I also haven't had any free time to work more on the fordpass-ha integration.

So its basically stalled right now, but if the auth method still works, it is logging charges. If it isn't, it should be simple to move over to the new auth method and I should be able to do that soon.

Once I get the auth method fixed/confirmed working I'll have a new Grafana dashboard.

Then I'll probably make a new repo with various custom HA cards from the community and some of my own, provided people are okay either contributing or having me add them.

Will continue to update as I can
Congrats on the growing fam!

I'm just now getting caught up on your awesome work. My latest goal is to get trip and lifetime efficiency data into Home Assistant, so there has to be a way to do this with either LightningROD or something from the HA integration, but I haven't yet figured it out.

One thing I'm not clear about from the readme is if it's possible to install this on a device running HAOS. I've got Influx and Grafana already installed as add-ons, but I'm using those very minimally at the moment. Is it possible to install LightningRod on an HA device in this config or did I miss these install steps somewhere?
 
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
Congrats on the growing fam!
Thanks, it has been very tricky to find any free time.

I'm just now getting caught up on your awesome work. My latest goal is to get trip and lifetime efficiency data into Home Assistant, so there has to be a way to do this with either LightningROD or something from the HA integration, but I haven't yet figured it out.
I know HomeAssistant stores logs for sensors, so if you want, you should be able to bypass LightningROD and just use the sensor data from the forpass-ha integration. You would just want to change the amount of time to keep. I am still new to HomeAssistant so I'm not sure how to do that.

I was hoping to be able to show a way for people to use both LightningROD and/or fordpass-ha for logs. This way someone could run LightningROD for better logs without needing HA. But if they did have HA they could just use that system instead of having another thing - I just haven't gotten around to that.


One thing I'm not clear about from the readme is if it's possible to install this on a device running HAOS. I've got Influx and Grafana already installed as add-ons, but I'm using those very minimally at the moment. Is it possible to install LightningRod on an HA device in this config or did I miss these install steps somewhere?
You should be able to provided that HAOS can run python. You might just need to pip install the influx module.
I have neglected to update the readme. My last update was a quick hack together script to import the json data into Influx. I have yet to get a grafana dashboard working with Influx since the query syntax is different.
 

Sponsored

ziptbm

Well-known member
Joined
Jan 4, 2023
Threads
8
Messages
89
Reaction score
37
Location
Michigan
Vehicles
'22 MME GT & '22 F150 Lightning Lariat ER
you should be able to bypass LightningROD and just use the sensor data from the forpass-ha integration. You would just want to change the amount of time to keep. I am still new to HomeAssistant so I'm not sure how to do that.
I saw the value for last trip efficiency as an attribute under the _elveh sensor and set up a template helper sensor to pull it as an individual sensor, and then track moving forward through HA history. Here's the template I set up for it.

{{ state_attr('sensor.fordpass_elveh', 'Trip Efficiency') }}

Unfortunately, what I'm still missing is the lifetime value and since I haven't been logging it myself over the last year, so I've got incomplete data.

The formula should be a fairly simple equation, right? It's how many miles (odometer reading from when I took ownership) divided by the energy consumed (number of kWh used since I took ownership). Miles for me is fifty less than odometer, which has an HA sensor already. So, the question is if there's some way to find the energy consumed to date.

There's an attribute of the _elveh sensor for "Trip Energy Consumed" but this is only helpful if I'm trying to build my own sensor for lifetime, which I would still need all the historical data for the last year. That's why I'm hopeful there's some sort of lifetime energy consumed data accessible somewhere...fingers crossed.



Regarding installing LightningROD on HAOS, since I've already got Grafana and Influx installed as HA add-ons (which I understand are docker instances set up by HA), I'm hesitant to install another or mess up the base OS since I'm not proficient at Linux. It's on my list to try to figure it out!




Unrelated to the Lightning, there's plenty of great value HA can provide for new kids. The first thing I set out for mine was to build a smart baby monitor where it listens to the audio from my camera feed in the room and alerts me when the decibels go over a certain threshold for a short period of time with a visual snapshot and quick access to the camera. It's also nice to see how many times the kiddos wake up in their sleep. Enjoy 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
Unfortunately, what I'm still missing is the lifetime value and since I haven't been logging it myself over the last year, so I've got incomplete data.
As a data nerd I understand this frustration.

The formula should be a fairly simple equation, right? It's how many miles (odometer reading from when I took ownership) divided by the energy consumed (number of kWh used since I took ownership). Miles for me is fifty less than odometer, which has an HA sensor already. So, the question is if there's some way to find the energy consumed to date.
Yes, you should be able to "guess" what it would be - it just won't be 100% accurate.

There's an attribute of the _elveh sensor for "Trip Energy Consumed" but this is only helpful if I'm trying to build my own sensor for lifetime, which I would still need all the historical data for the last year. That's why I'm hopeful there's some sort of lifetime energy consumed data accessible somewhere...fingers crossed.
I'll take a look through the json data I have and the new developments with the API and see if there is some way to find historical data. If not, assumptions can be made based on odometer reading and average efficiency.


Regarding installing LightningROD on HAOS, since I've already got Grafana and Influx installed as HA add-ons (which I understand are docker instances set up by HA), I'm hesitant to install another or mess up the base OS since I'm not proficient at Linux. It's on my list to try to figure it out!
LightningROD isn't really anything to "install" its just a python script. The module you may need to install is also just more python scripts. Provided HAOS runs python (which I'm pretty sure it does) you would just place the scripts in a location and run it.



Unrelated to the Lightning, there's plenty of great value HA can provide for new kids. The first thing I set out for mine was to build a smart baby monitor where it listens to the audio from my camera feed in the room and alerts me when the decibels go over a certain threshold for a short period of time with a visual snapshot and quick access to the camera. It's also nice to see how many times the kiddos wake up in their sleep. Enjoy it!
Good ideas. I went the "offline" route for all monitors for the kids, since I'm in the industry that makes me want to remove all "smart" devices, phones, and assistants (other than HA because its local).
I have setup some automations with zigbee buttons the toddler can press to turn on her lights and things.
 
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
If you're using the fordpass-ha integration, there should be a script called "autonomicData.py" - provided that script still works it will download a json file.

That json file is basically the text form of the data the FordPass App shows - which is what the integrations are using to display different (since I hate the FordPass App).

You could peek through that and see if you see anything of interest you would like added - from there you can open tickets on the fordpass-ha integration, or comment on LightningROD and it could be added / implemented when I get around it.

Check here if you need some help. I wrote up a tutorial a while ago

But the main dev of fordpass-ha has been doing a bunch of updates, he is the one responsible for a majority of the work.
 

mr.Magoo

Well-known member
Joined
May 27, 2022
Threads
21
Messages
554
Reaction score
631
Location
Michigan
Vehicles
2022 Lariat ER, AMB
I'm just now getting caught up on your awesome work. My latest goal is to get trip and lifetime efficiency data into Home Assistant, so there has to be a way to do this with either LightningROD or something from the HA integration, but I haven't yet figured it out.
I know HomeAssistant stores logs for sensors, so if you want, you should be able to bypass LightningROD and just use the sensor data from the forpass-ha integration. You would just want to change the amount of time to keep. I am still new to HomeAssistant so I'm not sure how to do that.


I personally don't think HomeAssistant (as much as I love it) is the best medium to store any lifetime logs.
A) It uses SQL which isn't the best solution for sensor data
B) As far as I know you can't set a DB purge by device, let alone entity - so if you want to store a lifetime you're forced to store a lifetime of everything-yes, you can exclude sensors / domains, but now they're excluded from any logs, so you can't have the cookie and eat it in this case.
https://www.home-assistant.io/integrations/recorder/

In my opinion the better solution is to keep HA data in the SQL database but purge it to whatever frequency you want to keep, I think I have mine set to a month and then push all lifetime data to InfluxDB (I have weather plus water/electricity consumption and my Lightning logs/data there).
You have addons / integrations for both InfluxDB and Grafana in HA so it's not like you have to set up a completely different system to do this.
 

ziptbm

Well-known member
Joined
Jan 4, 2023
Threads
8
Messages
89
Reaction score
37
Location
Michigan
Vehicles
'22 MME GT & '22 F150 Lightning Lariat ER
If you're using the fordpass-ha integration, there should be a script called "autonomicData.py" - provided that script still works it will download a json file.

That json file is basically the text form of the data the FordPass App shows - which is what the integrations are using to display different (since I hate the FordPass App).

You could peek through that and see if you see anything of interest you would like added - from there you can open tickets on the fordpass-ha integration, or comment on LightningROD and it could be added / implemented when I get around it.

Check here if you need some help. I wrote up a tutorial a while ago

But the main dev of fordpass-ha has been doing a bunch of updates, he is the one responsible for a majority of the work.
Thanks. The script still works and your tutorial was SUPER helpful. I have the file, but need to spend some more time trying to decipher it to see if there's anything helpful there for long-term energy charged to the battery...or even battery charge cycles would be helpful...either way, will carve out some time later to see if I can find anything there.

In the meantime, I've now created the following to start tracking this value starting today:
  • template sensor to pull from _elveh for Last Trip Distance Traveled as "Vehicle Last Trip Distance Traveled"
  • template sensor to pull from _elveh for Last Trip Energy Consumed as "Vehicle Last Trip Energy Consumed"
  • Utility Meter Helper to track the delta values for each time "Vehicle Last Trip Distance Traveled" changes, so it is now like an odometer and goes up with each drive - as "Vehicle Distance Traveled"
  • Utility Meter Helper to track the delta values for each time "Vehicle Last Trip Energy Consumed" goes up, same as the other Utility Meter Helper as "Vehicle Energy Consumed"
  • Template sensor to take the value of "Vehicle Distance Traveled" and divide it by the value of "Vehicle Energy Consumed", so this should serve as a running average of efficiency starting today.....
Step in the right direction, but still missing almost a year's worth of data. :). Hope to find something in the json and will file a ticket accordingly if I do. Really hoping you find a way to control charge on/off and charge to 100%. Thanks again!
Sponsored

 
 





Top