skodaconnect / homeassistant-myskoda

Homeassistant integration for MySkoda.
96 stars 15 forks source link

Enyaq: Charging State=Cable Disconnected while Charger Connected=Plugged in #137

Closed AMajland closed 2 weeks ago

AMajland commented 1 month ago

I use HA to charge when the price are lowesst. So i plug the car in and the easee home charger is paused by setting dynamic max = 0 until it is time to charge.

That is the cable is plugged in, the charger is ready with the status PAUSED/AWAITING START

MySkoda shows correctly that Charger Connected=Plugged in but the Charging State=Cable Disconnected I do not now whether it just an bad translation or something less obvious

The old skoda connect interface shows

Charging cable connected = Plugged in Charging cable locked = Locked External power = Off <<< Maybe that is similar to the Charging state in MySkoda ?

When the cars start to charge it changes to Charging State = Charging (Myskoda) External Power = On (Skoda Connect)

Here from the small test: image

Set dynamic on charger set > 6A to start charging and back to zero 8 minutes later

AMajland commented 1 month ago

And from the Skoda Connect integration image

WebSpider commented 1 month ago

Thanks for this report!

It's very useful for us to better interpret the values we get from the car in this way.

Would you mind enabling debug logging in HA while you are going through these steps, so we can see what MySkoda responds?

AMajland commented 1 month ago

logfile.zip Hope there is something usefull in this.

image

WebSpider commented 1 month ago

Yes, there is.

When you stop charging, the car sends us an event where it indicates it's notReadyForCharging:

'{"version":1,"traceId":"XXX","timestamp":"2024-10-26T20:48:02Z","producer":"SKODA_MHUB","name":"change-charge-mode","data":{"mode":"off","state":"notReadyForCharging","soc":"28","chargedRange":"118","timeToFinish":"null","userId":"YOURUID","vin":"YOURVIN"}

We currently interpret this as "Well, your cable must be disconnected", since that's in fact what the car says when the cable is disconnected as well.

We could add another state here, that says "Not Ready", but i dont think that solves it.

dtmichel commented 1 month ago

In the UI this does indeed look strange. Reporting the "Charging State" as "Not ready" would make sense to me. I see this strange state always when I plug my car and the charger is set to not deliver power. Which in general is between 10AM and 8:30PM.

image

ChristophCaina commented 3 weeks ago

I agree - charger disconnect should show if the cable is connected or not - charging state should only indicate "not ready" or "Not charging" and "ready" or "charging".

dvx76 commented 3 weeks ago

I need to look into this in more detail but in general I would prefer to stay as close as possible to what the API reports and/or how the MySkoda app presents things. I can test this tomorrow but in case you have a screenshot already, what does the app show when in this state (cable connected, charger not active)?

But I do agree that reporting Cable Disconnected when the cable is, in fact, connected, is not good.

AMajland commented 3 weeks ago

I've just tested - and it is a Skoda bug ....

I can not take screenshots of the myskoda app (foolish limitation!) but the same information is in the Skoda Essential app.,

image

Sorry it is Danish but basically it says "Cable not connected" when the charger's dynamic limit is set below 6A

The MySkoda app says "not connected" on the car overview page (in the frame with soc and available distance) and on the battery page it says "to charge the car you most connect at charging cable"

If it is possible from the API to distinguish between a cable not providing power and a disconnected one i would suggest going with that over over the APP version that just seems to miss the state of cable connected but not delivering power between not connected and ac charging

But if is not possible to distinguish between notReadyForCharging and cable disconnected i would prefer the entity gets the state notReadyForCharging as it is what the API says. That will imho be less confusing.

In an automation one might have to combine different entities from the car and maybe the charger to find out how ready the combination really is to start charging. Most with HA and EV integrations will often be in this situation to charge the car in the cheapest hours.

The old skoda connect had entities for charging cable connected and charging cable locked

dvx76 commented 2 weeks ago

Ok I think this comes down to a misunderstanding of what Skoda and their API mean with a charging status of CONNECT_CABLE.

I guess we've been assuming it means You need to connect the cable but instead it probably means There is a cable connected but that's it, we're neither charging nor ready to charge.

We see the following states:

class ChargingState(CaseInsensitiveStrEnum):
    READY_FOR_CHARGING = "READY_FOR_CHARGING"
    CONNECT_CABLE = "CONNECT_CABLE"
    CONSERVING = "CONSERVING"
    CHARGING = "CHARGING"

I would currently interpret these as follows:

We currently have the following English translation for the states of this sensor:

            "charging_state": {
                "name": "Charging State",
                "state": {
                    "charging": "Charging",
                    "connect_cable": "Cable Disconnected",
                    "conserving": "Conserving Charge",
                    "ready_for_charging": "Ready for Charging"
                }

I would propose we change Cable Disconnected to something like No Power or No External Power.

I don't want any states of this sensor to imply what the state of the cable is, because we already have the charger_connected binary_sensor which does that specifically.

I'll put up a PR.