stas-demydiuk / ewpe-smart-mqtt

MQTT bridge for EWPE Smart powered devices
MIT License
64 stars 26 forks source link
ewpe-smart gree gree-smart mqtt-bridge

ewpe-smart-mqtt

MQTT bridge for EWPE Smart powered devices which can be controled via WiFi using EWPE Smart app

This project became possible thanks to great work of reverse engineering the original app protocol in gree-remote project

smart-1-600x600

Prerequisites

Setup and run MQTT server (mosquitto is the easiest one)

Installation

  1. Clone or download this repository
    git clone https://github.com/stas-demydiuk/ewpe-smart-mqtt
  2. Install dependencies
    npm install
  3. Make initial configuration by setting enviromental variables
Variable Description Default value
MQTT_SERVER MQTT server URI mqtt://127.0.0.1
MQTT_PORT MQTT Server Port 1883
MQTT_USERNAME MQTT Server Username
MQTT_PASSWORD MQTT Server Password
MQTT_BASE_TOPIC Base MQTT topic for bridge messages ewpe-smart
NETWORK Network adress (or addresses separated by semicolon) to scan devices 192.168.1.255
DEVICE_POLL_INTERVAL Interval (ms) to poll device status 5000
LOG_LEVEL App Log level info
  1. Run the bridge
    npm start

Installation (Docker)

docker run -it \
    --network="host" \
    -e "MQTT_SERVER=mqtt://127.0.0.1" \
    -e "MQTT_BASE_TOPIC=ewpe-smart" \
    -e "NETWORK=192.168.1.255" \
    -e "DEVICE_POLL_INTERVAL=5000" \
    --name ewpe-smart-mqtt \
    demydiuk/ewpe-smart-mqtt:latest

Installation (systemd service)

  1. Clone or download the repository

    cd /opt/
    git clone https://github.com/stas-demydiuk/ewpe-smart-mqtt
  2. Create service file sudo nano /etc/systemd/system/ewpe-smart-mqtt.service

[Unit]
Description=ewpe-smart-mqtt
After=mosquitto.target

[Service]
ExecStart=/usr/bin/node /opt/ewpe-smart-mqtt/index.js --NETWORK="192.168.1.255" --MQTT_SERVER="mqtt://127.0.0.1" --MQTT_PORT="1883" --MQTT_USERNAME="" --MQTT_PASSWORD="" --MQTT_BASE_TOPIC="ewpe-smart" --DEVICE_POLL_INTERVAL="5000" 
# Required on some systems
WorkingDirectory=/opt/ewpe-smart-mqtt
StandardOutput=inherit
StandardError=inherit
Restart=always
RestartSec=10
User=pi
Group=pi

[Install]
WantedBy=multi-user.target
  1. Run the servive

Communicating with the bridge

Supported features depend on your AC unit, full list can be found here

Supported devices

All devices which can be controlled via EWPE Smart app should be supported, including: