» Diskussionsforum » Energie- und Haustechnik-Forum

DIY Alternative zu Nibe Modbus Modul

431 Beiträge | 29.1.2019 - 5.6.2020
Weil es hier immer wieder zu Diskussionen zum Thema Modbus-Anbindung der Nibe kommt, wollte ich hier mal kurz meine Erfahrungen mit dem Nachbau einer DiY Lösung, auf Basis von im Netz vorhandener Infos, teilen. Für mich war es eine Spielerei und Zeitvertreib der letzten Tage. Der Post dient vor allem als Speicherort für meine gesammelten Infos und evt. dem Austausch von Leuten, die das so oder so ähnlich bei sich installiert haben. Ich kann und will hier keine Empfehlung abgeben, sowas selbst zu machen!

Die Lösung basiert im Wesentlichen auf den Nibe Bindings von openHAB (https://www.openhab.org/addons/bindings/nibeheatpump/), das eine Umsetzung Modbus auf UDP macht. Infos zur Funktionsweise findet man auf der openHAB Seite bzw. dem entsprechenden github Repo.

Die grobe Vorgangsweise war folgend:
1) Auf einen Arduino mit Ethernet Shield und RS485 Adapter die NibeGW Software (Teil des Bindings) installieren. Der Ardunio Code muss dabei an die eigenen Netzwerkeinstellungen angepasst werden. 

2) Den Arduino an die Wärmepumpe und ans LAN anschließen.

3) Die Nibe Modbus Manager Software auf einem Rechner installieren und bis zu 20 Register auswählen, die periodisch von der Wärmepumpe exportiert werden sollen. Diese Konfig muss gespeichert und per USB-Stick auf die WP übertragen werden.

4) Das Modbus Modul in der WP aktivieren. Wenn alles geklappt hat, bleibt die Wärmepumpe im Normalbetrieb. Falls irgendwas bei der Kommunikation mit dem Arduino schief geht, wird eine Fehlermeldung am Display ausgegeben und die WP geht in einen Alarmmodus.

5) Das nibeopenhab Binding in openHAB installieren und konfigurieren.

zu 1) Man könnte dazu auch einen Raspberry Pi mit RS485 Adapter verwenden, auf dem dann auch openHAB selbst läuft. Das finde ich aber nicht optimal. Ein Pi wäre mir da nicht robust genug. Selbst ein einfacher Neustart des Pis würde zu einem Fehler der WP führen und ein SD-Kartenfehler wäre sowieso ungemütlich.

zu 5) Da ich derzeit noch nicht weiß ob es openHAB oder was anderes wird - über Erfahrungen bzw. Empfehlungen würde ich mich freuen(!) - habe ich das Binding so adaptiert, das es ohne openHAB läuft. Derzeit verwende ich die Log-Dateien dieses "Stand-Alone Bindings" zur Speicherung der Werte. Eine Erweiterung für "richtige" Ausgabeformate bzw. Kanäle (Umsetzung auf KNX wurde hier mal in einem anderen Thread diskutiert) wäre aber von hier weg leicht machbar.

 
23.5.2020 18:21


Becker schrieb: Noch mal für Dumme: ich integriere mir einen RPi mit RS485 & 12->5V Adapter in die WP, darauf mache ich Raspian und dann Node.js von NibePi ? Und dann kann ich noch einen MQTT Server drauf laufen lassen und damit erst mal per Kommandozeile lesen/schreiben ?
Und dann kann ich in Node RED o.ä. Programmen eine Visualierung bauen, diese greifen dann auf MQTT zu ?

Yes, basically Raspbian installation + NodeRED installation, you can even use my NodeRED nodes which integrates into the heatpump directly without MQTT. In NodeRED you can build automations or activate the MQTT part from NodeRED.
Since you're doing an integrated solution I would use my 1.0.6 image file and skip my "NibePi" user interface which is availible in NodeRED. The image file runs in read-only and can be open up for writing when needed. This add some safety/stability features and minimizes SD card wearing.



hartmut schrieb: Weis jemand mit welchem Partameter die Lüftunsgeschwindigkeit geändert werden kann?
Da gibt es ja Stufen mit eingestelleten Parametern, wie beim Heisswasser. Ich finde aber nicht den Parameter der die Stufen beinflusst.
Hartmut

The register you are looking for is 47260. It's not in the official modbus documentation. But it has been found anyway. My final version of 1.1 will have that included in the register files.


23.5.2020 18:37
I will prepare an image file with my 1.1 beta version stripped down of all features, just including raspbian with read-only file system, NodeRED with my NibePi nodeRED package, which will provide with a basic setup to communicate with the heatpump and use nodes to get/send data. That part is almost completly done. Just lacking information.
23.5.2020 19:52
Thank you for the information. I will then wait until the V1.1 image.
23.5.2020 20:06


nibepi schrieb: Since you're doing an integrated solution I would use my 1.0.6 image file and skip my "NibePi" user interface which is availible in NodeRED.

 Basically, this is what I use as base for my nibegw RPi. All my other RPi run Gentoo but nibepis image fits this need perfectly. It even contains mosquitto server so all you have to do is strip down a little bit (Node Red).

