Closed jeremyakers closed 6 years ago
Works fine for me now. You?
Nope, now I'm getting:
[2018-06-03 11:32:09] [NissanConnect] Using authToken, VIN and accountID found in local file /tmp/.nissan-connect-storage-67e2ade14f55bbcb1b4c6a2288e8986a.json
[2018-06-03 11:32:09] [NissanConnect] Request: POST https://icm.infinitiusa.com/NissanLeafProd/rest/battery/vehicles/<VIN>/getChargingStatusRequest []
An error occurred: Request for 'battery/vehicles/<VIN>/getChargingStatusRequest' failed. Response received: "<html><head><title>JBoss Web\/7.4.10.Final-redhat-1 - JBWEB000064: Error report<\/title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--><\/style> <\/head><body><h1>JBWEB000065: HTTP Status 405 - <\/h1><HR size=\"1\" noshade=\"noshade\"><p><b>JBWEB000309: type<\/b> JBWEB000067: Status report<\/p><p><b>JBWEB000068: message<\/b> <u><\/u><\/p><p><b>JBWEB000069: description<\/b> <u>JBWEB000125: The specified HTTP method is not allowed for the requested resource.<\/u><\/p><HR size=\"1\" noshade=\"noshade\"><h3>JBoss Web\/7.4.10.Final-redhat-1<\/h3><\/body><\/html>"
I think because "getChargingStatusRequest" should be accessed via GET rather than POST based on my looking at the mitmproxy data from the official app.
However: The official app is still not returning battery data either. It's returning "No content" instead of the expected JSON. I'm starting to think I may need to call Nissan.
getChargingStatusRequest
is sent via a GET, not a POST; it's just the log that incorrectly logs "POST".
Try the latest version of the class; it will fix the log, and will also retry to log in, when it receives a 405.
I went back to the old API, but with an updated base URL, which seems to work just fine.
I kept the work I did for the new api in the new-api
branch, in case we need it in the future, but for now, the new base URL should fix the issues we were having when Nissan deprecated the old URL.
I don't think this is an issue with the nissan-connect-php class, but I wanted to raise it just in case.
I'm no longer getting updated battery info after the switch to the new API (Was working fine until May 27 when the old API shut down) It also updates fine on the Nissan Owners Portal, so this issue is specific to the new API:
I checked the app itself with mitmproxy, and the official Nissan App has the same issue. I just have never noticed because I never use the official app anymore.
Any thoughts on how to resolve this? Everything else in the new API seems to work. HVAC start/stop, driving and electricity records, etc. Everything is fine except for battery status updates.