ngocjohn / vehicle-info-card

🚙 Home Assistant Custom Card for Mercedes Vehicles
https://ngocjohn.is-a.dev/vehicle-info-card/
MIT License
43 stars 13 forks source link

Substitute Charging Socket Flap for Gas Cap on EVs #42

Closed rbollar closed 2 months ago

rbollar commented 2 months ago

Short summary

The code shows “Gas Cap lock” on the locked status for EVs

Detailed description

If you’re able, it would be good to show the gas cap lock status as “Charging Socket Flap” on EVs

image

Here’s what it looks like on Mercedes app:

image

Examples 🖼️

No response

Additional context 🗒️

No response

rbollar commented 2 months ago

It appears the sensor is:

sensor.xxxxxx_charge_flap_dc_status

ngocjohn commented 2 months ago

I will try to add this display in case of EV, currently this data is as attributes from sensor.lock. 👍

ngocjohn commented 2 months ago

Hi @rbollar .. I'm trying to make this change, but I haven't come up with a solution yet. Since now the subfields for lock status are taken as attributes from sensor.***_lock and specifically for this case the gas/charge is attribute 'doorlockstatusgas'. If both for ev and fuel car have the same attribute, so I have no idea how to logically confuse these names. 🤔

Can I ask you to screen what attributes you have in the sensor lock? And what are the states for sensor.xxxxxx_charge_flap_dc_status?

CleanShot 2024-08-21

rbollar commented 2 months ago

Here is the lock status like you shared, followed by the charge flap status. Personally, I'd be fine with just having the charge door flap status -- it's either open or closed.

car: xxxxxx vin: xxx retrievalstatus: VALID timestamp: 2024-08-14T13:18:25 decklidstatus: false doorLockStatusOverall: 0 doorStatusOverall: 1 doorlockstatusdecklid: false doorlockstatusfrontleft: false doorlockstatusfrontright: false doorlockstatusgas: false doorlockstatusrearleft: false doorlockstatusrearright: false doorlockstatusvehicle: 2 doorstatusfrontleft: false doorstatusfrontright: false doorstatusrearleft: false doorstatusrearright: false sunroofstatus: 0 icon: mdi:car-key friendly_name: xxx Lock

sensor.xxxxxx_charge_flap_dc_status car: xxxxxx vin: xxx retrievalstatus: VALID timestamp: 2024-08-16T01:03:49 friendly_name: xxx Charge Flap DC Status

ngocjohn commented 2 months ago

sensor.xxxxxx_charge_flap_dc_status car: xxxxxx vin: xxx retrievalstatus: VALID timestamp: 2024-08-16T01:03:49 friendly_name: xxx Charge Flap DC Status

@rbollar Hi, I added this sensor as a new entry for Doors status. As it has a similar state to the rest of the group, I just want to confirm that sensor._charge_flap_dc_status shows the state [ 0 1 2 3 ]. I hope I have understood correctly from Rene component's code what this sensor shows.

CleanShot 2024-08-24 at 20 17 10