Giter Site home page Giter Site logo

hagronnestad / leaf-display Goto Github PK

View Code? Open in Web Editor NEW
26.0 4.0 4.0 16.97 MB

๐Ÿš—๐Ÿ”‹๐Ÿ”Œ C# NissanConnect library and ESP8266 code powering a Nextion HMI display used to monitor and control a Nissan Leaf remotely.

License: MIT License

C# 78.17% C++ 20.58% Dockerfile 0.43% Shell 0.81%
nissan leaf nissan-leaf nissanconnect nissan-connect esp8266 nextion nextion-hmi hmi 3d-printing

leaf-display's Introduction

Nissan Leaf 2017 Dashboard

Animated preview of dashboard at different states.

Images of the 3D-printed case and assembly.


LeafClient

The LeafClient is a cross platform console application which can authenticate with and query data from Nissan Connect EV.

Usage

Usage: leafclient username password [-o {filename}] [-p {url}] [-last]

Options:
        username        Your Nissan Connect username.
        password        Your blowfish encrypted password.
                        Encrypt your password at http://sladex.org/blowfish.js/.
                        Key: 'uyI5Dj9g8VCOFDnBRUbr3g'. Cipher mode: ECB. Output type: BASE64.

        -o              Outputs the result as JSON to {filename}.
        -p              Posts the result as JSON to {url}.
        -last           Don't query live data from car.

* I intentionally did not add Blowfish encryption to the application because .NET does not have Blowfish encryption integrated in the framework and I did not want to add a dependency. The password needs to be supplied pre encrypted.

Example

dotnet LeafClient.dll username password -o data.json

Example output file

{
  "Timestamp": "2019-03-20T22:00:00",
  "NickName": "leaf1",
  "Vin": "123456789",
  "PluginState": "NOT_CONNECTED",
  "CruisingRangeAcOn": 168000,
  "CruisingRangeAcOff": 186000,
  "MinutesToFull": 240,
  "MinutesToFull200": 150,
  "MinutesToFull200_6kW": 70,
  "BatteryCapacity": 240,
  "BatteryRemainingAmount": 240,
  "BatteryRemainingAmountWH": 0,
  "BatteryRemainingAmountkWH": 0,
  "StateOfCharge": 92
}

Setup/configuration

I use a cron job on a Linux server to periodically run the LeafClient console application. I use the -o flag which writes the JSON data to a file. This file is served by my web server and consumed by the ESP8266.


IoT parts

ESP8266 Arduino sketch

The ESP8266 folder contains an Arduino skecth to retrieve JSON data from a web server and send it to a Nextion display over serial.

Nextion display

The Nextion folder contains the HMI project for the display that shows the data. The Nextion display I used is the NX4832T035_011 which is the 3.5" version.

This is the Nextion HMI design. I used the actual Nissan Leaf dashboard as inspiration.

Nextion 3D-printable case

STL-files for the Nextion case can be found in the Nextion Case folder. The case is designed to be used with one of these ESP programmers, which makes it very easy to power and flash the ESP through micro USB. It also provides easy access to power and serial pins for the Nextion display.

leaf-display's People

Contributors

hagronnestad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

leaf-display's Issues

Accurate region constants?

I noticed you're using the region constants for Europe and other countries that used to work with Nissan's version 1 of teh Leaf API's. My understanding is with V2, the region name for the USA changed from "NNA" to "US". However, I have no idea what happened with Europe. Is this known to work with a European Leaf account?

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.