1.3.5 • Published 6 months ago

easee-js-slim v1.3.5

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Slim API abstraction for Easee EV charging stations

Quickstart

For single installations for the Easee EV charger

Easee chargers can be installed in very advanced enterprise systems. This is powerful but also makes the API harder to work with.

Most normal home-automation enthusiasts have only one charger, for this case there is a quick-start available. This will query your chain of settings and IDs that are static and unchangeable for you: ChargerId -> SiteId -> CircuitId

Simplest way:

  1. Register your account and charger in the "Easee" app, or at https://easee.cloud/auth/signup.
  2. Set the your Easee account username and password as environment variables:
    Linux:
        export EASEE_USERNAME=youremal@domain.com
        export EASEE_PASSWORD=Password123
    Windows:
        set EASEE_USERNAME=youremal@domain.com
        set EASEE_PASSWORD=Password123
  3. As a one-time thing, run node node_modules/easee-js-slim/src/examples/printEaseeDetails.js ... This will log in and print the complicated nested details. It will print a lot of details and summarize with your IDs example:

         ..
         ....
         It seems you have only one charger and setup.
         For convenience you can then pre-set all as env-variables and the API will use the default.
    
         export EASEE_CHARGERID='EH2AABCD'
         export EASEE_SITEID='1234567'
         export EASEE_CIRCUITID='123456'
         export EASEE_DEBUG=true

Making use of the framework

  1. npm install -save easee-js-slim to install the package to your project
  2. Set the login variables in your ENV (or pass them as parameters, look in the code) Here is some example code to get you started
import Easee from 'easee-js-slim'

async function easeeExample() {
  const easee = new Easee()
  //Log in and set access token
  await easee.initAccessToken()

  //Print the charger-state info
  const state = await easee.getChargerState()
  console.log(state)

  //Stop Charging (if started)
  const response = await easee.stopCharging()
  console.log(response)
}
easeeExample()

API and Documentation

(Will be updated eventually)

Quick reference

Here are some of the functions. JSON-setting-functions takes partial objects, see the official API doc on https://developer.easee.cloud/docs/

await easee.initAccessToken()
const chargers = await easee.getChargers()
const chargerDetails = await easee.getChargerDetails()
const conf = await easee.getChargerConfig()
const schedule = await getWeeklySchedule()
const sites = await easee.getSites()
const site = await easee.getSite()
const circuit = await easee.getCircuitSettings()
easee.pauseCharging()
easee.resumeCharging()
easee.stopCharging()
easee.startCharging()
//Go-Charging helper-function to Start, resume or overrideSchedule (just make it happen..)
easee.startOrResumeCharging()

//Example: Change max charging and default Amps to 10A
const circuitUpdate = {
  maxCircuitCurrentP1: 10,
  maxCircuitCurrentP2: 10,
  maxCircuitCurrentP3: 10,
  offlineMaxCircuitCurrentP1: 10,
  offlineMaxCircuitCurrentP2: 10,
  offlineMaxCircuitCurrentP3: 10,
}
easee.setCircuitSettings(circuitUpdate)

Access token

The initAccessToken() is not needed to run at start, but it is concidered good practice to validate the login on creation/startup. Currently the Easee API specifications do say the access-token expiry interval, so it is set to refresh on the first call after every 10 minutes. This can be overridden by setting the env EASEE_TOKEN_INTERVAL (in milliseconds) if needed.

Debug logging

Make sure to set the export EASEE_DEBUG=true when doing integration. It will log most calls and results in a nice way.

General information and known issues

  • All Contributions/PRs are happily accepted
  • Even though this is a proxy-API, NO GUARANTEES are given, and you can probably screw up your Easee box by sending strange manual commands
  • Uses modules / async and imports
1.3.5

6 months ago

1.3.4

6 months ago

1.3.3

6 months ago

1.3.2

6 months ago

1.3.1

6 months ago

1.3.0

6 months ago

1.2.0

8 months ago

1.1.0

1 year ago

1.0.3

1 year ago

0.3.1

1 year ago

0.2.12

2 years ago

0.2.11

2 years ago

0.2.10

2 years ago

0.2.9

2 years ago

0.2.8

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago