« Heizung, Lüftung, Klima  |

DIY Alternative zu Nibe Modbus Modul

Teilen: facebook    whatsapp    email
 
 <  1  2 ... 3 ... 25  26  27  28 ... 29 ... 49  50  51  > 
  •  chrismo
  •   Gold-Award
29.1.2019 - 25.4.2024
1.009 Antworten | 62 Autoren 1009
127
1136
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 WP [Wärmepumpe] übertragen werden.

4) Das Modbus Modul in der WP WP [Wärmepumpe] 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 WP [Wärmepumpe] 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 WP [Wärmepumpe] 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.

von energiesparhaus

  •  KoMa
15.9.2020  (#521)
Next update ...

I enabled TLS ... bad situation is that we have mosquitto 1.4.1 installed and there is no mosquitto 1.5 for this debian release. V1.5 brings per listener settings and this will allow unauthenticated traffic on localhost and only authenticated on the network.

Now my setup looks like this:
Port 1883 (MQTT in plain text) listens only on localhost
Port 8883 (MQTT with SSL) listens on all interfaces
Advantage of this setup: Less performance on localhost because of the unecrypted traffic.

My mosquitto.conf:
# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example

pid_file /var/run/mosquitto.pid
include_dir /etc/mosquitto/conf.d

# Disable Persistence -> RO file system
#
persistence false
#persistence_location /var/lib/mosquitto/

# Disable Logging for performance and RO file system
# If enabled. log to RAMDISK
#
#log_dest file /tmp/mosquitto.log
#log_timestamp true
#log_type debug

# Define Listeners and per Listener settings
# Needs MOSQUITTO V1.5!!!
#
#per_listener_settings true

# Listener 1883
#  -only on localhost
#  -unencrypted
#  -no authentication (will come with v1.5)
#
listener 1883 localhost
#allow_anonymous true

# Listener 8883
#  -on all NICs
#  -Encrypted
#  -authentication
#
listener 8883
allow_anonymous false
password_file /etc/mosquitto/users.conf
certfile /etc/nginx/ssl/SSL-CERT.cer
cafile /etc/nginx/ssl/CA-CERT.cer
keyfile /etc/nginx/ssl/SSL-KEY.key

(If you now ask regarding nginx-path: I'll later setup a nginx proxy to make node-red accesible vie port 443 only and do a redirect from port 80 (http) to 443 (https) and I want to share certificates.

This for now works fine ... disadvantage: Some tools (like MQTT 2.1.4 for iobroker) do not support self signed certificates. To make this work, edit /opt/iobroker/node_modules/iobroker.mqtt/lib/client.js and add "rejectUnauthorized: false" (without "" and remeber to add a commy at the end of line 134).

I already opened a feature request.

KoMa

1
  •  KoMa
15.9.2020  (#522)
A short question: I see the values in MQTT are updated very often. Is there a wait to pause after each run for xx seconds or minutes?

Thanks a lot

1
  •  JanRi
  •   Gold-Award
15.9.2020  (#523)

zitat..
chrismo schrieb: Is there any documentation about these limits? And do you know wheter the official Modbus40 module adheres to them?

Documentation... I don't know. Actually, I use NibePis F1155.json for that emoji

I GUESS that the official module respects the limits but I do not have such a module. What I know: The heat pump does NOT check these values, at least not for max pump speed.


1
  •  KoMa
15.9.2020  (#524)
I had a little bit of time ...

Installing nginx is pretty simple as well ... Reason for this: I'd like to have only https via port 443 and an automatic redirect from port 80:

mount -o remount,rw /
apt install -y nginx apache2-utils

vi /etc/nginx/nginx.conf in http section (these ones are important, adjust the rest to your needs):
        #error_log /tmp/nginx/error.log;
        error_log /dev/null;
        pid /var/run/nginx.pid;

        server_tokens off;

#       ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_protocols TLSv1.2;
        ssl_ciphers   HIGH:!aNULL:!MD5:!3DES;
        ssl_prefer_server_ciphers on;
        client_max_body_size 512M;
        #access_log /tmp/nginx/access.log;
        access_log /dev/null;

vi /etc/nginx/sites-enabled/default for the instances ... the first server will redirect http (80) to http (443), the second will forward requests to localhost 1880 (nodered):

server {
        listen 80 default_server;
        listen [::]:80 default_server;
        return 301 https://$host$request_uri;
        }

server {
        listen 443 ssl;
        listen [::]:443 ssl;

        ssl_certificate /etc/nginx/ssl/SSL-CERT.cer;
        ssl_certificate_key /etc/nginx/ssl/SSL-KEY.key;

        server_name _;

        location / {
                proxy_pass http://127.0.0.1:1880/;
                proxy_set_header Host $host;

#               proxy_buffering off;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_set_header X-Real-IP $remote_addr;
        }
}

Advantages of this setup:
-There is a reverse proxy (nginx) handling the traffic
-Possibility to do much more stuff with nginx
-only port 80 and 443 is needed
-traffic in LAN is encrypted

Security can be enhanced, by changing ui port to localhost only:
vi /home/pi/.node-red/settings.js 
remove // from line uiHost: "127.0.0.1",

reboot

Overall advantages: only Http (80 with redirect to encrypted https), Https (443) and MQTT via SSL (8883) and SSH (22) are reachable from the network.

UPDATE: Needed to add some proxy headers to prevent "Lost Connection Errors" in NodeRed.

1
  •  KoMa
15.9.2020  (#525)
And also the following services can be stopped and disabled. I see no real use/benfit on nibepi:

systemctl disable nmbd.service
systemctl stop nmbd.service
systemctl disable avahi-daemon.socket 
systemctl stop avahi-daemon.socket 
systemctl disable avahi-daemon.service
systemctl stop avahi-daemon.service

1
  •  nibepi
16.9.2020  (#526)

zitat..
KoMa schrieb: And also the following services can be stopped and disabled. I see no real use/benfit on nibepi:

systemctl disable nmbd.service
systemctl stop nmbd.service
systemctl disable avahi-daemon.socket 
systemctl stop avahi-daemon.socket 
systemctl disable avahi-daemon.service
systemctl stop avahi-daemon.service

Sorry for not responding atm. I'm in the middle of mowing to another city and I dont have it all set up yet.
But I've just now read all your posts and I love it. When I get time to it I will make an effort to implement as much as possible. This is a missing piece that I've always wanted to have.  And improving the raspberry as much as possible is very much appreciated.

Just a short respond to the registers, there is not possible to set an time delay right now, every register in the log.set will be sent every 2,1 second (these registers are also in the config.json list but not manually requested). Then the rest of the registers will be requested in order and the list will circle around. If a register is requested by a /get or request node it will be prioritized before the "regular list".
Of course it's possible to add any kind of delay with a timestamp check, but it has not been my priority. Every time the heatpump sends the "request frame" nibepi makes an request.

Most of my users in sweden uses the UI dashboard and the config file gets updated fine from there. But I have got some reports that the nodered admin ui dosent update the config file correctly. I havent managed to reproduce that error unfortunally.


1
  •  steffenmuc
17.9.2020  (#527)
Frage in die Runde, sollte der generelle Ansatz mit dem Raspberry auf den Bus auch mit der neuen S-Series WP WP [Wärmepumpe] der NIBE funktionieren? Ich hab eine VVM S320 + F2120-12 und noch ne S135 für die Abluft. Hat das schon mal jemand angeschaut?
Danke euch
Steffen

1
  •  Peter2
  •   Bronze-Award
19.9.2020  (#528)
Neue Info bezüglich raspberry pi 4. Mit einem Update des bootloader kann von usb gebootet werden. Dadurch entfallen die Probleme mit der sd Karte.
MfG 
Peter


1
  •  chrismo
  •   Gold-Award
19.9.2020  (#529)
Ein USB Stick ist im Endeffekt das gleiche wie eine SD Karte, beides sind Flashspeicher. Also die Lebensdauer ist da vergleichbar. Am längsten halten SD Karten/USB Sticks mit SLC Zellen. NibePi minimiert das Problem aber ohnehin durch ein Read-only Dateisystem.

1
  •  Peter2
  •   Bronze-Award
20.9.2020  (#530)
Also ich werde eine gute alte usb Festplatte verwenden. (keine ssd) Hält gefühlt ewig und sollte sie nach 30 Jahren den Geist aufgegeben kann ich das auch verkraften.
MfG 
Peter 

1
  •  Andreas90
20.9.2020  (#531)
Einfach eine mirco SD mit SLC oder pSLC Speicher verwenden und gut ist (sollte problemlos die WP WP [Wärmepumpe] überleben, auch wenn der speicher nicht auf read only steht)

PI 4 hat einen relativ hohen Stromverbrauch

Eine Festplatte ist definitiv anfälliger (und auch wieder Stromverbrauch) 

1
  •  flump
22.9.2020  (#532)
Hi!
Ich habe eine Nive F1255-6 und würde gerne einen NibePi betreiben.
Gibt es den PiZero auch fertig (Hardware-seitig)? Weil löten kann ich nicht emoji

Verstehe ich das richtig, dass der PiZero die Daten out of the box über MQTT ausgeben kann?
Das wäre für mich ideal, denn ich habe Loxone und verarbeite schon diverse Daten per MQTT...

Ein PiZero wäre mir am liebsten, ich würde den direkt in der WP WP [Wärmepumpe] verbauen und mit Strom von der WP WP [Wärmepumpe] versorgen...

LG, flump

1
  •  KoMa
22.9.2020  (#533)
Das ist nicht weiter schwer ... (Alle Links mal von Amazon, geht bestimmt wo anders oder mit anderen Herstellern günstiger) ...

Wenn WLAN für dich OK ist, dann brauchst Du nur die Teile:

1. Pi Zero: https://www.amazon.de/dp/B07BHMRTTY/?ie=UTF8&tag=wwwenergiespa-21
2. Netzteil: https://www.amazon.de/dp/B07GHNVBKF/?ie=UTF8&tag=wwwenergiespa-21
3. RS485 HAT: https://www.amazon.de/dp/B07DNPFMRW/?ie=UTF8&tag=wwwenergiespa-21
4. SD-Karte: https://www.amazon.de/dp/B073JWXGNT/?ie=UTF8&tag=wwwenergiespa-21

Wenn Du LAN haben möchtest, dann noch das:
5. LAN: https://www.amazon.de/dp/B07T35X4P4/?ie=UTF8&tag=wwwenergiespa-21

Das Einzige, was gelötet werden muss, ist "2", um den Strom direkt von der Heizung zu bekommen. Der Rest wird gesteckt/geschraubt.

Ich habe das ganze mit 4 Adern eines 2m Patch-Kabels (RS485 und Strom) mit der Heizung verbunden, in eine Aufputz-Verteilerdose (ich meine 100x100) gelegt und die oben auf die Heizung bzw. aufs FLM gelegt.

1
  •  flump
22.9.2020  (#534)
Vielen Dank für die Info, das hilft mir weiter! 

2 Fragen :
MQTT funktioniert out of the Box? 
Wie erstellt ihr Diagramme? Ich würde damit gerne nibeuplink ersetzen... 

LG, flump 

1
  •  chrismo
  •   Gold-Award
22.9.2020  (#535)
Für Diagramme verwende ich Grafana und InfluxDb. Mit ein bisschen Einarbeitung, kann man da gute interaktive Visualisierungen machen.

Bsp: https://www.energiesparhaus.at/forum-erdwaerme-soletemperaturen-2019-20/55576_21#542735

1
  •  KoMa
22.9.2020  (#536)
Ich auch ...

per MQTT zum iobroker, um da ggf die Werte zu nutzen und der iobroker schreibt Werte (von MQTT aber auch von der Homematic, etc.) in die influxdb. Grafana wird dann zur Darstellung genutzt.

2
  •  KoMa
23.9.2020  (#537)

zitat..
flump schrieb: MQTT funktioniert out of the Box?

Ja, aber nur unverschlüsselt. Um das Ganze verschlüsselt zu nutzen habe ich oben ein paar Infos geschrieben. 

1
  •  flump
23.9.2020  (#538)
Danke euch für die Infos!
Ich werd mich mal mit dem Thema beschäftigen...
LG

1
  •  nibepi
23.9.2020  (#539)

zitat..
steffenmuc schrieb: Frage in die Runde, sollte der generelle Ansatz mit dem Raspberry auf den Bus auch mit der neuen S-Series WP WP [Wärmepumpe] der NIBE funktionieren? Ich hab eine VVM S320 + F2120-12 und noch ne S135 für die Abluft. Hat das schon mal jemand angeschaut?
Danke euch
Steffen

Nibe S series supports Modbus TCP out of the box. thus no need for built in raspberry. You can connect with Modbus TCP from NodeRED, openHAB, Home assistant etc just with a IP address.
Modbus on S series is very limited, very few registers..
NibePi in docker supports S series as a test, but only S1255 at the moment.

1
  •  KoMa
24.9.2020  (#540)
Ich habe aktuell das Problem, dass Änderungen im NodeRed nicht in die /etc/nibepi/config.json geschrieben werden.

Damit werden bei einem Neustart meine Änderungen überschrieben, bzw. bei einem Flow - Restart wird gesagt, auf dem Server wären andere Infos als im System und ob ich die "mergen" möchte.

Gibts dazu eine Idee, wie man das verhindern kann und die Daten in die config.json geschrieben werden?

Ich verwende v1.1 und das Dateisystem habe ich auf RW gemountet.

1
  •  nibepi
24.9.2020  (#541)

zitat..
KoMa schrieb: Ich habe aktuell das Problem, dass Änderungen im NodeRed nicht in die /etc/nibepi/config.json geschrieben werden.

Damit werden bei einem Neustart meine Änderungen überschrieben, bzw. bei einem Flow - Restart wird gesagt, auf dem Server wären andere Infos als im System und ob ich die "mergen" möchte.

Gibts dazu eine Idee, wie man das verhindern kann und die Daten in die config.json geschrieben werden?

Ich verwende v1.1 und das Dateisystem habe ich auf RW gemountet.

This is a bug. NodeRED cant edit the config.
The work around is to edit it manually in SSH with nano or something similiar. Everytime you open the box of the config it defaults the config file, so just edit the file manually and dont open the configuration settings in nodered.

It's normal for warnings when reloading the page if you have changed anything or just moved a node.

1


Beitrag schreiben oder Werbung ausblenden?
Einloggen

 Kostenlos registrieren [Mehr Infos]


next