Integrating Hyundai Bluelink but working with Curl

Can confirm that this is something that has to do with changes to the API (more specific with timestamps used during the login procedure). More can be found here https://github.com/Hacksore/bluelinky/issues/101

As far as I can see the developers have a fix (version 6.0.1) on the way which should probably solve this problem.

Mine is all working again now, although I am using KUVORK (a KIA fork of bluelinky)

I have just started to play withe blueliky in node red. The basics work but I have a couple of questions:
Doing a call for the odometer reading gets me a message of “Error: method not implemented”. Is this caused by the changes in the API or am I maybe not doing something correctly.
Doing other calls, I get either correct data or “undefined”. If I do one or more retries, I eventually get the correct data. What could be causing this error? Is it just a communication error to the car ?
I have not figured out how to place the car location on the Lovelace map - I can manually enter the coordinates and call device_tracker.see but I have not yet figured out how to insert the coordinates from node red into the device_tracker.see code.

I sometimes don’t get the data and get a 400 error. Looking at the response, it says rate limit so I guess there’s a limit to number or requests in a certain amount of time. This only happens with the location for me, odometer seems to be the one that works the quickest.

I use mqtt to send the data to ha, and send the lat and long to generate the device tracker

Under node red, I use the ‘get car location’ node. the output goes to a ‘svc:device_tracker.see’ node that has this in the ‘data’ field

{
“dev_id”: “Rubyev”,
“gps”: [
“{{payload.coord.lat}}”,
“{{payload.coord.lon}}”
]
}

I also write msg.payload.coord.lat and msg.payload.coord.lon to the debug panel. Both of those come from ‘get car location’ and are correct.
Unfortunately, the svc.device_tracker.see gives this error message:
“Call-service API error. Error Message: invalid latitude for dictionary value @ data[‘gps’]”

What am I doing wrong here ?

One thought … what are you using for “output location” in the “svc:device_tracker.see” node ?

My node red flows that were working fine the other day are no longer working. Everything comes back with “undefined”
I did upgrade to the latest 2021.3.2 version but I can’t recall if things went south after the upgrade or if they were still working.
When things were working, there was a distinct delay between asking for a status update and getting the result. Now the ‘undefined’ shows up immediately.
Even just a plain call to ‘get status’ results in an ‘undefined’ error message … sort of as if the API is broken :frowning:

I really like your idea of directly updating the device tracker with a Service Call. Unfortunately I do have the same problem like @jens55
I always get the same error message:

Call-service API error. Error Message: invalid latitude for dictionary value @ data[‘gps’]

The data I receive from “Get car location” node looks fine.

Anyone got an idea why its not working?

I was running the ‘get car location’ followed by a svc:device_tracker.see node. What caused all my grief was that in the device_tracker node, in the ‘data’ field, I had the right information but I did not realize that this field worked in both json and j:expression modes. You HAVE to select JSON for the examples given here. J:expression caused the error.
I did not find this myself - a VERY helpful fellow on the bluelinky discord server ( Optimaxion) helped me find that.

1 Like

Thank you very much. That was exactly the solution I was looking for. Creating the device tracker with a call-service node is now working!

Thanks for sharing this - its been so so useful for me! Quick question - what does your Call_service events item watch out for and also what is in your Find Load Car Data Script?

Thanks again!

To not exhaust the small battery I only update the car info twice a day through the “inject” node. However, I also wanted to update the car data manually. Somebody helpful suggested as follows.

Create an empty script called “Get car data” in HA doing exactly nothing like so:
image

Then create a button in Lovelace that calls the script with “tap action”, like so:

In Node Red one of the entry points in getting data is when the button is pressed in HA. To achieve this you monitor the service events by adding the Service node as follows:

Then follow this by adding a switch node that looks for the Load Car Data script being executed:


If the script is called by the press of the button, car data gets called after collecting a time stamp and a delay for 2 seconds (probably unnecessary). If the empty script is not called (the button is not pressed) nothing happens: there is no node connected to the second switch output.

Hope this helps.

I does thanks!

Ive put together a simpler solution (i think) I have just used a button card on lovelace that makes an MQTT message:
image

Then i watch out for that in node red:

I learn something every day. Very elegant. I am going to change mine like that. Tx for letting me know.

Is there a method of getting the bluelink info such as odometer or charging information without using node red?

Moved to its own topic: Hyundai Bluelink Integration

Hi all, as you might be aware, Hyundai Bluelink and Kia Uvo is using almost identical commands. So i have an active Kia Uvo integration and i would like to include Hyundai Bluelink there if you can commit on sparing time for testing.

Respective thread: Kia Uvo Integration (pre-alpha)

Respective custom integration: GitHub - fuatakgun/kia_uvo

1 Like

Excellent manual. The MTQQ addon advises not to use the 1833 port, but setting another port didn’t work for me.

I’m getting true or false for the lock status, can I change that to On/Off somehow?

Actually I do have a question. I have the following in my sensor.yaml. With only one sensor, it works, with multiple sensors, it does not? What is wrong here?

- platform: mqtt
  name: "Car lock"
  state_topic: "car/locks/status"
- platform: mqtt
  name: "Door left front"
  state_topic: "car/doors/front-left"
- platform: mqtt
  name: "Door right front"
  state_topic: "car/doors/front-right"
- platform: mqtt
  name: "Door left rear"
  state_topic: "car/doors/back-left"
- platform: mqtt
  name: "Door right rear"
  state_topic: "car/doors/back-right"
- platform: mqtt
  name: "hood"
  state_topic: "car/hood"
- platform: mqtt
  name: "trunk"
  state_topic: "car/trunk"

You can insert a “Switch” node, in which you can check the output for True or False. For True you follow with a “Change” node to insert “On” and for False you insert a “Change” node inserting “Off”. Connect both these nodes to the mqtt out node.

Hard to say from these data. The formatting looks correct, so the error is likely in the NodeRed part. Perhaps check whether your mqtt out nodes have the correct topics in the right format.

Something else you can try is to use Home Assistant “Entity” nodes rather than mqtt sensor, which create Home Assistant (binary) sensors directly, which instantly update when they change. I have recently learned how to do this and it is now my preferred way to get sensor data to the front end.
For this to work you may need to install (in HACS) the NodeRed Companion for Home Assistant:

1 Like