You can access this mosquitto broker from other computers in your network. If you install the client side of mosquitto on your other RPi, you can use mosquitto_pub/sub as I do. You only have to use -h <name or ip adress of mosquitto server>.



nibepi schrieb: It's not in the official modbus documentation. But it has been found anyway.

Do you have a pointer (swedish is okay as google translate does a perfect job in translating to englisch) to other non official registers? Actually, I'm looking for the address of the energy meter for passive cooling on the F1155-6PC. 

With respect to 1155, I already found some other registers not in F1155.json. Most of them are related to schedules for heating etc, but this one is special to 9xxx FW versions:

49874: minimal speed for circ. pump heating



Becker schrieb: ich integriere mir einen RPi mit RS485 & 12->5V Adapter in die WP, darauf mache ich Raspian und dann Node.js von NibePi ? Und dann kann ich noch einen MQTT Server drauf laufen lassen und damit erst mal per Kommandozeile lesen/schreiben ?

All das hast du mit nibepis Image schon.

Per MQTT kannst du von überall im Netz aus drauf zugreifen (eventuell noch die mosquitto-Konfig entsprechend ändern).

Wenn du das 1.0.6er Image nimmst, musst du nur den neueren Code aus dem GIT draufpacken.
23.5.2020 23:56
Okey I have updated my repo with more information on how to get started, I also added a image file for the NibePi 1.1 Clean version with Node-RED nodes and example preinstalled.
MQTT information is available also how to get/set/add/remove register from MQTT.

Repo: https://github.com/anerdins/node-red-contrib-nibepi/
24.5.2020 0:05
Vielen Dank

Kannst du mir sagen wie ich etwas in Node Red anpassen kann, wenn das ganze ein Read-only ist ?
24.5.2020 7:52


Becker schrieb: Kannst du mir sagen wie ich etwas in Node Red anpassen kann, wenn das ganze ein Read-only ist ?

In Node-RED you can click a input node (Start) which activates the node called "Set READ/WRITE filesystem", then the filesystem will be writable any. And you can deploy more nodes or do whatever you want with your Pi.
If you deploy your flow the filesystem will be in read-only mode again after that. If you want to disable read-only mode completly. You doubleclick a NibePi node and go in and edit the server setting, and uncheck the read-only box.
Then read-only will be disabled when you save it.
And again, the password for SSH login is pi / nibe
 
24.5.2020 7:55


JanRi schrieb: Do you have a pointer (swedish is okay as google translate does a perfect job in translating to englisch) to other non official registers? Actually, I'm looking for the address of the energy meter for passive cooling on the F1155-6PC. 

I dont have a good pointer, I got the tip from a user in my facebook forum. When I googled "Nibe 47260" the pointer I got was to Nibe Uplink, some registers are visible in the uplink and the registers seems mostly to be the same.
24.5.2020 10:34
In my case, Uplink does not help as the passive cooling energy meter is not in uplink.

Now I take a different way: I just updated my upd<->mqtt-adapter in a way that it can access also unknown registers and logs all bytes of the answer. This way, I can get values for all possible data types and can search for the register by the value it contains (the energy meter value is known from display). Lets see if this works... if not, we have a complete scan of unknown registers from 40000 to 49999. Obviously, this will take a while as I run this in parallel to the normal operation and therefore only access one unknown register every 5 seconds.
24.5.2020 10:55


JanRi schrieb: Now I take a different way: I just updated my upd<->mqtt-adapter in a way that it can access also unknown registers and logs all bytes of the answer. This way, I can get values for all possible data types and can search for the register by the value it contains (the energy meter value is known from display). Lets see if this works... if not, we have a complete scan of unknown registers from 40000 to 49999. Obviously, this will take a while as I run this in parallel to the normal operation and therefore only access one unknown register every 5 seconds.

 Sounds like a good idea! I can help with the sorting of data. Is there any possible way to share the data with me in either Excel format or json, or some other format? 
So we can sort out the known data. And then sort out all the unvalid crap. 
24.5.2020 11:25
I create this as csv-file. Known data is already excluded as I scan only registers not in F1155.json (your file with some additions by me). Once this is ready, I can send you the file (just send me an email address using the forum communication).


nibepi schrieb: And then sort out all the unvalid crap. 


Currently, this seems to be the majority.

Additionally, we have interconnections between registers: 40004 is outside temperature so it reads 136, 0 as 16 bit value for 13,6C. 40003 gives me a 32 bit value: 0,0,136,0. So 40003 in 32 bit also accesses 40004 as "upper part". This seems obvious, but not happens for all registers. 

In a few minutes, the scan from 40000-40999 is ready and I will continue with the next.

According to what I guess, it should be enough to scan 40000-49999. What do you think?
24.5.2020 11:35


JanRi schrieb: Additionally, we have interconnections between registers: 40004 is outside temperature so it reads 136, 0 as 16 bit value for 13,6C. 40003 gives me a 32 bit value: 0,0,136,0. So 40003 in 32 bit also accesses 40004 as "upper part". This seems obvious, but not happens for all registers. 

