2017 © Pedro Peláez
 

library nissan-connect-php

This is a simple library that will allow you to use the Nissan Connect (was Carwings) API to check on your Nissan LEAF, and start/stop climate control, or start charging.

image

gboudreau/nissan-connect-php

This is a simple library that will allow you to use the Nissan Connect (was Carwings) API to check on your Nissan LEAF, and start/stop climate control, or start charging.

  • Tuesday, June 5, 2018
  • by gboudreau
  • Repository
  • 6 Watchers
  • 13 Stars
  • 22 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 9 Forks
  • 2 Open issues
  • 13 Versions
  • 16 % Grown

The README.md

Nissan Connect PHP Class

Use the Nissan Connect (was Carwings) API using a simple PHP class., (*1)

Installation

You can just download NissanConnect.class.php and require/include it, or use composer:, (*2)

require "gboudreau/nissan-connect-php": "dev-master"

If you are in North America, you probably need to use the new-api branch, instead of master:, (*3)

require "gboudreau/nissan-connect-php": "dev-new-api"

Usage

require_once 'NissanConnect.class.php';

// All parameters except the first two (username & password) are optional; the default values are shown here
// If you can't use the openssl_encrypt() function (very unlikely), you can use a web-service to encrypt your password. Simply change the last parameter to NissanConnect::ENCRYPTION_OPTION_WEBSERVICE
$nissanConnect = new NissanConnect('you@something.com', 'your_password_here', 'America/New_York', NissanConnect::COUNTRY_US, NissanConnect::ENCRYPTION_OPTION_OPENSSL);

// Change to TRUE to log debugging information into your PHP error log
$nissanConnect->debug = FALSE;

// How long (in seconds) should we wait for the result before giving up. Only used when $waitForResult = TRUE
$nissanConnect->maxWaitTime = 290;

try {
    $result = $nissanConnect->getStatus();
    var_dump($result);

    // Start charging
    $nissanConnect->startCharge();

    // Should we wait until the command result is known, before returning? Enabling this will wait until the car executed the command, and returned the response, which can sometimes take a few minutes.
    $waitForResult = FALSE; 

    // Start Climate Control
    $nissanConnect->startClimateControl($waitForResult);

    // Stop Climate Control
    $nissanConnect->stopClimateControl($waitForResult);
} catch (Exception $ex) {
    echo "An error occurred: " . $ex->getMessage();
}

Example output (var_dumped result of call to getStatus):, (*4)

object(stdClass)#9 (18) {
  ["LastUpdated"]=>
  string(16) "2016-02-21 15:24"
  ["PluggedIn"]=>
  bool(true)
  ["Charging"]=>
  bool(false)
  ["ChargingMode"]=>
  string(12) "NOT_CHARGING"
  ["BatteryCapacity"]=>
  int(12)
  ["BatteryRemainingAmount"]=>
  int(9)
  ["BatteryRemainingAmountWH"]=>
  NULL
  ["BatteryRemainingAmountkWH"]=>
  NULL
  ["TimeRequiredToFull"]=>
  NULL
  ["TimeRequiredToFull200"]=>
  NULL
  ["TimeRequiredToFull200_6kW"]=>
  NULL
  ["CruisingRangeAcOn"]=>
  float(90.4)
  ["CruisingRangeAcOff"]=>
  float(115.712)
  ["CruisingRangeUnit"]=>
  string(2) "km"
  ["RemoteACRunning"]=>
  bool(false)
  ["RemoteACLastChanged"]=>
  string(16) "2016-02-21 15:24"
  ["ACStartStopURL"]=>
  NULL
  ["ACDurationBatterySec"]=>
  int(900)
  ["ACDurationPluggedSec"]=>
  int(7200)
}

Acknowledgements

Thanks to Joshua Perry for his Carwings protocol reference which I used as a reference to refactor my One-click access to LEAF by creating this class., (*5)

Developed mainly using a free open-source license of
PHPStorm
kindly provided by JetBrains. Thanks guys!, (*6)

The Versions

05/06 2018

dev-new-api

dev-new-api https://github.com/gboudreau/nissan-connect-php

This is a simple library that will allow you to use the Nissan Connect (was Carwings) API to check on your Nissan LEAF, and start/stop climate control, or start charging.

  Sources   Download

GPL-3.0-or-later

The Requires

  • php >=5.0

 

api leaf nissan nissanconnect carwings

05/06 2018

dev-master

9999999-dev https://github.com/gboudreau/nissan-connect-php

This is a simple library that will allow you to use the Nissan Connect (was Carwings) API to check on your Nissan LEAF, and start/stop climate control, or start charging.

  Sources   Download

GPLv3 GPL-3.0-or-later

The Requires

  • php >=5.0

 

api leaf nissan nissanconnect carwings

28/02 2017

2.2.1

2.2.1.0 https://github.com/gboudreau/nissan-connect-php

This is a simple library that will allow you to use the Nissan Connect (was Carwings) API to check on your Nissan LEAF, and start/stop climate control, or start charging.

  Sources   Download

GPLv3

The Requires

  • php >=5.0

 

api leaf nissan nissanconnect carwings

21/02 2017

2.2.0

2.2.0.0 https://github.com/gboudreau/nissan-connect-php

This is a simple library that will allow you to use the Nissan Connect (was Carwings) API to check on your Nissan LEAF, and start/stop climate control, or start charging.

  Sources   Download

GPLv3

The Requires

  • php >=5.0

 

api leaf nissan nissanconnect carwings

12/12 2016

2.1.7

2.1.7.0 https://github.com/gboudreau/nissan-connect-php

This is a simple library that will allow you to use the Nissan Connect (was Carwings) API to check on your Nissan LEAF, and start/stop climate control, or start charging.

  Sources   Download

GPLv3

The Requires

  • php >=5.0

 

api leaf nissan nissanconnect carwings

29/09 2016

2.1.6

2.1.6.0 https://github.com/gboudreau/nissan-connect-php

This is a simple library that will allow you to use the Nissan Connect (was Carwings) API to check on your Nissan LEAF, and start/stop climate control, or start charging.

  Sources   Download

GPLv3

The Requires

  • php >=5.0

 

api leaf nissan nissanconnect carwings

28/09 2016

2.1.5

2.1.5.0 https://github.com/gboudreau/nissan-connect-php

This is a simple library that will allow you to use the Nissan Connect (was Carwings) API to check on your Nissan LEAF, and start/stop climate control, or start charging.

  Sources   Download

GPLv3

The Requires

  • php >=5.0

 

api leaf nissan nissanconnect carwings

28/09 2016

2.1.4

2.1.4.0 https://github.com/gboudreau/nissan-connect-php

This is a simple library that will allow you to use the Nissan Connect (was Carwings) API to check on your Nissan LEAF, and start/stop climate control, or start charging.

  Sources   Download

GPLv3

The Requires

  • php >=5.0

 

api leaf nissan nissanconnect carwings

27/09 2016

2.1.3

2.1.3.0 https://github.com/gboudreau/nissan-connect-php

This is a simple library that will allow you to use the Nissan Connect (was Carwings) API to check on your Nissan LEAF, and start/stop climate control, or start charging.

  Sources   Download

GPLv3

The Requires

  • php >=5.0
  • ext-mcrypt *

 

api leaf nissan nissanconnect carwings

01/05 2016

2.1.2

2.1.2.0 https://github.com/gboudreau/nissan-connect-php

This is a simple library that will allow you to use the Nissan Connect (was Carwings) API to check on your Nissan LEAF, and start/stop climate control, or start charging.

  Sources   Download

GPLv3

The Requires

  • php >=5.0
  • ext-mcrypt *

 

api leaf nissan nissanconnect carwings

21/03 2016

2.1.1

2.1.1.0 https://github.com/gboudreau/nissan-connect-php

This is a simple library that will allow you to use the Nissan Connect (was Carwings) API to check on your Nissan LEAF, and start/stop climate control, or start charging.

  Sources   Download

GPLv3

The Requires

  • php >=5.0
  • ext-mcrypt *

 

api leaf nissan nissanconnect carwings

18/03 2016

2.1.0

2.1.0.0 https://github.com/gboudreau/nissan-connect-php

This is a simple library that will allow you to use the Nissan Connect (was Carwings) API to check on your Nissan LEAF, and start/stop climate control, or start charging.

  Sources   Download

GPLv3

The Requires

  • php >=5.0
  • ext-mcrypt *

 

api leaf nissan nissanconnect carwings

12/03 2016

2.0.0

2.0.0.0 https://github.com/gboudreau/nissan-connect-php

This is a simple library that will allow you to use the Nissan Connect (was Carwings) API to check on your Nissan LEAF, and start/stop climate control, or start charging.

  Sources   Download

GPLv3

The Requires

  • php >=5.0

 

api leaf nissan nissanconnect carwings