Enginsh 简体中文
Bridge service for communicating with Gree air conditioners using MQTT broadcasts. It can also be used as a Hass.io addon.
- GO (>=1.18.0)
- An MQTT broker and Gree smart HVAC device on the same network
Make sure you have GO (>=1.18.0) installed and run the following (adjust the arguments to match your setup):
git clone https://github.com/FeranyDev/gree_havc_mqtt_bridge_go.git
cd gree_havc_mqtt_bridge_go
go install
go build
./gree_havc_mqtt_bridge_go \
-hvac-host 192.168.1.225 \
-mqtt-broker-url 192.168.1.1 \
-mqtt-broker-port 1883 \
-mqtt-topic-prefix home/greehvac
- or
./gree_havc_mqtt_bridge_go \
-hvac-host 192.168.1.225 \
-bemfa-client-id bemfa_key \
-bemfa-topic bemfa_topic
- or
./gree_havc_mqtt_bridge_go \
-hvac-host 192.168.1.225 \
-mqtt-broker-url 192.168.100.1 \
-mqtt-broker-port 1883 \
-mqtt-topic-prefix home/greehvac \
-bemfa-client-id bemfa_key \
-bemfa-topic bemfa_topic
- or
./gree_havc_mqtt_bridge_go -c ./config.json
mqtt:
havc:
host: 192.168.1.1
port: 1883
username: havc
password: havc
client_id: havc
retain: false
tls: false
bemfa:
host: bemfa.com
port: 9501 # TLS 9503
username: bemfa
password: bemfa
client_id: bemfa
retain: false
tls: false
gree:
- host: 192.168.1.225
port: 7000
havc_topic: havc_topic_prefix
bemfa_topic: bemfa_topic
- host: 192.168.1.226
port: 7000
havc_topic: havc_topic_prefix
bemfa_topic: bemfa_topic
MQTT topic scheme:
MQTT_TOPIC_PREFIX/COMMAND/get
Get valueMQTT_TOPIC_PREFIX/COMMAND/set
Set value
Note: boolean values are set using 0 or 1
Command | Values | Description |
---|---|---|
temperature | any integer | In degrees Celsius by default |
mode | off, auto, cool, heat, dry, fan_only | Operation mode |
fanspeed | auto, low, mediumLow, medium, mediumHigh, high | Fan speed |
swinghor | default, full, fixedLeft, fixedMidLeft, fixedMid, fixedMidRight, fixedRight | Horizontal Swing |
swingvert | default, full, fixedTop, fixedMidTop, fixedMid, fixedMidBottom, fixedBottom, swingBottom, swingMidBottom, swingMid, swingMidTop, swingTop | Vetical swing |
power | 0, 1 | Turn device on/off |
health | 0, 1 | Health ("Cold plasma") mode, only for devices equipped with "anion generator", which absorbs dust and kills bacteria |
powersave | 0, 1 | Power Saving mode |
lights | 0, 1 | Turn on/off device lights |
quiet | 0, 1, 2, 3 | Quiet modes |
blow | 0, 1 | Keeps the fan running for a while after shutting down (also called "X-Fan", only usable in Dry and Cool mode) |
air | off, inside, outside, mode3 | Fresh air valve |
sleep | 0, 1 | Sleep mode |
turbo | 0, 1 | Turbo mode |
The service can be used as a 3rd party addon for the Hass.io MQTT climate platform, although not all commands are supported.
- Install the addon
- Customize addon options (HVAC host, MQTT broker URL, MQTT topic prefix)
- Add the following to your
configuration.yaml
climate:
- platform: mqtt
# Change to whatever you want
name: Gree HVAC
# Change MQTT_TOPIC_PREFIX to what you've set in addon options
current_temperature_topic: "MQTT_TOPIC_PREFIX/temperature/get"
temperature_command_topic: "MQTT_TOPIC_PREFIX/temperature/set"
temperature_state_topic: "MQTT_TOPIC_PREFIX/temperature/get"
mode_state_topic: "MQTT_TOPIC_PREFIX/mode/get"
mode_command_topic: "MQTT_TOPIC_PREFIX/mode/set"
fan_mode_state_topic: "MQTT_TOPIC_PREFIX/fanspeed/get"
fan_mode_command_topic: "MQTT_TOPIC_PREFIX/fanspeed/set"
swing_mode_state_topic: "MQTT_TOPIC_PREFIX/swingvert/get"
swing_mode_command_topic: "MQTT_TOPIC_PREFIX/swingvert/set"
power_state_topic: "MQTT_TOPIC_PREFIX/power/get"
power_command_topic: "MQTT_TOPIC_PREFIX/power/set"
# Keep the following as is
payload_off: 0
payload_on: 1
modes:
- "off"
- "auto"
- "cool"
- "heat"
- "dry"
- "fan_only"
swing_modes:
- "default"
- "full"
- "fixedTop"
- "fixedMidTop"
- "fixedMid"
- "fixedMidBottom"
- "fixedBottom"
- "swingBottom"
- "swingMidBottom"
- "swingMid"
- "swingMidTop"
- "swingTop"
fan_modes:
- "auto"
- "low"
- "mediumLow"
- "medium"
- "mediumHigh"
- "high"
Hass.io doesn't supply separate on/off switch. Use the dedicated mode for that.
- Make sure your HVAC is running in AP mode. You can reset the WiFi config by pressing MODE +WIFI (or MODE + TURBO) on the AC remote for 5s.
- Connect with the AP wifi network (the SSID name should be a 8-character alfanumeric, e.g. "u34k5l166").
- Run the following in your UNIX terminal:
echo -n "{\"psw\": \"YOUR_WIFI_PASSWORD\",\"ssid\": \"YOUR_WIFI_SSID\",\"t\": \"wlan\"}" | nc -cu 192.168.1.1 7000
Note: This command may vary depending on your OS (e.g. Linux, macOS, CygWin). If facing problems, please consult the appropriate netcat manual.
[1.0.0]
First release
This project is licensed under the GNU GPLv3 - see the LICENSE file for details
- arthurkrupa for gree-hvac-mqtt-bridge node.js project
- tomikaa87 for reverse-engineering the Gree protocol
- oroce for inspiration
- arthurkrupa for the actual service
- bkbilly for service improvements to MQTT
- aaronsb for sweeping the Node floor