Code Monkey home page Code Monkey logo

Comments (8)

gboudreau avatar gboudreau commented on June 15, 2024

Without access to an account that has such a vehicle on file, I can't test anything of that sort.
My guess: they won't be available on the old API, but would be available on the new one.

I have a branch that uses the new API: https://github.com/gboudreau/nissan-connect-php/tree/new-api
Maybe you can try both that branch and master, and just by enabling DEBUG ($nissanConnect->debug = FALSE;) you should be able to see the response received from the server, and thus see if the info you need is in there (for the indoor temp).
For the commands, searching other LEAF project on Github, you might find an answer to those. Otherwise, someone with a new LEAF on his account would need to use an HTTPS proxy to sniff the traffic of the Nissan Connect app.

from nissan-connect-php.

Raiden38 avatar Raiden38 commented on June 15, 2024

Thanks for the reaply, the master API works very well with the Gen2. I will enable debut and see what the server gives. And will try to find the command for locking doors ;) And FYI, I'm still using a script from June with URL https://icm.infinitiusa.com/NissanLeafProd/rest/ and it works pretty good! :)

from nissan-connect-php.

Raiden38 avatar Raiden38 commented on June 15, 2024

This is the response it gets.. Indoor temp would be inc-temp:

{
    "batteryRecords": {
        "operationResult": "START",
        "lastUpdatedDateAndTime": "2019-01-17T18:33:31Z",
        "batteryStatus": {
            "batteryChargingStatus": "YES",
            "batteryCapacity": 100,
            "batteryRemainingAmount": 94,
            "soc": {
                "value": 94
            }
        },
        "pluginState": "CONNECTED",
        "cruisingRangeAcOn": 187000,
        "cruisingRangeAcOff": 233000,
        "timeRequired": null,
        "timeRequired200": null,
        "timeRequired200_6kW": {
            "hourRequiredToFull": 1,
            "minutesRequiredToFull": 30
        },
        "notificationDateAndTime": null
    },
    "temperatureRecords": {
        "operationResult": null,
        "operationDateAndTime": null,
        "notificationDateAndTime": null,
        "inc_temp": "13.5"
    },
    "noBatteryRecords": null,
    "noTemperatureRecords": null,
    "status": 200
}

from nissan-connect-php.

Raiden38 avatar Raiden38 commented on June 15, 2024

For the temperature, this is the page it connects to, to start climate. Notice climateTemp at the end of the querystring... So maybe if we send this it would work:

https://carwings.mynissan.ca/owners/leaf/setHvacMY18?vin=1N4AZ1CP6JCXXXXXX&fan=on&climateTemp=22

from nissan-connect-php.

gboudreau avatar gboudreau commented on June 15, 2024

The HVAC start on the new API is hvac/vehicles/{$this->config->vin}/activateHVAC; looks pretty different than what you found. Not sure adding a param there would help.

You can try to modify this function:

    public function startClimateControl($waitForResult = FALSE, $target_temperature = NULL) {
        $this->prepare();
        $params = array('executionTime' => date('c'));
        if (!empty($target_temperature)) {
            $params['climateTemp'] = $target_temperature;
        }
        $result = $this->sendRequest("hvac/vehicles/{$this->config->vin}/activateHVAC", $params);
        return $result;
    }

from nissan-connect-php.

gboudreau avatar gboudreau commented on June 15, 2024

Ah, wait. I found some doc about it. I'll commit something in a few seconds.

from nissan-connect-php.

gboudreau avatar gboudreau commented on June 15, 2024

Try the new version from here: https://github.com/gboudreau/nissan-connect-php/tree/new-api

Interior temperature will be in $status->interior_temperature,
and you can set the target temperature with
$nissan-> startClimateControl(FALSE, 22, 'C'); or
$nissan-> startClimateControl(FALSE, 72, 'F');

from nissan-connect-php.

gboudreau avatar gboudreau commented on June 15, 2024

Remote door lock has been added in the same branch (commit 575f838).

from nissan-connect-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.