Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(EU): New KIA models #480

Merged
merged 12 commits into from
Jan 21, 2024
Merged

feat(EU): New KIA models #480

merged 12 commits into from
Jan 21, 2024

Conversation

Bubo08
Copy link
Collaborator

@Bubo08 Bubo08 commented Jan 15, 2024

No description provided.

@Bubo08
Copy link
Collaborator Author

Bubo08 commented Jan 15, 2024

Not everything is implemented, yet. Only the most important attributes from the vehicle status request are integrated. Therefore, at least some of the open issues could be closed.

Copy link
Member

@fuatakgun fuatakgun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, please allow me a couple of days to test locally as an older car owner

@@ -74,6 +74,8 @@ class Vehicle:
year: int = None
VIN: str = None
key: str = None
protocolType: int = None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you follow current naming convention?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean instead of Camel Case notation I should use underscore? Good point, I will fix it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If protocol type isn't used in an if statement maybe we don't record it?

Copy link
Collaborator Author

@Bubo08 Bubo08 Jan 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed the naming and removed the attribute as proposed above. Additionaly, I continue with the mapping of the attributes.

@Bubo08 Bubo08 changed the title CCS2 changes for newer EU KIA models - only main attributes fix: CCS2 changes for newer EU KIA models - only main attributes Jan 17, 2024
@cdnninja
Copy link
Collaborator

I can't figure out how to post the review from mobile app.

Only thought is maybe renaming the ccs variable in vehicle to support multiple regions? I doubt other regions will call it that but still have versions. Thoughts on making it more universal?

@Bubo08
Copy link
Collaborator Author

Bubo08 commented Jan 17, 2024

Only thought is maybe renaming the ccs variable in vehicle to support multiple regions? I doubt other regions will call it that but still have versions. Thoughts on making it more universal?

I think we can still refactor it, if it is the case. For me it looks a bit like a universal attribute but I might be wrong.

@cdnninja
Copy link
Collaborator

Each region is totally different. Ev9s haven't had issues so far for other regions as an example.

@Bubo08
Copy link
Collaborator Author

Bubo08 commented Jan 17, 2024

I did see in older logs that the attribut Ccuccs2protocolsupport is set to 0 and in my sniffed code it is set to 1. So my interpretation was, that ccs2 was disabled in the past and now - in some newer cars - it is enabled.
Interestingly, this attribut is also used in the header of other type of calls (vehicles, register, ...).

But it is only an interpretation which might be completely wrong. The attribut could also mean Combined Charging System (CCS) but then why would it be included in all calls?

@cdnninja
Copy link
Collaborator

Interesting. So far I haven't seen this value in any other regions. I have seen a version flag though. Not sure why each region is so different. Stamps also don't exist in ca and USA. They do exist in Australia though.

@fuatakgun
Copy link
Member

Austria is following EU style, right? Similar to IN and CN.

@cdnninja
Copy link
Collaborator

Yes.

@Bubo08
Copy link
Collaborator Author

Bubo08 commented Jan 17, 2024

I head to add the attribute Ccuccs2protocolsupport to the header. The value is taken from the result of the vehicle call. It would be good if somebody could test it for the old cars in EU.

@Bubo08 Bubo08 mentioned this pull request Jan 17, 2024
@jwillemsen
Copy link
Contributor

I have a 2024 Kona and just tried this PR using a small test script, I do see a lot more data now being returned, including a lot of driving statistics, great work!

@Bubo08
Copy link
Collaborator Author

Bubo08 commented Jan 19, 2024

I have a 2024 Kona and just tried this PR using a small test script, I do see a lot more data now being returned, including a lot of driving statistics, great work!

Thanks! I mapped some additional attributes and documented the still missing ones.

@ristoavila
Copy link

0001-Try-to-map-more-values.patch
I tried to map some more values. Now it shows 43 entitys for EV9. Setting any of the values is still not working and the lock state is not correct but at least the charging limits can be seen and also estimated charging duration.

image

Copy link
Collaborator

@cdnninja cdnninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good with this being merged. @fuatakgun let us know when you test on your car.

hyundai_kia_connect_api/KiaUvoApiEU.py Show resolved Hide resolved
@Bubo08
Copy link
Collaborator Author

Bubo08 commented Jan 20, 2024

I tried to map some more values. Now it shows 43 entitys for EV9.

All are integrated now. Thanks for your help.

@ristoavila
Copy link

I tried to map some more values. Now it shows 43 entitys for EV9.

All are integrated now. Thanks for your help.

Some fixes for previous mapping. I also mapped is_locked to driver door lock. Would be nice to get sniffing of the open lock and setting of the limits.
0001-Fix-value-states-for-added-attributes.patch

@Bubo08
Copy link
Collaborator Author

Bubo08 commented Jan 21, 2024

I added the proposed changes and also changed the is_locked. All door are checked and only if all four are closed then I set the attribute to True.

@ristoavila
Copy link

I added the proposed changes and also changed the is_locked. All door are checked and only if all four are closed then I set the attribute to True.

Btw there is Lock status that is inverse its different from open. Property is Cabin.Door.Row1.Driver.Lock its 1 when its open and 0 when its locked.

@cdnninja
Copy link
Collaborator

Thank you for this! I am going to merge and release this. Another PR can be done for the other work that is on the go. This will help test the current progress out in a wider audience.

@cdnninja cdnninja changed the title fix: CCS2 changes for newer EU KIA models - only main attributes feat(EU): New KIA models Jan 21, 2024
@cdnninja cdnninja merged commit 0fa2ca4 into Hyundai-Kia-Connect:master Jan 21, 2024
1 check passed
@jwillemsen
Copy link
Contributor

jwillemsen commented Jan 23, 2024

With the pre release 2.19.0 I do see much more data, but KONA AC Charging Limit and KONA DC Charging Limit but show a slider with 80, but in the app I see 100, also the UI is strange

Screenshot_20240123_132912

In the data field I see

TargetSoC:
      Standard: 100
      Quick: 100

@jwillemsen
Copy link
Contributor

I don't have FrontLeftWindow and FrontRightWindow in HA, only the door, for the back I do see the door and window status

@jwillemsen
Copy link
Contributor

The kona has vehicle to load, in the data field I see the following, looks this is not exported separately to HA

VehicleToLoad:
        DischargeLimitation:
          SoC: 20

@jwillemsen
Copy link
Contributor

See #483 for the window status

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants