DoganM95 / Ewelink-Rest-Api-Server

Server-code accepting http requests to control ewelink devices
MIT License
4 stars 3 forks source link
docker ewelink itead server

Ewelink REST API Server

A Node.js server application that processes HTTP requests and forwards commands to eWeLink servers for device operations like turn on/off or toggling. This server utilizes the eWeLink API.

Docker

docker run \
  -p <port>:3000 \
  -e "EWELINK_USERNAME=<your_username>" \
  -e "EWELINK_PASSWORD=<your_password>"  \
  -e "EWELINK_REGION=<your_region>" \
  -e "HASHING_ALGORITHM=<your_preferred_algorithm>" \
  -e "SERVER_MODE=dev" \
  -v "<your_local_pem_certs_folder>:/usr/src/app/volume/ssl/" \
  doganm95/ewelink-rest-api-server

Arguments

Example

docker run \  
  -p 8080:3000 \  
  -e "EWELINK_USERNAME=someone@gmail.com" \  
  -e "EWELINK_PASSWORD=passW"  \  
  -e "EWELINK_REGION=eu" \  
  -e "PASSWORD_HASHING_ALGORITHM=sha512" \  
  -e "SERVER_MODE=prod" \  
  -v "C:\Users\Dogan\OneDrive\Desktop\certs_tmp\:/usr/src/app/volume/ssl/" \  
  doganm95/ewelink-rest-api-server  

Usage

Authorization

If SSL encryption is enabled (using privkey.pem and cert.pem files), each request must include an Authorization header with a Bearer Token. This token is your eWeLink password hashed using your chosen algorithm (default: sha3-512). In dev mode, the container logs the hashed password for copying.

API Endpoints

Fetch Devices List

Control a Device

Migration & Resources

For updates to accommodate eWeLink's new OAuth mechanism: