In this repository you will find all the ressources to control the Amperage of a WallBox through its API
TODO
- maxChargingCurrent
Le courant max de charge du chargeur
- responsePuissance
La puissance à partir de laquelle on veut charger
- stopCounter
Compteur utile pour arreter la charge
- seuilPuissance
Le seuil de puissance pour pouvoir arreter la charge
- jwtToken
The JWT Token with it expiration date
- setmaxChargingCurrent()
Set the value of maxChargingCurrent by function
- auth()
The function below is used to authenticate the user and setup the refurbishment of the token
- setAmperage(value)
This function is used to set the amperage of the charger
- switchOff()
This function is used to stop the charger
- switchOn()
This function is used to start the charger
- getShellyPower()
This function is used to get the power of the shelly
- main1()
The function below is used to start the script
- main2()
The function below is used to start the body of the script
- setJwtToken(token, expiration)
The function below is used to modify the jwtToken object
- getAuthToken(baseUrl, method, callback) ⇒
Promise
The function below is used to generate the jwt Token for the API calls
- fetchData(baseUrl, method, callback, body) ⇒
Promise
The function below is used to make the API calls
- delay(ms) ⇒
Promise
A small fucntion to handle delay between API requests
- logger(message)
This function add a message to the console and to the log file
Le courant max de charge du chargeur
La puissance à partir de laquelle on veut charger
Compteur utile pour arreter la charge
Le seuil de puissance pour pouvoir arreter la charge
The JWT Token with it expiration date
Set the value of maxChargingCurrent by function
The function below is used to authenticate the user and setup the refurbishment of the token
This function is used to set the amperage of the charger
Kind: global function
Param | Type | Description |
---|---|---|
value | Number |
The value of the amperage |
This function is used to stop the charger
This function is used to start the charger
This function is used to get the power of the shelly
The function below is used to start the script
The function below is used to start the body of the script
The function below is used to modify the jwtToken object
Kind: global function
Param | Type | Description |
---|---|---|
token | String |
The token to be stored |
expiration | Date |
The expiration date of the token |
The function below is used to generate the jwt Token for the API calls
Kind: global function
Returns: Promise
- The promise of the API call
Param | Type | Description |
---|---|---|
baseUrl | String |
The endpoint of the API Request |
method | String |
The method of the API Request |
callback | function |
The callback function to be called after the API call |
The function below is used to make the API calls
Kind: global function
Returns: Promise
- The promise of the API call
Param | Type | Default | Description |
---|---|---|---|
baseUrl | String |
The endpoint of the API Request | |
method | String |
The method of the API Request | |
callback | function |
The callback function to be called after the API call | |
body | Object |
{} |
The body of the API Request |
A small fucntion to handle delay between API requests
Kind: global function
Returns: Promise
- The promise of the timeout
Param | Type | Description |
---|---|---|
ms | Number |
The number of milliseconds to wait |
This function add a message to the console and to the log file
Kind: global function
Param | Type | Description |
---|---|---|
message | String |
The message to be logged |