Hacksore / bluelinky

An unofficial nodejs API wrapper for Hyundai bluelink and Kia UVO
https://bluelinky.readme.io
MIT License
341 stars 76 forks source link

[US] Support Kia #135

Closed bzeeman closed 1 year ago

bzeeman commented 3 years ago

Describe the bug A clear and concise description of what the bug is. try to run both in my own code and with a config.json and throws error Usefull info(please complete the following information):

Additional context Add any other context about the problem here.

/Users/XXX/Development/KiaConnect/bluelinky/src/constants/america.ts:28
      throw new Error(`Constructor ${brand} is not managed.`);
            ^
Error: Constructor kia is not managed.
    at Object.exports.getBrandEnvironment (/Users/XXX/Development/KiaConnect/bluelinky/src/constants/america.ts:28:13)
    at new AmericanController (/Users/XXX/Development/KiaConnect/bluelinky/src/controllers/american.controller.ts:23:25)
    at new BlueLinky (/Users/XXX/Development/KiaConnect/bluelinky/src/index.ts:51:27)
    at createInstance (/Users/XXX/Development/KiaConnect/bluelinky/debug.ts:64:18)
    at /Users/XXX/Development/KiaConnect/bluelinky/debug.ts:58:9
    at processTicksAndRejections (node:internal/process/task_queues:94:5)
PierreLevres commented 3 years ago

Kia US is not supported. This is not a bug, just missing. If you can help in sniffing network traffic that would be great.

Op 16 apr. 2021 om 21:25 heeft Ben @.***> het volgende geschreven:

 Describe the bug A clear and concise description of what the bug is. try to run both in my own code and with a config.json and throws error Usefull info(please complete the following information):

OS: [e.g. macOS, Windows, Linux] macOS Big Sur Bluelinky Version [e.g. v5.2.3] 7.1.0 Region: [e.g. US, CA, EU] US Additional context Add any other context about the problem here.

/Users/XXX/Development/KiaConnect/bluelinky/src/constants/america.ts:28 throw new Error(Constructor ${brand} is not managed.); ^ Error: Constructor kia is not managed. at Object.exports.getBrandEnvironment (/Users/XXX/Development/KiaConnect/bluelinky/src/constants/america.ts:28:13) at new AmericanController (/Users/XXX/Development/KiaConnect/bluelinky/src/controllers/american.controller.ts:23:25) at new BlueLinky (/Users/XXX/Development/KiaConnect/bluelinky/src/index.ts:51:27) at createInstance (/Users/XXX/Development/KiaConnect/bluelinky/debug.ts:64:18) at /Users/XXX/Development/KiaConnect/bluelinky/debug.ts:58:9 at processTicksAndRejections (node:internal/process/task_queues:94:5) — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

bzeeman commented 3 years ago

Oh... Well i guess that error makes sense then. I suppose WireShark is the way to go with that right? I'll need to remember how to do that.

PierreLevres commented 3 years ago

On my Mac I use Charles as a MITM proxy. Pretty easy to use and save traffic as json files. Free version suffices

Op 17 apr. 2021 om 01:10 heeft Ben @.***> het volgende geschreven:

 Oh... Well i guess that error makes sense then. I suppose WireShark is the way to go with that right? I'll need to remember how to do that.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

olivierjag2 commented 3 years ago

i have problem with node-red with get status, I live in canada, normal?

olivierjag2 commented 3 years ago

I think I have issue with canada car also

danielntamasi commented 3 years ago

@Hacksore could you help me understand how I can help here? Is it doable to sniff network traffic from the browser? I only have iOS, so i have a huge hunch that it's not doable on my phone (on other forums, I've seen people using their android to achieve this).

Thank you for your answer in advance.

Hacksore commented 3 years ago

@danielntamasi most people use Android (myself) included as it's easier, here is my document on the process but not quite helpful for you on iOS.

You can sniff the browser traffic but the webapp is usually a different API than the app and might have fewer features.

https://docs.google.com/document/d/1q0Pz2t5Gmt-vv8z-2Yswhvg2x9B2f3d1vjpkIjt9EfQ/edit?usp=sharing

Hopefully, others will have an interest in getting Kia working in the US.

mjruotolo commented 3 years ago

I hope someone can get the US working. I dont have a device i can sniff with

Hacksore commented 3 years ago

I can sniff the traffic but lack a Kia US account 😅

On Wed, Aug 11, 2021 at 3:32 PM mjruotolo @.***> wrote:

I hope someone can get the US working. I dont have a device i can sniff with

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Hacksore/bluelinky/issues/135#issuecomment-897131989, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHTGJVBZFYMRPSCCBR4JTDT4LM5DANCNFSM43CC4WAQ .

bzeeman commented 3 years ago

Life got busy and I forgot to check back. I have never tried specifically to sniff traffic... at least not lately. I did a few years back but I had someone setup Wireshark and I believe we set up a DNS intermediate so that we could read it on the computer. I wish I had more time to play with things like this but I don't. What is the best way to test the traffic?

cdnninja commented 3 years ago

I found the network tab of edge in developer mode works well as a starting point.

cdnninja commented 3 years ago

I wanted to point everyone here if you want to follow along on our work on this for Home Assistant: https://github.com/fuatakgun/kia_uvo/issues/88

GiveMeTheBits commented 2 years ago

I wanted to point everyone here if you want to follow along on our work on this for Home Assistant: fuatakgun/kia_uvo#88

Now that kia_uvo US support is completed, is there any progress to getting the endpoints added to Bluelinky?

Hacksore commented 2 years ago

@GiveMeTheBits I guess we are waiting for someone to drop a PR 😅

mjruotolo commented 2 years ago

@Hacksore I am new to GIThub. I are you talking a Pull Request? Not sure how to do it but would love to get this going. Would make my wife happy. :) We all know happy wife happy life :)

mjruotolo commented 2 years ago

Just wonder if there is any progress?

alpha1125 commented 2 years ago

Any idea on genesis support? https://www.youtube.com/watch?v=AinlqmZ4rVk 2020-05-20

If so, how can I help?

Hacksore commented 2 years ago

@alpha1125 You'd want to reverse engineer the mobile app and submit a PR once something worth merging in.

That would deserve a stand-alone issue to better focus the discussion though.

fuatakgun commented 2 years ago

@cdnninja and me are working on home assistant automation platform integration and couple of our users contributed to support USA. We are planning to contribute back to here but not defined a date yet.

CGDaveMac commented 1 year ago

Looks like they figured this out in Home Assistant plugin: https://github.com/Hyundai-Kia-Connect/kia_uvo/issues/88

Any ideas from that thread or in their code to get this working for US Kia?

Hacksore commented 1 year ago

Looks like they figured this out in Home Assistant plugin:

https://github.com/Hyundai-Kia-Connect/kia_uvo/issues/88

Any ideas from that thread or in their code to get this working for US Kia?

I'd say that it would be helpful for someone to try taking what they have done and submit a PR.

cdnninja commented 1 year ago

The region specific code is located here. I don't have the time or knowledge of this language to port it over. This was created by someone or collaborated on the project. https://github.com/Hyundai-Kia-Connect/hyundai_kia_connect_api/blob/master/hyundai_kia_connect_api/KiaUvoAPIUSA.py

mfried40 commented 1 year ago

this Just got merged into the develop branch https://github.com/Hacksore/bluelinky/pull/237 anyone to test if it works?

jrblaettler commented 1 year ago

@mfried40 So, I just tested this. The login for kia seems okay. So I tried the getVehicles and getVehicle methods but unfortunately got the responses of [] and undefined respectively. So far the only api I've found that I've gotten to find my vehicles is https://github.com/Hyundai-Kia-Connect/hyundai_kia_connect_api but being able to do it in node would be lovely. I'm gonna be taking a look at your code a bit but I'm far from experienced with working on open source projects. So, if you get around to working on this and need someone to test feel free to ping me.

mfried40 commented 1 year ago

@jrblaettler do you think the endpoints are correct?

jrblaettler commented 1 year ago

@mfried40 Okay so I went to look in to that and then found something thats not great. I provided it completely wrong credentials

  username: 'definitelyNotJake',
  password: 'passwordgnoeangoiaengoea',
  brand: 'kia',
  region: 'US',
  pin: '',
});

and the healthy login message came back. And the response.status has a 200 check. So I think we might be able to assume that the endpoint (for login at least) is correct and being hit but it sends back 200's under unexpected conditions? Its the end of my day but Im gonna dig in to this a little more tomorrow

Hacksore commented 1 year ago

I believe there is partial support for this now and if something is still borked please raise a new issue/PR thanks!