Public API

methorian

Well-Known Member
Joined
Nov 18, 2019
Threads
16
Messages
1,538
Reaction score
2,405
Location
Roanoke, VA
Vehicles
Mach-E First Edition, Mini Cooper SE
Occupation
IT Admin
Country flag
Screenshot at Aug 08 18-52-40.png

Thank you, I just made the Battery percentage work. I will add more info now I can see how to do it.
Mind sharing your config/template for the battery percent?

Nevermind - I figured out what I was missing!
 

Calvin4000

Well-Known Member
First Name
Michel
Joined
Feb 1, 2020
Threads
1
Messages
280
Reaction score
231
Location
Switzerland
Vehicles
Harley Livewire, BMW 1250GS
Occupation
System Engineer
Country flag
Just add an icon_template in your template for the attribute... :)

- platform: template
sensors:
plug_status_template:
friendly_name: "Ford Plug Status"
value_template: >-
{% if is_state_attr('sensor.fordpass_elveh', 'Plug Status', 0) %}
Unplugged
{% elif is_state_attr('sensor.fordpass_elveh', 'Plug Status', 1) %}
Plugged In
{% else %}
{% endif %}
icon_template: >-
{% if is_state_attr('sensor.fordpass_elveh', 'Plug Status', 0) %}
mdi: power-plug-off
{% elif is_state_attr('sensor.fordpass_elveh', 'Plug Status', 1) %}
mdi: power-plug
{% else %}
mdi:connection
{% endif %}
 

AllenXS

Well-Known Member
First Name
Allen
Joined
Jan 11, 2021
Threads
13
Messages
1,210
Reaction score
1,587
Location
Richmond, BC, Canada
Vehicles
Premium Blue ER AWD
Country flag
How did you pull the battery %. I've put in
value_template: "{{ state_attr('fordpass.elVeh', 'Battery Fill Level') | float }}"
What am I missing besides a few more hours in reading?
Keeps returning 0
 


Tyldum

Well-Known Member
Joined
Sep 25, 2020
Threads
1
Messages
356
Reaction score
373
Location
Norway
Vehicles
Mustang Mach E First Edition
Country flag
How did you pull the battery %. I've put in
value_template: "{{ state_attr('fordpass.elVeh', 'Battery Fill Level') | float }}"
What am I missing besides a few more hours in reading?
Keeps returning 0
I use
state: "{{ '%+.1f'|format(state_attr('sensor.fordpass_elveh','Battery Fill Level')) }}"
 

AllenXS

Well-Known Member
First Name
Allen
Joined
Jan 11, 2021
Threads
13
Messages
1,210
Reaction score
1,587
Location
Richmond, BC, Canada
Vehicles
Premium Blue ER AWD
Country flag
Nice job guys, thanks for the tips... ;)

1628515228131.png
How did you pull the battery %. I've put in
value_template: "{{ state_attr('fordpass.elVeh', 'Battery Fill Level') | float }}"
What am I missing besides a few more hours in reading?
Keeps returning 0
 

SashaLondon

Well-Known Member
First Name
Sasha
Joined
Sep 11, 2020
Threads
32
Messages
1,384
Reaction score
1,493
Location
London
Vehicles
MME AWD SR
Country flag
Also the distance I cannot see the range in the fuel attribute. How did you get that?
 

Chudsaviet

Well-Known Member
First Name
Timofei
Joined
Apr 1, 2021
Threads
9
Messages
299
Reaction score
285
Location
Bothell, WA
Vehicles
2022 EV6 First Edition AWD, 2014 Leaf
Occupation
Software
Country flag
FYI, I applied to Ford API developer account to make an IFTTT plugin.
No answer for several months.
 

AllenXS

Well-Known Member
First Name
Allen
Joined
Jan 11, 2021
Threads
13
Messages
1,210
Reaction score
1,587
Location
Richmond, BC, Canada
Vehicles
Premium Blue ER AWD
Country flag
Also the distance I cannot see the range in the fuel attribute. How did you get that?
Range is fordpass.elVeh. No attribute.
I'm working on setting the value as a whole number. Need to get back into home assist now its more useful
 

Calvin4000

Well-Known Member
First Name
Michel
Joined
Feb 1, 2020
Threads
1
Messages
280
Reaction score
231
Location
Switzerland
Vehicles
Harley Livewire, BMW 1250GS
Occupation
System Engineer
Country flag
- platform: template
sensors:
battery_percent_template:
friendly_name: "Ford battery charge"
value_template: "{{ state_attr('sensor.fordpass_elveh', 'Battery Fill Level') }}"
unit_of_measurement: "%"
icon_template: mdi:battery

- platform: template
sensors:
distance_to_empty_template:
friendly_name: "Ford distance to empty"
value_template: "{{ (state_attr('sensor.fordpass_elveh', 'elVehDTE')) | round(0) }}"
unit_of_measurement: "km"
icon_template: mdi:map-marker-distance
 

AllenXS

Well-Known Member
First Name
Allen
Joined
Jan 11, 2021
Threads
13
Messages
1,210
Reaction score
1,587
Location
Richmond, BC, Canada
Vehicles
Premium Blue ER AWD
Country flag
- platform: template
sensors:
battery_percent_template:
friendly_name: "Ford battery charge"
value_template: "{{ state_attr('sensor.fordpass_elveh', 'Battery Fill Level') }}"
unit_of_measurement: "%"
icon_template: mdi:battery

- platform: template
sensors:
distance_to_empty_template:
friendly_name: "Ford distance to empty"
value_template: "{{ (state_attr('sensor.fordpass_elveh', 'elVehDTE')) | round(0) }}"
unit_of_measurement: "km"
icon_template: mdi:map-marker-distance
Thanks, was missing just one word.
 

methorian

Well-Known Member
Joined
Nov 18, 2019
Threads
16
Messages
1,538
Reaction score
2,405
Location
Roanoke, VA
Vehicles
Mach-E First Edition, Mini Cooper SE
Occupation
IT Admin
Country flag
Range is fordpass.elVeh. No attribute.
I'm working on setting the value as a whole number. Need to get back into home assist now its more useful
Range is also shown in km, even if you're in NA. I don't do anything with it, but you'd maybe want to convert it to miles if you want a card for it in HA.

It's also nice that it reports the 12V battery level. Mine generally stays around 13-15V.
 

AllenXS

Well-Known Member
First Name
Allen
Joined
Jan 11, 2021
Threads
13
Messages
1,210
Reaction score
1,587
Location
Richmond, BC, Canada
Vehicles
Premium Blue ER AWD
Country flag
Km is good in north north America, ie Canada. It's also good to monitor the battery.
I'm going to record estimated range and temperature over time.
Also recording to see degradation over the years.
Sponsored

 
 




Top