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

How to use other adapter than Lelink2 BLE #1

Open
fototakas opened this issue Aug 26, 2024 · 10 comments
Open

How to use other adapter than Lelink2 BLE #1

fototakas opened this issue Aug 26, 2024 · 10 comments

Comments

@fototakas
Copy link

Hello,
Thanks for sharing this project.
Is it possible to use other BLE adapter than LeLink?
What should I change in the code to adopt it to the different OBD BLE adapter?

@pb-asbuilt
Copy link

You need to find out what UUIDs your BLE adapter is using.
You can use the nRF Connect app for your phone to get this.

Once you know the service UUID, go and change it in here:

"service_uuid": "0000ffe0-0000-1000-8000-00805f9b34fb"

and here:
SERVICE_UUID = "0000ffe0-0000-1000-8000-00805f9b34fb"

You will also need to find out the characteristic UUID used for command/response, and put this here:

CHARACTERISTIC_UUID = "0000ffe1-0000-1000-8000-00805f9b34fb"

Other BLE devices might use a separate UUID for reading vs writing (just guessing). You would need to extent bleserial.py to handle a separate UUID for read and write.

@fototakas
Copy link
Author

Thanks for explanations. Your guess was correct, my 2 OBD adapters have separate UUID's for reading and writing.
Those OBD2 adapters I have are dual bluetooth - standard and BLE. As I'm not a programer bleserial.py rewrite is mission imposible :)

@Arquiteto
Copy link
Contributor

As LeLink is not so easy to aquire where I live I ordered Vgate that as well has 2 separate characteristic UUID. I modified the code to account for that. #2

I am not 100% positive that my solution is enough. It seems to partially work, but the sensors become unavailable very often, some parameters are read OK, but for example for SoC I didn't get any read while the Leaf was charging and when I turned the "ignition" on as 1074%, 1159% and then 1592%. I will take take a look at it tommorow.

@pb-asbuilt which Nissan Leaf are you using? Maybe different Leafs have slightly different commands or responses?

@huenemeca
Copy link

"You will also need to find out the characteristic UUID used for command/response, and put this here:"
Can this be found with the nRF app also? If so how?

@pbutterworth
Copy link
Owner

As LeLink is not so easy to aquire where I live I ordered Vgate that as well has 2 separate characteristic UUID. I modified the code to account for that. #2

I am not 100% positive that my solution is enough. It seems to partially work, but the sensors become unavailable very often, some parameters are read OK, but for example for SoC I didn't get any read while the Leaf was charging and when I turned the "ignition" on as 1074%, 1159% and then 1592%. I will take take a look at it tommorow.

@pb-asbuilt which Nissan Leaf are you using? Maybe different Leafs have slightly different commands or responses?

Sorry been a bit distracted - thought I had better get back to responding!
I have a 2021 ze1 62kWh.
There are definitely some differences between models. Documentation is extremely sparse. Turn on the debug logging for this integration and you will get a lot more insight into what's going on; including why the data is going unavailable.

@pbutterworth
Copy link
Owner

"You will also need to find out the characteristic UUID used for command/response, and put this here:" Can this be found with the nRF app also? If so how?

Technically, this should be possible. Although I just tried it on my iPhone, and it only reports the first 4 digits of the UUID for some reason. Try it anyway (using nRF Connect) and paste screenshots of what you get back here.

@huenemeca
Copy link

Thanks for the offer of help. I actually returned my obd ble and bought the exact one you have so it connects now, but it usually just errors out.

@pbutterworth
Copy link
Owner

Thanks for the offer of help. I actually returned my obd ble and bought the exact one you have so it connects now, but it usually just errors out.

Yeah, the whole mechanism is pretty hit-and-miss. Firstly, the car must be on to fetch data from it. The other thing you can do is turn on caching so that HA holds on to the values:
image

@huenemeca
Copy link

Yeah, I was hoping to get SOC while it is charging so I can shut it off when the car is around 80%. But I can't read it even when charging if the car is off. Very disappointing.

@pbutterworth
Copy link
Owner

Yeah, Nissan really has made it difficult for us.
I’ve got a few automations and helpers to deal with the problem. Check out the thread on the HA community forum

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

No branches or pull requests

6 participants
@pbutterworth @fototakas @Arquiteto @huenemeca @pb-asbuilt and others