A ESPHome components that wraps the Arduino based udp gateway NibeGW
up for use with ESPHome configuration.
When Modbus adapter support is enabled from the heat pump UI, the heat pump will start to send telegrams every now and then. A telegram contains a maximum of 20 registers. Those 20 registers can be configured via the Nibe ModbusManager application.
A telegram from the heat pump must be acknowledged, otherwise the heat pump will raise an alarm and go into the alarm state. Acknowledgement (ACK or NAK) responses should be sent correctly. This component will ACK/NAK and then forward received data to a configured UDP port on a remote host. It will also accept read/write requests on UDP to request other parameters.
You will need an esp32 with some type of RS485 converter hooked up to a UART. It can either be a MAX485 based chip or a chip with automatic flow control like a MAX3485. If using an automatic flow controlling chip, set the dir_pin
to an unused GPIO pin on your board.
An example of such a board is the LilyGo T-CAN485, this board has an integrated RS485 connection that is verified to work with this setup. An example setup can be found in the examples folder.
Add the following to a ESPHome configuration to enable the udp gateway feature to the device.
Minimal Config
external_components:
- source:
type: git
url: https://github.com/elupus/esphome-nibe.git
components: [ nibegw ]
nibegw:
dir_pin: GPIO4
rx_pin: GPIO16
tx_pin: GPIO17
uart_id: 1
udp:
target:
- ip: 192.168.16.130
source:
- 192.168.16.130
acknowledge:
- MODBUS40
Complete Config
external_components:
- source:
type: git
url: https://github.com/elupus/esphome-nibe.git
components: [ nibegw ]
nibegw:
dir_pin: GPIO4
rx_pin: GPIO16
tx_pin: GPIO17
uart_id: 1
udp:
# The target address(s) to send data to. May also be multicast addresses.
target:
- ip: 192.168.16.130
port: 9999
# List of source address to accept read/write from, may be empty for no filter, but
# this is not recommended.
source:
- 192.168.16.130
# Optional port this device will listen to to receive read requests. Defaults to 9999
read_port: 9999
# Optional port this device will listen to to receive write request. Defaults to 10000
write_port: 10000
acknowledge:
- MODBUS40
# Enable a dummy RMU40 accessory to receive updates
# to certain registers faster. This should not be
# enabled if you have an actual RMU40.
- RMU40_4
# Constant replies to certain requests can be made
constants:
- address: MODBUS40
token: ACCESSORY
data: [
0x0A, # MODBUS version low
0x00, # MODBUS version high
0x02, # MODBUS address?
]
# Accessory version response
- address: RMU40_S4
token: ACCESSORY
data: [
0xEE, # RMU ?
0x03, # RMU version low
0x01, # RMU version high
]
# Unknown response that nibepi uses
- address: RMU40_S4
token: RMU_DATA
command: RMU_WRITE
data: [
0x63,
0x00,
]
# Constant fixed temperature to avoid pump going into alarm.
- address: RMU40_S4
token: RMU_WRITE
data: [
0x06, # Temperature
0x14, # degrees low
0x00, # degrees hight
]
Currently no actual parsing of the payload is performed on the ESPHome device, this must be handled by external application.
This components is based on the NibeGW code for arduino from OpenHAB Nibe Addon (src)