TA2k / ioBroker.mercedesme

Mercedes me adapter for ioBroker
MIT License
23 stars 13 forks source link

state.chargeCouplerACStatus not working #193

Open MrIngenieur opened 12 months ago

MrIngenieur commented 12 months ago

I try to use Coupler AC Status for detecting if the vehicle is connected to the wallbox at home or not. But there are no state changes, even if the vehicle charging is active, there is no change in CouplerACStatus. Is there any chance to get this fixed or otherwise detect if Charger of the vehicle is connected (just plugged, independent of the actual charging running or not.) Would be very helpful for energy management and home solar charging of the vehicle to know if the car is connected or not, so that energy can be directed to the car if there is enough energy available.

KalaNagHTD commented 2 months ago

I‘m interested in a fix or advice too!

TA2k commented 2 months ago

When you delete the datapoint and restart adapter will it come back?

KalaNagHTD commented 2 months ago

When you delete the datapoint and restart adapter will it come back?

Yes!

KalaNagHTD commented 2 months ago

I‘d expect a status change of the encircled item when plugging in or out. Nothing happens. Just the item „changed“ reacts and changes to status „true“ when the plug is connected or removed. IMG_6208

TA2k commented 2 months ago

Nothing the adapter can change its only writes in data object what the api is returning Can you see this in the App?

KalaNagHTD commented 2 months ago

The Me-App indicates the charging status and whether the lid is open or closed. IMG_9434

TA2k commented 2 months ago

maybe this information is in another data object you can enable debug log and see which data comes in when you change the lid status on the car

KalaNagHTD commented 2 months ago

…you can enable debug log and see which data comes in when you change the lid status on the car…

That‘s a good idea! I‘ll try and report back! Thank you for your great adapter!

KalaNagHTD commented 2 months ago

I logged opening and closing the charge flap and got the encircled message each time the flap status changed. The object „Charge FlapDCStatus“ in ioBroker did not change.

IMG_6211

TA2k commented 2 months ago

It should you can also enable the debug level silly

KalaNagHTD commented 2 months ago

The log info with silly:

IMG_6213

TA2k commented 2 months ago

Es muss sich aber unter chargeFlapDCStatus etwas ändern zb changed

KalaNagHTD commented 2 months ago

Es muss sich aber unter chargeFlapDCStatus etwas ändern zb changed

Ja, wie ich oben schon geschrieben habe: „Just the item „changed“ reacts and changes to status „true“ when the plug is connected or removed“. Dazu gibt es einen aktualisierten Zeitstempel. Leider geht daraus nicht eindeutig hervor, ob die Klappe geöffnet oder geschlossen wurde, soweit ich das sehen kann.

KalaNagHTD commented 2 months ago

Oh, sorry! Gerade entdecke ich, dass sich „intValue“ bei offener Klappe „chargeFlapDCStatus“ von „1“ auf „0“ ändert! Beim Ladestecker „CouplerACStatus“ ist das nicht der Fall (Der wird in der Me-App aber auch nicht direkt angezeigt). Es ist für mich ausreichend, statt des Ladesteckers die offene Klappe zu erkennen.

Danke vielmals für Deine Geduld! Du hast mich in die richtige Richtung geschubst! 👍

KalaNagHTD commented 1 week ago

Nachtrag: Offenbar ändern sich die Stati der verschiedenen „chargeCoupler…“-Objekte doch, wenn man den Stecker einsteckt oder rauszieht. Falls nicht gleichzeitig ein Ladevorgang gestartet oder beendet wird, kann es aber gut 1/2 Stunde oder länger dauern, bis das Auto diese „unwichtige“ Info an die mercedesme-App sendet. Kein Wunder also, wenn man in den Logs zunächst keinen Effekt erkennt.

MrIngenieur commented 6 days ago

Sorry ich habe vergessen das hier zu updaten, habe für mich selbst eine Lösung gefunden: Man nehme den Integer Zahlenwert von Charging Status: mercedesme.0.WXXXXXXXX.state.chargingstatus.intValue

Dieser ist aufgeschlüsselt in folgende Zustände:

// Charging Status // 0=CHARGING // 1=CHARGING_ENDS // 2=CHARGE_BREAK // 3=UNPLUGGED // 4=FAILURE // 5=SLOW // 6=FAST // 7=DISCHARGING // 8=NO_CHARGING // 9=SLOW_CHARGING_AFTER_REACHING_TRIP_TARGET // 10=CHARGING_AFTER_REACHING_TRIP_TARGET // 11=FAST_CHARGING_AFTER_REACHING_TRIP_TARGET // 12=UNKNOWN

Ich habe mir daraus dann ein Alias gemacht, das mir „C“ meldet wenn „irgendwie geladen wird“, „B“ meldet wenn nicht geladen wird und sonst immer „A“ meldet:

val === 0 || val === 5 || val === 6 || val === 9 || val === 10 || val === 11 ? 'C' : val === 1 || val === 2 || val === 4 || val === 7 || val === 8 ? 'B' : 'A'

Diese Konvertierung habe ich verwendet, um es in EVCC mit dem Generic Vehicle Adapter zu nutzen, falls das jemand braucht. Aber man kann sich damit natürlich auch ausgeben lassen, ob Ladestecker gesteckt oder nicht. Habe ich mit EQE SUV und EQA getestet, beide funktionieren und bedienen den Status. Hoffe das hilft euch vielleicht auch.