Sponsored

ericpullen

Well-known member
First Name
Eric
Joined
Jan 4, 2022
Threads
31
Messages
269
Reaction score
483
Location
Louisville, KY
Vehicles
22 F-150 Lightning & 22 Mach-E
I'm happy to announce a new Python based library for the Ford Charge Station Pro.
https://github.com/ericpullen/fcsp-api

[Update 2025-06-30]
It is also available as a PyPi package as well:
https://pypi.org/project/fcsp-api/

Currently the library can authenticate and get the basic information allowed by the local API (charge state, max amp setting, station ID, and a few other minor details). The big thing here is we can use it to see if something is plugged into it, if it is charging or not, when it is disconnected, or when a charge error occurs.

You will need to understand the basics of using Python to run this, but its pretty straight forward. There are 2 example apps, one that gives you a bunch of charging info and test some various state functions (fcsp_charging_state.py) and another one that simply polls the FCSP to see what the current state is and report to the screen when it changes (fcsp_state_monitor.py).

Here is an example of the fcsp_state_monitor.py:

Bash:
epullen@EricsM4MegaMini:code/fcsp-api ‹main›$ python examples/fcsp_state_monitor.py
? FCSP State Monitor
? Polling every 30 seconds
? Press Ctrl+C to stop
==================================================
? Getting initial state...
? Initial state: ? CS02 - Charging
? Starting monitoring loop...
I'm going to continue looking at the internals of the FCSP, but this should give people a great starting point to look deeper at what the local FCSP api can offer. If you want to contribute code, please just create a pull-request and I'll take a look at it.
Sponsored

 
Last edited:

Aminorjourney

Well-known member
Joined
Jun 6, 2022
Threads
12
Messages
246
Reaction score
465
Location
Internet
Vehicles
vehicles that go
Not sure which place you'd like me to put this. BUT.

There seem to be two different statuses from the API.

1) Within get_status() which seems to hold charging_state values of "CE012" or "CS010" - I've seen both in logs. I don't know what these are for or how they seemingly relate to the unit.

2) Within get_charger_info() which seems to hold the same state values of "CS00", "CS01", and "CS02" listed above to denote charging status.

INTERESTINGLY, "CS02" is regardless of direction of power transfer. I tested this with my HIS, and the state field gave me "CSO2" when the power transfer began.

I've taken @ericpullen's foundation and tried to build an HA integration into it. So far, I'm seeing most of the info already discovered, but nothing yet regarding power transfer currents.

I've also seen something a little fun - get_wifi_networks() should not be used unless you actually want to scan for WiFi networks. I accidentally got it going into the 'white' LED scanning mode. Thinking about it, it did exactly what I wanted it to do ;) But I wasn't ready for it lol ;)
 
OP
OP
ericpullen

ericpullen

Well-known member
First Name
Eric
Joined
Jan 4, 2022
Threads
31
Messages
269
Reaction score
483
Location
Louisville, KY
Vehicles
22 F-150 Lightning & 22 Mach-E
All of the status messages were just discovered by testing various changes to my FCSP. Since I don’t have HIS, I can’t really test it, but not surprised they just used that same status code for power going in or out.

One thing to note, the FCSP actually has 2 processing units built into it. The one I’m hitting is the generic TI embedded system and is the one you can see on the P3 UART. The other one is some Siemens embedded system that doesn’t look like Linux, but is some other Versicharge S7 PLC. Not sure it’s worth going too deep on that one, other than to try and read data from the RS485 at some point.
 

Sponsored

Pacific.NW

Member
First Name
Christian
Joined
Apr 17, 2025
Threads
1
Messages
18
Reaction score
16
Vehicles
2022 Lightning Lariat ER
I don’t have an FCSP, but just wanted to hat-tip for your work!
 

Aminorjourney

Well-known member
Joined
Jun 6, 2022
Threads
12
Messages
246
Reaction score
465
Location
Internet
Vehicles
vehicles that go
All of the status messages were just discovered by testing various changes to my FCSP. Since I don’t have HIS, I can’t really test it, but not surprised they just used that same status code for power going in or out.

One thing to note, the FCSP actually has 2 processing units built into it. The one I’m hitting is the generic TI embedded system and is the one you can see on the P3 UART. The other one is some Siemens embedded system that doesn’t look like Linux, but is some other Versicharge S7 PLC. Not sure it’s worth going too deep on that one, other than to try and read data from the RS485 at some point.
This makes sense. So we're pulling most of the data from the TI Embedded system.

