This an ESPHome repository for Modbus RTU connection to multiple Climate Controllers.
Following devices are already included:
- Danfoss Optyma Control - AK-RC111
I plan to build settings for multiple devices. You can help me and send functional settings or the Parameter list.
Im getting a Climate Control but this only has Modbus RTU. I havent found any project that got the device going with HomeAssistant. So i discussed with the Company who sells me the Climate System and they borrowed me a Danfoss Optyma Control where I can experiment with.
You will need and ESP12 ord ESP32, a RS485 bridge (6 for 10€ at Amazon). But use the one with automatic flow control. Then you will have two leds and you see the communication.
ion the modbus.yaml file you find the basic configuration. Use this as your base.
uart:
id: mod_bus
tx_pin: GPIO17
rx_pin: GPIO16
baud_rate: 38400
parity: EVEN
stop_bits: 1
data_bits: 8
rx_buffer_size: 512
modbus:
id: modbus1
uart_id: mod_bus
modbus_controller:
id: ESP_WP_Steuerung
modbus_id: modbus1
update_interval: 5s
address: 0x0C
This is the main definition for a Modbus. It defines a Serial interface, a Modbus and a Modbus Controller. For the modbus Adress you have to use the exact adress of your device. You could also start with 0x0 and then you will get an error Message in the log that you got a packet from a unkown device (Danfoss 0x06).
sensor: !include { file: gen/danfoss-optyma_sensor.yaml, vars: {modbus: "ESP_WP_Steuerung"}}
binary_sensor: !include { file: gen/danfoss-optyma_binary_sensor.yaml, vars: {modbus: "ESP_WP_Steuerung"}}
number: !include { file: gen/danfoss-optyma_number.yaml, vars: {modbus: "ESP_WP_Steuerung"}}
switch: !include { file: gen/danfoss-optyma_switch.yaml, vars: {modbus: "ESP_WP_Steuerung"}}
Here you import the variables of your device. In this version - Danfoss. You will find all others in the /gen directory.
How are the files in the /gen directory made? In here you will find a python script for every supported device. In the files you will find the settings for the parameters and the file will generate the yaml files.
First install esphome cli like in the description. https://esphome.io/guides/installing_esphome.html I prefer the virtual environment source venv/bin/activate Then compile esphome compile modbus.yaml Then install to espdevice which is already connected to your PC via USB esphome upload modbus.yaml
Done. Simple as that
Good for you. But don't hesitate. If you can, you can build your own generator. Just copy a file in /src and start modifying it to your Parameterlist. Dont forget to alter the name of the generated files. If you send me a parameter List I can help you start the process, but only you can test. I found out that these parameter lists are not always correct.