In a few minutes, the scan from 40000-40999 is ready and I will continue with the next.

According to what I guess, it should be enough to scan 40000-49999. What do you think?

 Intresting results about the 40003. Uplink uses some registers at 10001-19999 but I think those are just made up registers for Uplinks cause. Regular modbus protcols sometimes have registers at 30001-39999 but I havent seen anything that relates to that.
If we found something interesting I can graph some registers up easily in nibepi and se if the value changes over time.


24.5.2020 12:27
Got your mail... I will send the file once it is ready.

Currently, it logs a large number of 0,0,0,0

Many number are 255 or 128 - I guess those are also not interesting. The number of promising registers is (currently... I'm at 41700) really low so it seems to be possible to track them in order to figure out what they are for.
24.5.2020 12:42


JanRi schrieb: Many number are 255 or 128 - I guess those are also not interesting. The number of promising registers is (currently... I'm at 41700) really low so it seems to be possible to track them in order to figure out what they are for.

 When I think about it, all register which gives an respons might be interesting. Weird numbers can be a part of a 32 bit register. 
The Register that dont give a respons at al do not exist. All other can have a purpose. So lets not throw them Away at first. 
Very interesting that you find anything at all. 
24.5.2020 12:44
Was wäre denn am besten?
RPi 3B + https://www.conrad.de/scripts/wgate/zcop_bilder/!?show_artnum=1267832

Kann die WP den RPi mit Strom versorgen? 12V -> 5V Adpater oder wird das zu knapp ?
24.5.2020 12:52


Becker schrieb: Was wäre denn am besten?
RPi 3B + https://www.conrad.de/scripts/wgate/zcop_bilder/!?show_artnum=1267832

Kann die WP den RPi mit Strom versorgen? 12V -> 5V Adpater oder wird das zu knapp ?

That might work.
Check out my old github
https://github.com/bebben88/NibePi

A lot of links and a photo of my setup, look for the RS485 and the 12v shim.
24.5.2020 13:05


nibepi schrieb: All other can have a purpose. So lets not throw them Away at first. 

 I keep them all.

This is how I select what I keep:

if ((buf[3]==106) && (buf[i+5] !== undefined) && (address != 65535) && (address>32000))

This is part of my decoder that is quite similar to yours from 1.0.6. This code sits in the "else"-case of the check if the register is known. I got some artifacts with register numbers different from the one that I request (usually <256) that I drop by the last rule. Sometimes, I get 65535 as register instead of the requested on - this I also drop. The same I do with too short answers (i+5 == undefined) as correct type 106 answers always contain 4 data bytes no matter of type. I only use type 106 (read answer) because these are the answers to our requests.



Becker schrieb: Kann die WP den RPi mit Strom versorgen? 12V -> 5V Adpater oder wird das zu knapp ?


I do not believe that this is a good idea! According to the findings some pages ago, the heat pump delivers appr. 120 mA at 12V. This is 1,44 W including conversion losses so it is less than 1,44W at 5V. This is not enough for a RPI3B that requires up to 3A at 5V.

I operate even my much less power hungry RPI2 from a separate power supply.



nibepi schrieb: That might work.
Check out my old github


The Pi Zero consumes MUCH less power.
24.5.2020 13:15
Success!

Scanning is at 42362 but I already searched through the result file.

The energy meter for cooling at heat pump shows 1911... and I found 19110 in register 40769 (with a shifted shadow copy in 40768).

40769 contains: 166;74;0;0

166+74*256=19110

Currently, cooling is not active but I will monitor that register once scanning is finished. At the moment, I guess it is rather unlikely that such a register contains exactly the known value of the energy meter I'm searching for withou being this energy meter.

Now, we have another thing Uplink cannot do

Edit: Just now, 42406 was found containing also 166;74. Lets see how it continues. With respect to other energy meter, there is usually a register for the energy meter of the heat pump and another one for the overall value of all heat pumps in the system. Therefore, it might be obvious that we see this value more than once.
24.5.2020 13:19
Next addition: Theory seems to be true. 42425 contains a copy of the heating energy meter (also known value).
24.5.2020 13:26
In the file with known registers, 40769 is "Heat Meter - Pool2 Cpr EP15" for heat pumps different from 1155. 42406 is not in that list and 42425 also not.
24.5.2020 13:48


JanRi schrieb: The Pi Zero consumes MUCH less power.

 I forgot that he had a 3B+, only the rpi zero is a good match for the 12v power.



JanRi schrieb: 40769 contains: 166;74;0;0

166+74*256=19110

Currently, cooling is not active but I will monitor that register once scanning is finished. At the moment, I guess it is rather unlikely that such a register contains exactly the known value of the energy meter I'm searching for withou being this energy meter.

Now, we have another thing Uplink cannot do

Great findings! This is truly great stuff!




Beitrag hinzufügen oder Werbung ausblenden?
Einloggen

 Kostenlos registrieren [Mehr Infos]

« Energie- und Haustechnik-Forum