Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Library for communication with Nibe heatpumps.

License

NotificationsYou must be signed in to change notification settings

yozik04/nibe

Repository files navigation

Test and LintPyPI - StatusPyPI - DownloadsPyPIPyPI - LicenseCodecov

Nibe library

Library for communication with Nibe heatpumps.

Supported heatpump models

  • F1145
  • F1245
  • F1155
  • F1255
  • F1345
  • F1355
  • F370
  • F470
  • F730
  • F750
  • S320
  • S325
  • S330
  • S332
  • S735
  • S1156
  • S1256
  • S2125
  • SMO20
  • SMO40
  • SMOS40
  • VVM225
  • VVM310
  • VVM320
  • VVM325
  • VVM500

Connection methods

  • RS485 hardwired using NibeGW on Arduino or RPi. NibeGW was developed by Pauli Anttila forOpenhab's integration.
  • TCP Modbus for S Models
  • Serial Modbus for Nibe Modbus 40)

NibeGW

For this connection method to work you will need to connect an Arduino with special firmware that will act as a proxy between Heatpump RS485 and this library. Some details regarding how this method works can be foundhere.

NibeGW firmware for Arduino or RPi can bedownload here.

  • Library will open 9999 UDP listening port to receive packets from NibeGW.
  • For read commands library will send UDP packets to NibeGW port 9999.
  • For write commands library will send UDP packets to NibeGW port 10000.

Ports are configurable

importasyncioimportloggingfromnibe.coilimportCoilDatafromnibe.connection.nibegwimportNibeGWfromnibe.heatpumpimportHeatPump,Modellogger=logging.getLogger("nibe").getChild(__name__)defon_coil_update(coil_data:CoilData):logger.debug(coil_data)asyncdefmain():heatpump=HeatPump(Model.F1255)# heatpump.word_swap = False  # uncomment if you have word swap disabled in 5.3.11 service menuawaitheatpump.initialize()heatpump.subscribe(HeatPump.COIL_UPDATE_EVENT,on_coil_update)connection=NibeGW(heatpump=heatpump,remote_ip="192.168.1.2")awaitconnection.start()if__name__=='__main__':logging.basicConfig(level=logging.DEBUG)loop=asyncio.get_event_loop()loop.run_until_complete(main())loop.run_forever()

TCP Modbus

With S series heatpumps

importasyncioimportloggingfromnibe.coilimportCoilDatafromnibe.connection.modbusimportModbusfromnibe.heatpumpimportHeatPump,Modellogger=logging.getLogger("nibe").getChild(__name__)defon_coil_update(coil_data:CoilData):logger.debug(f"on_coil_update:{coil_data}")asyncdefmain():heatpump=HeatPump(Model.F1255)# heatpump.word_swap = False  # uncomment if you have word swap disabled in 5.3.11 service menuawaitheatpump.initialize()heatpump.subscribe(HeatPump.COIL_UPDATE_EVENT,on_coil_update)connection=Modbus(heatpump=heatpump,url="tcp://192.168.1.2:502",slave_id=1)coil=heatpump.get_coil_by_name('bt50-room-temp-s1-40033')coil_data=awaitconnection.read_coil(coil)logger.debug(f"main:{coil_data}")if__name__=='__main__':logging.basicConfig(level=logging.DEBUG)loop=asyncio.get_event_loop()loop.run_until_complete(main())loop.run_forever()

Serial Modbus

With NIBE MODBUS 40

importasyncioimportloggingfromnibe.coilimportCoilDatafromnibe.connection.modbusimportModbusfromnibe.heatpumpimportHeatPump,Modellogger=logging.getLogger("nibe").getChild(__name__)defon_coil_update(coil_data:CoilData):logger.debug(f"on_coil_update:{coil_data}")asyncdefmain():heatpump=HeatPump(Model.F1255)# heatpump.word_swap = False  # uncomment if you have word swap disabled in 5.3.11 service menuawaitheatpump.initialize()heatpump.subscribe(HeatPump.COIL_UPDATE_EVENT,on_coil_update)connection=Modbus(heatpump=heatpump,url="serial:///dev/ttyS0",slave_id=1,conn_options={"baudrate":9600})coil=heatpump.get_coil_by_name('bt50-room-temp-s1-40033')coil_data=awaitconnection.read_coil(coil)logger.debug(f"main:{coil_data}")if__name__=='__main__':logging.basicConfig(level=logging.DEBUG)loop=asyncio.get_event_loop()loop.run_until_complete(main())loop.run_forever()

Model auto detection

With NibeGW it is possible to auto identify heatpump model.Heatpump sends information about model every 15 seconds.

heatpump = HeatPump()  # Note that we do not specify model here# ...connection = NibeGW(heatpump=heatpump, remote_ip="192.168.1.2")await connection.start()heatpump.product_info = await connection.read_product_info()await heatpump.initialize()

Disclaimer

Nibe is registered mark of NIBE Energy Systems.

The code was developed as a way of integrating personally owned Nibe heatpump, and it cannot be used for other purposes. It is not affiliated with any company, and it doesn't have commercial intent.

The code is provided AS IS and the developers will not be held responsible for failures in the heatpump operation or any other malfunction.

IMPORTANT: Using this library to control your heatpump is done at your own risk. The developers assume no responsibility for any damage that may occur to your heating system, property, or for any unsafe conditions that may result from improper use. Changing heatpump parameters can potentially damage your equipment or create hazardous conditions. Users should have sufficient knowledge of their heating system before attempting to control it.

HOWTOs for developers

How to capture and replay traffic from NibeGW

Requirements

APT:

  • tcpdump
  • tcpreplay

On recipient device run:

sudo tcpdump -i eth0 udp port 9999 -w nibe-9999.pcaptcprewrite --infile=nibe-9999.pcap --outfile=nibe-9999rw.pcap --dstipmap=192.168.1.3:192.168.1.2 --enet-dmac=CC:CC:CC:CC:CC:CC --fixcsumsudo tcpreplay --intf1=eth0 nibe-9999rw.pcap

You will need to replace IP addresses for rewrite and Mac address of new recipient device

I want to add/update registers in the library

To add/edit registers in the library first of all you need to find documentation how these parameters are officially called. There will be a backward compatibility break if a name will change.

The process contains of mainly next steps: 1. Update source CSV files. 2. Convert CSV files to JSON. 3. Edit extensions.json if needed. 4. Submit PR.

1.A For F series pumps

UseModbusManager. Do CSV export for the unit you want to update. Find the correct file innibe/data folder. Merge data into that file (Do not change/update any lines. All CSV files are source files they must not be changed).

1.B For S serires pumps

Change your pump language to English and do registers export. Merge that data into the correct file innibe/data folder (Do not change/update any lines. All CSV files are source files they must not be changed).

2. Convert source CSV files to JSON

python3 -m nibe.console_scripts.convert_csv

3. Verify JSON files

Verify that conversion was successful and required lines correctly appeared in the json files. If some modifications are required you need to editextensions.json to fix these. Do not edit source CSV files.

4. Submit PR

Attach your source CSV file for reference so we could verify as well.


[8]ページ先頭

©2009-2025 Movatter.jp