Integration for NissanConnect Services

Hi,
I’m trying to connect as well and get the “TypeError: Cannot read properties of undefined (reading ‘split’)” error. Used steps from celodnb above and changed the url and v5.
On my config it never worked before, just getting into this with i hope the latest and greatest version.
Driving a nissan quashqai and hoping to get the unlocked status from the car, so i can send myself a reminder to lock it or when possible in a later version to lock it from HA.
Hoping for some suggestions to try this.
mqtt is connected
trigger from HA is inserted
but step 1 and step 2(session&token) leaves me with the error above.
thanks in advance

I am also having this error when I try to run the battery section:
image

This works in the Nissan Connect app on android
Any idea what I am doing wrong, it authenticates just fine and I got some climate data back but the battery is the thing I need.
This is for a Leaf

Hi,

Not sure how to debug the response to the request, but i think my quashqai might be in a different zone or does not have the latest version?

https://prod.eu2.auth.kamereon.org/kauth/oauth2undefined/authorize?client_id=a-ncb-prod-android&redirect_uri=org.kamereon.service.nci:/oauth2redirect&response_type=code&scope=openid%20profile%20vehicles&nonce=sdfdsfez&state=af0ifjsldkj"

payload: string

403 Forbidden

Request forbidden by administrative rules.

Thanks a lot to all who’ve been trying to make it work! I tried celodnb’s shared steps as well, but I can’t seem to get past the Auth, as I’m getting a “Session timed out” message.

Can’t dig deeper for now, but would love to hear if anyone has it working and can share the flow.

I’m no genius and have no experience developing for Home Assistant, but how hard would it be for someone that do know how to develop for Home Assistant to make an integration for NissanConnect?
All the API calls are known and currently being used in Node-RED as seen in this thread.

1 Like

I was planning to convert the Node Red nodes to a python script, because my Node Red flow is not working and I prefer code to visual programming. But I’m struggling to find time at the moment. If no one else will, perhaps I’ll eventually get there :grin:

I’d love that as I’m not a fan of running Node-RED simply for this one thing.
If you’re able to make an integration that can be installed through HACS that would be awesome!
No rush though, take your time. :+1:

Can you share your flow pls (don’t forget to remove the username/password) I am still not getting much luck with connecting it

I changed the lines showed in the video @kefjevl shared and that made it work.

Ok so it seems like there is something wrong with the battery section because all climate and history work ok.

Battery:

Has anyone got this to work for a Leaf ZE1? Maybe not supported but makes no sense since I see the battery value in the Nissan app and even in the MyLeaf non official app which uses the same api

Found the issue for me. v2 doesn’t work here

But v1 does so I changed it to that and boom!

I couldn’t get the node red code working. Auth keeps failing with “Session has timed out” or “Authentication Failed”. Did some investigation and it looks like the node red solution won’t work for NA accounts. It’s based on Tobais’ Kjeldsen’s code and there’s specifically a different code repo for the NA accounts, but he has discontinued support because Nissan has made it difficult to get the right secret. See https://tobis.dk/blog/the-farce-of-nissanconnect-north-america

Hi, very new to home assistant and complete novice at Node-Red and MQTT. Have installed Mosquitto and attempting to follow the Read-Me and people’s suggestions from this thread, I imported NissanConnectFlow-HA-NodeRed.json from the repo to Node-Red and when I attempt to deploy, looks like its missing a (some?) nodes as a trigger? Any help would be much appreciated.

Running it all as dockers within HA Container due to running on laptop with other things on it for now. Adapting it for a new Leaf as well if there’s anything Leaf users have spotted need tweaking from the original code.

If there’s something additional I’m missing, if there’s any other documentation out there I don’t know about, links would be very helpful.

We’re still cheering for you buddy! :grimacing:

1 Like

I managed to get the flow working by swapping out the v4 for v5. I realised, though, that rewriting it into python without first getting the whole flow to work is a bit counter-productive, as there’s a bit of a community around the Node RED implementation already, and I’d be alone with Python.

I’m currently seeing the location and cabin temperature, but everything else is unknown. The POST /v1/cars/{VIN}/actions/refresh-battery-status request returns an error:

code: "501"
title: "Not supported Feature"
detail: "This feature is not technically supported by this gateway"

I decompiled the most recent app, and it seems that the API endpint is correct:

    .annotation runtime Lretrofit2/http/POST;
        value = "v1/cars/{vin}/actions/refresh-battery-status"
    .end annotation

Any thoughts what the error points to? Getting the battery status is pretty much the only thing I’m looking for :sweat_smile:

Is this for an Ariya or a Leaf? potentially a Leaf is using another service call

Leaf. Any thoughts on how to find out which calls are used?

1 Like

Isn’t the leaf integration not working in HA? I thought there was a My Leaf or something integration.
I think Leaf is partially still using the Carwings API so a different approach, don’t understand why Nissan is using 2 platforms but yeah.

Nope, I haven’t been able to get my 2023 Leaf working with the native integration at all. I think older models might work, but the new Leafs use the NissanConnect Services app by Nissan Europe: https://play.google.com/store/apps/details?id=eu.nissan.nissanconnect.services&hl=en_IE

This seems to use the newer API, but evidently something is still off, as I get some data, but not all of it.

I am using the conf.car_adapter_base_url + 'v1/cars/' + vin +'/actions/refresh-battery-status' in the URL for the “Request Battery Status from Car” node.

1 Like

I just importet the NissanConnect and changed username and password in the “Set Flow-Vars/Config”
In the MQTT subflow i entered user/pass for my MQTT installation.

I keep getting the in the debug

TypeError: Cannot read properties of undefined (reading 'vehicle')

Any ideas?