Giter Site home page Giter Site logo

niu-charge's Introduction

niu-charge

Charging manager for NIU electric scooters

Charging

With niu-charge you can control when to start or stop charging your NIU electric scooter.

In order to preserve the battery, you can set a maximum charging percentage and this software will automatically stop charging when this limit is reached.

Setup

What you need

  • A cloud-connected NIU electric scooter;
  • A ~15€ WiFi smart plug compatible with the Tuya cloud (just search Amazon for tuya smart plug). WARNING: Some plugs might not work with this setup as they can use different versions of the communication protocol.
  • A computer to run this server on. If you don't have one, a 35€ Raspberry Pi will do the job just fine.

How to set it up

Just connect the NIU charger into the smart plug and connect the plug into the wall.

Both the smart plug and the computer you will run this software on must be on the same network.

To configure the server, rename config/example.json into config/default.json and then edit it with your parameters.

Configuring the NIU cloud (See niu-app-api for further technical details)

In order to log in the NIU cloud to check the SoC of the battery, the serial number of the scooter and an authentication token are required. Currently this project doesn't include a login page, so the easiest way to obtain the token is by capturing the packets from the NIU App (using Wireshark or some mobile packet capture app) and extracting the token field from the HTTP header.

Configuring the Tuya protocol

This project is set to work with Tuya compatible products, but can be made to work with any protocol. The tuyapi library is used to comunicate with the plug over LAN.

Follow this tutorial to get the plug's id and key.

Any questions? Need help?

Feel free to contact me on Telegram if you need help or have any questions.

niu-charge's People

Contributors

bonnee avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

eddiecameron

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.