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

Engine not starting (via homebridge bluelink plugin which uses BlueLinky) #145

Closed yonigold1 closed 3 years ago

yonigold1 commented 3 years ago

Describe the bug The engine of my Hyundai does not successfully start.

Usefull info(please complete the following information):

Additional context When trying to start the engine through Apple HomeKit the command gets sent however the command doesn't seem to get executed. To elaborate, the command to start the ignition IS in fact going through however it seems like the command that's being sent is incorrect as the BlueLink app DOES in fact register that there is a command being sent however the command seems to have no action. When I try to toggle the Ignition from HomeKit if i go right to the BlueLink app and trying to execute any remote action it says "We are currently processing an earlier inquiry for your vehicle please wait 90 seconds..." So it received the ignition start command its just failing to execute.

The developer of the Homebridge plugin thinks its an issue with BlueLinky. Please let me know if theres anything i can try to help further debug this issue.

Hacksore commented 3 years ago

@yonigold1 can you share the start config you use?

In the past others have had success in CA with this https://github.com/SondreNjaastad/node-red-contrib-bluelinky/issues/18#issuecomment-754851538

yonigold1 commented 3 years ago

when u say the start of the config what do u mean? like my config for homebridge?

altagir commented 3 years ago

@Hacksore I tested by curiosity latest main, and yes it got broken

value": "6H" is wrong, it should be "06H" (17 degrees) when i use 22 degrees ("value": "10H"), issue does not show.

I remember to see some refacto pass by to have common function may be refer to my initial implementation

regards

 info: {
  "hvacInfo": {
    "airCtrl": 1,
    "defrost": true,
    "heating1": 1,
    "airTemp": {
      "value": "6H",
      "unit": 0,
      "hvacTempType": 1
    }
  }
yonigold1 commented 3 years ago

So is this something the user (me) has to change or is this something in the code that needs to be changed?

athal7 commented 3 years ago

Here is the relevant code in the homebridge plugin: https://github.com/athal7/homebridge-hyundai-bluelink/blob/main/src/services/ignition.ts

And the type for the config that is referenced: https://github.com/athal7/homebridge-hyundai-bluelink/blob/main/src/config.d.ts

Which passes type checks of the start function argument.

Hacksore commented 3 years ago

I'm sure this must be related to #96 based on the feedback here.

yonigold1 commented 3 years ago

So what would this mean? how would i got about fixing this for myself?

altagir commented 3 years ago

I think it is our side to fix, and just add a padding 0 to the hex value

altagir commented 3 years ago

I had this initially for canadian

const airTemp = startConfig.airTempvalue
      if (airTemp != null) {
        if (airTemp > 27 || airTemp < 17) {
          return Promise.reject("air temperature should be between 17 and 27 degrees");
        }
        let airTempValue: string = (6 + (airTemp - 17) * 2).toString(16).toUpperCase() + 'H';
        if (airTempValue.length == 2) {
          airTempValue = '0' + airTempValue
        }
        body.hvacInfo['airTemp'] = { value: airTempValue, unit: 0, hvacTempType: 1 }
      } else if ((startConfig.airCtrl ?? false) || (startConfig.defrost ?? false)) {
        return Promise.reject("air temperature should be specified")
      }

Notice the

if (airTempValue.length == 2) {
         airTempValue = '0' + airTempValue
}

@Hacksore , could you follow up with the fix, I am really overloaded at work

yonigold1 commented 3 years ago

Okay if you guys want me to test just let me know :)

Hacksore commented 3 years ago

So this is really just because our celciusToTempCode method doesn't work right.

Let's close this issue as duplicate as the fix should be with #96 but we need someone willing and able to understand wtf Hyundai/Kia is doing.

altagir commented 3 years ago

@Hacksore it was just missing the padding 0 .... I am not sure it is related, should also impact US et EU

yonigold1 commented 3 years ago

Will someone let me know when this is fixed so i can give this a try with my car :)

yonigold1 commented 3 years ago

any update yet?

james5294 commented 2 years ago

US model - 2021 palisade doing the same.. any fix?

Hacksore commented 2 years ago

@james5294 can you raise a new issue with all the details?

james5294 commented 2 years ago

@Hacksore opened!

yonigold1 commented 2 years ago

I'm still having an issue with this. Is there anyone that's got theirs to work?

james5294 commented 2 years ago

I'm still having an issue with this. Is there anyone that's got theirs to work?

https://github.com/Hacksore/bluelinky/issues/180