Nibe F series with ESPhome - plan-d-io/SGR-dongle GitHub Wiki
This guide shows you how to monitor and control Nibe F-series heat pumps with Home Assistant through your local network, no Nibe Uplink cloud required. It uses a RS-485 equipped ESP32 flashed with the Esphome-nibe component, mimicking the Nibe Modbus 40 device.
Prerequisites
Note: this guide is meant for Windows users, but can be useful for Linux users as well.
- Install ESPhome on your computer. Make sure you have verified that ESPhome works by running the
esphome version
command in a Windows command prompt. - Install Git on your computer. Make sure you have verified that Git works by running the
git version
command in a Windows command prompt. - Download this nibe.yaml file to your computer, and store it on an easy accessible location (e.g.
C:\Temp
). - Open a Windows command prompt, use the
cd
command to navigate to the directory (e.g.cd C:\Temp
). - Compile and upload the nibe.yaml file with
esphome compile nibe.yaml
. ESPhome will download all the required components and compile the file. This is just a test to check if everything works. If this succeeds, you are ready for on-site installation.
Installation
Tools required
- A ESP32 RS-485 dongle, e.g.:
- M5STACK Atomic RS-485 Kit
- M5STACK 2-Relay Unit (only required if you want to use the Smart Grid Ready functions)
- A USB-C cable (included in the M5Stack kit)
- Some small electrical cabling, preferably twisted pair 2 wires
- A wire stripper
- A small flathead screwdriver
- Some Torx and/or hex keys
Home Assistant installation
- Make sure you have installed Home Assistant on a local device and that it is running
- Find and write down the IP address of your Home Assistant (HA) instance on your local network
ESP32 RS-485 dongle preparation
- On your laptop, open the nibe.yaml file and edit the following lines -- Fill in the WiFi SSID and password of your local network
wifi:
ssid: "yourssidhere"
password: "yourpasswordhere"
-- If you have set up a MQTT broker and you want to control the Nibe through MQTT, uncomment these lines and fill in the IP of your HA instance after broker
(e.g. 192.168.4.1
).
mqtt:
broker: 192.168.4.1
discovery: true
on_json_message:
-- Fill in the IP of your HA instance after ip
udp:
# The target address(s) to send data to. May also be multicast addresses.
target:
- ip: 192.168.4.1
port: 9999
- Connect the ESP32 to your computer with the USB cable.
- Open a Windows command prompt, use the
cd
command to navigate to the directory where the nibe.yaml file is located (e.g.cd C:\Temp
). - Identify the COM port the ESP32 is connected to by typing the
mode
command. You should see a device namedCOMx
, withx
a number, e.g.COM3
. - Compile and upload the nibe.yaml file with the
esphome run nibe.yaml --device COMx
. E.g. if the connected port isCOM3
useesphome run nibe.yaml --device COM3
. - If you have performed the above steps successfully, the ESP32 will connect to the wifi. In the debug output on your screen, you should see its IP address on the network. Note this down.
- Disconnect the ESP32 from your laptop.
ESP32 RS-485 installation
- Remove the entire front panel of the heat pump. Remove the cover panel below the heat pump display control unit.
- Connect the ESP32 RS-485 to the Nibe (4 wires needed)
- Connect the SGR relays (4 wires needed)(only required if you want to use the Smart Grid Ready functions)
Nibe heat pump configuration
- Press the back button on the control unit for seven seconds. A service menu appears. Enter it.
- Go to
Service
>Accessory settings
>modbus
and enable it. - Go to
Service
>Soft in/outputs
and set the first AUX contact as SGR1, the second AUX contact as SGR2 (only required if you want to use the Smart Grid Ready functions). - Go to
Heat pump
>Plus functions
>SG Ready
and enable it (only required if you want to use the Smart Grid Ready functions). - Return to the main menu. If the heat pump does not go into alarm mode, the ESP32 installation is finished.
Nibe integration on Home Assistant
- Log-in to your local HA instance.
- Go to
Settings
>Devices and Services
. Click onAdd integration
in the lower right corner. Search forNibe
and selectNibe heat pump
. - After the integration has been downloaded, select the
NibeGW
option. - In the following screen, select the model of heat pump. Fill in the IP address of the ESP32 under
Remote address
. Click onSubmit
. - After a few seconds, the Nibe integration should be activated.
- Go to
Settings
>Devices and Services
. Select the Nibe device. - In the
Diagnostic
tab, expand the entities not shown. - Find a sensor called
BT1 Outdoor Temperature
. Click on it. Enable the sensor. - Do the same for the following sensors:
--
Alarm
--BT50 Room Temperature
(thermostat room temperature) --BT7 HW Top
(DHW buffer temperature) --SG Ready input A
--SG Ready input A
--State SG Ready
Note that the exact name of the sensor may differ depending on the type of heat pump.
Modbus errors
Nibe heat pumps use a hacked version of the standard Modbus protocol, and require an immediate acknowledgment from connected devices. The Nibe ESPhome component implements this functionality. However, when wifi connection is lost or the HA instance is unavailable, the ESP32 might reboot and miss an acknowledgment, which will make the Nibe heatpump throw an error 251 (Modbus error) and stop normal operation. It can be useful to implement an automation in HA triggered by error 251 and calling the reset service.