I'm hoping I will *soon* be able to put a passive HA integration together that can hit most of the sensible info, and I have captured three separate state IDs for the HIS inverter.

It seems to sit at 0. If a backup session starts, it switches to 1, and then when everything actually starts transferring power, 5.

In *other* cringeworthy stuff, did you notice that the API not only puts out the ID of the station but the password you need to access it? That has to be a massive security flaw.
 
OP
OP
ericpullen

ericpullen

Well-known member
First Name
Eric
Joined
Jan 4, 2022
Threads
31
Messages
269
Reaction score
483
Location
Louisville, KY
Vehicles
22 F-150 Lightning & 22 Mach-E
If only they had a massive security flaw for the ssh implementation so I can get in and poke around at the python code they have written. ?
 

Aminorjourney

Well-known member
Joined
Jun 6, 2022
Threads
12
Messages
246
Reaction score
465
Location
Internet
Vehicles
vehicles that go
Ha! Right!

I have the basics of a very basic HA integration that *should*, by the end of the week, be installable via HACs... I do need to bundle your fcsp_api though, unless you're willing to make it available on pypi or elsewhere so I can list it as a dependency :)

That said, I'm very very inexperienced and an autodidact, so I'm sure someone smarter can do it quicker ;)
 

rgrandy

Member
Joined
Jul 31, 2024
Threads
1
Messages
5
Reaction score
0
Location
Texas
Vehicles
F150 Lightning
Ha! Right!

I have the basics of a very basic HA integration that *should*, by the end of the week, be installable via HACs... I do need to bundle your fcsp_api though, unless you're willing to make it available on pypi or elsewhere so I can list it as a dependency :)

That said, I'm very very inexperienced and an autodidact, so I'm sure someone smarter can do it quicker ;)
This is great! I'm just getting my lightning HA dashboard setup and would love to add this!
 

Sponsored
OP
OP
ericpullen

ericpullen

Well-known member
First Name
Eric
Joined
Jan 4, 2022
Threads
31
Messages
269
Reaction score
483
Location
Louisville, KY
Vehicles
22 F-150 Lightning & 22 Mach-E
I think I can get it up on PyPi, let me look at that today.
 
OP
OP
ericpullen

ericpullen

Well-known member
First Name
Eric
Joined
Jan 4, 2022
Threads
31
Messages
269
Reaction score
483
Location
Louisville, KY
Vehicles
22 F-150 Lightning & 22 Mach-E
Ha! Right!

I have the basics of a very basic HA integration that *should*, by the end of the week, be installable via HACs... I do need to bundle your fcsp_api though, unless you're willing to make it available on pypi or elsewhere so I can list it as a dependency :)

That said, I'm very very inexperienced and an autodidact, so I'm sure someone smarter can do it quicker ;)
Here is the pypi project:
https://pypi.org/project/fcsp-api/
 

bmwhitetx

Well-known member
First Name
Bruce
Joined
May 21, 2021
Threads
45
Messages
2,613
Reaction score
3,689
Location
DFW-Texas
Vehicles
2022 F150 Lightning Lariat ER
Occupation
Retired engineer
I noticed the Installation steps on both your git and pypi say:
Code:
git clone https://github.com/yourusername/fcsp-api.git
Shouldn’t that say “ericpullen” instead of “yourusername”?

I realize most folks would figure it out.
 
Last edited:
OP
OP
ericpullen

ericpullen

Well-known member
First Name
Eric
Joined
Jan 4, 2022
Threads
31
Messages
269
Reaction score
483
Location
Louisville, KY
Vehicles
22 F-150 Lightning & 22 Mach-E
I noticed the Installation steps on both your git and pypi say:
Code:
git clone https://github.com/yourusername/fcsp-api.git
Shouldnt that say “ericpullen” instead of “yourusername”?

I realize most folks would figure it out.
Thanks, missed those. Its been fixed!
 

Aminorjourney

Well-known member
Joined
Jun 6, 2022
Threads
12
Messages
246
Reaction score
465
Location
Internet
Vehicles
vehicles that go
Ok progress.

I’m not happy to GitHub yet but soon.

I relied quite heavily on the cut and shut method of programming, and I also need to get an icon… BUT.

It’s getting there ;)

Ford F-150 Lightning New FCSP API Python Library (fcsp-api) IMG_7837
Ford F-150 Lightning New FCSP API Python Library (fcsp-api) IMG_7836
Ford F-150 Lightning New FCSP API Python Library (fcsp-api) IMG_7838
Ford F-150 Lightning New FCSP API Python Library (fcsp-api) IMG_7839
Sponsored

 
 







Top