This fantastic project is not developed by me. The project is forked from this : https://github.com/dkjonas/Wavin-AHC-9000-mqtt
All the credits go to the originally owner "dkjonas".
I made some modifications to this project, so the system integrates 3 led´s which can be used to indicate power, mqtt and wifi when all the electronics are mounted in a box.
This project will recieve further updates.
This is a simple Esp8266 mqtt interface for Wavin AHC-9000/Jablotron AC-116, with the goal of being able to control this heating controller from a home automation system.
The AHC-9000 uses modbus to communicate over a half duplex RS422 connection. It has two RJ45 connectors for this purpose, which can both be used. The following schematic shows how to connect an Esp8266 to the AHC-9000:
-
Protoboard-shield : https://www.aliexpress.com/item/ProtoBoard-Shield-for-WeMos-D1-mini-double-sided-perf-board-Compatible/32823336161.html?spm=a2g0s.9042311.0.0.27424c4dOt1jSr
-
M3 bolts.
-
Modbus IC MAX3072E : https://www.aliexpress.com/item/MAX3072E-MAX3072EEPA-DIP/32859557410.html?spm=a2g0s.9042311.0.0.27424c4d1kt8zR
-
WEMOS D1 mini or PRO or any ESP8266 device for that matter
-
330R Resisitors
-
RJ-45 Breakoutboard : https://www.aliexpress.com/item/Durable-Tap-Electronics-RJ45-Breakout-ModuleBoard-For-Arduino-New/32923930313.html?spm=a2g0s.9042311.0.0.27424c4dYoLJ5s
I use PlatformIO for compiling, uploading, and and maintaining dependencies for my code. If you install PlatformIO in a supported editor, building this project is quite simple. Just open the directory containing platformio.ini
from this project, and click build/upload. If you use a different board than nodemcu, remember to change the board
variable in platformio.ini
.
You may be able to use the Arduino tools with the esp8266 additions for compiling, but a few changes may be needed, including downloading dependencies manually.
Assuming you have a working mqtt server setup, you should now be able to control your AHC-9000 using mqtt. If you have the Mosquitto mqtt tools installed on your mqtt server, you can execude:
mosquitto_sub -u username -P password -t heat/# -v
to see all live updated parameters from the controller.
To change the target temperature for a output, use:
mosquitto_pub -u username -P password -t heat/floorXXXXXXXXXXXX/1/target_set -m 20.5
where the number 1 in the above command is the output you want to control and 20.5 is the target temperature in degree celcius. XXXXXXXXXXXX is the MAC address of the Esp8266, so it will be unique for your setup.
If you have a working mqtt setup in HomeAssistant, all you need to do in order to control your heating from HomeAssistant is to enable auto discovery for mqtt in your configuration.yaml
.
mqtt:
discovery: true
discovery_prefix: homeassistant
You will then get a climate and a battery sensor device for each configured output on the controller.
If you don't like auto discovery, you can add the entries manually. Create an entry for each output you want to control. Replace the number 0 in the topics with the id of the output and XXXXXXXXXXXX with the MAC of the Esp8266 (can be determined with the mosquitto_sub command shown above)
climate wavinAhc9000:
- platform: mqtt
name: floor_kitchen
current_temperature_topic: "heat/floorXXXXXXXXXXXX/0/current"
temperature_command_topic: "heat/floorXXXXXXXXXXXX/0/target_set"
temperature_state_topic: "heat/floorXXXXXXXXXXXX/0/target"
mode_command_topic: "heat/floorXXXXXXXXXXXX/0/mode_set"
mode_state_topic: "heat/floorXXXXXXXXXXXX/0/mode"
modes:
- "heat"
- "off"
availability_topic: "heat/floorXXXXXXXXXXXX/online"
payload_available: "True"
payload_not_available: "False"
qos: 0
sensor wavinBattery:
- platform: mqtt
state_topic: "heat/floorXXXXXXXXXXXX/0/battery"
availability_topic: "heat/floorXXXXXXXXXXXX/online"
payload_available: "True"
payload_not_available: "False"
name: floor_kitchen_battery
unit_of_measurement: "%"
device_class: battery
qos: 0