fordpass-ha icon indicating copy to clipboard operation
fordpass-ha copied to clipboard

PHEV Battery percentage

Open fabiofabbrucci opened this issue 10 months ago • 1 comments

Hi guys, thanks to this integration I've been able to get some data in my HA. Ty I own a Ford Kuga PHEV 2020. But I still have 2 issues.

Here some screens to give you some context IMG_20240410_124435 IMG_20240410_124445 Screenshot 2024-04-10 at 14 28 47

Issue 1: PHEV Battery Percentage is missing

As you can see from HA screen, the sensor fordpass_elVeh tells me how many km I can run with my battery, but I would need to know how much PHEV battery is left (so the 31%). And this is for a few reasons:

  1. I want to know when PHEV battery is too low to trigger some events (recharge, notifications on mobile)
  2. I want to monitor the PHEV battery performance How can I create a sensor that shows that specific data? And to be more specific, I would not like to translate 19km in a percentage because the 19kms are an estimation made by Ford. If possible, I would like to get the plain data of the PHEV battery.

Issue 2: Top Right data is misleading

In HA, on the device detail screen (see screenshot) the 80% on battery can mislead a user. The main data should be the PHEV battery, and not the other batter (to let the car turn on). How can we change the main data for that screen (once we have the % of the PHEV battery)?

fabiofabbrucci avatar Apr 10 '24 12:04 fabiofabbrucci

Issue 1 - check the attributes:

image

image

image

Ulrich72 avatar Apr 14 '24 08:04 Ulrich72

Ty @Ulrich72 I solved adding this sensors to configuration.yaml file:

template:
  - sensor:
      - name: "Ford elVeh Battery Level"
        unique_id: "1133"
        state: "{{state_attr('sensor.fordpass_elVeh', 'Battery Charge') }}"
        unit_of_measurement: "%"
        icon: >-
          {% set batteryLevel = states('sensor.ford_elveh_battery_level') | round (-1) | int %}
          {% if batteryLevel == 100 %}
            mdi:battery
          {% else %}
            mdi:battery-{{ batteryLevel }}
          {% endif %}
      - name: "Ford elVeh Battery Charging Status"
        unique_id: "1144"
        state: "{{state_attr('sensor.fordpass_elVehCharging', 'Charging Status') }}"
        icon: >-
          {% if is_state_attr('sensor.fordpass_elVehCharging', 'Charging Status', "IN_PROGRESS") %}
            mdi:ev-station
          {% else %}
            mdi:battery
          {% endif %}

fabiofabbrucci avatar Apr 14 '24 18:04 fabiofabbrucci