Stromzähler ORNO OR-WE-517 auslesen

Begonnen von blueberry63, 24 November 2019, 15:30:41

Vorheriges Thema - Nächstes Thema

blueberry63

Hallo,

ich möchte Euch die Anbindung meines Drehstromzählers OR-WE-517 von ORNO vorstellen.

Szenario:
Stromzähler (OR-WE-517) --> 2 Drähte an Digitus RS485/USB --> Raspberry PI mit socat  --> Ethernet --> FHEM Server

Socat Script:

#!/bin/sh
DEV=/dev/ttyUSB1
/usr/bin/socat TCP4-LISTEN:3300,fork,reuseaddr $DEV,raw,echo=0,b9600,cs8,parenb=2


FHEM Device:

define modbustest ModbusAddr 1 10 192.168.99.52:3300 RTU
attr modbustest dev-h-defLen 4
attr modbustest dev-h-defPoll 1
attr modbustest enableControlSet 1
attr modbustest event-on-change-reading .*
attr modbustest obj-h1-reading serialnbr
attr modbustest obj-h13-len 2
attr modbustest obj-h13-reading cycletime
attr modbustest obj-h14-reading L1
attr modbustest obj-h3-len 2
attr modbustest obj-h3-reading Baudrate
attr modbustest verbose 0


Das ist erst der Anfang und ich werde versuchen, weitere Register auszulesen.

Hat jemand eine Idee, wie der Wert für L1 umzurechnen ist? Bei ca. 225V wird ein Wert von 17247 (float) ausgelesen. Ich habe keine Ahnung, ob ich hier eine lineare Umrechnung machen soll...

Die komplette Beschreibung des Herstellers für das Modbus-Protokoll hänge ich an.

Update (25-Nov-2019):
Die Register werden jetzt richtig ausgelesen. Im Anhang findet Ihr die Definition des Gerätes mit einer Menge von Registern. Ob man die alle braucht, weiss ich selbst noch nicht.

Außerdem hänge ich eine Kopie der Modbus-Beschreibung des Herstellers an. Falls das nicht in Ordnung ist, bitte melden.



Gruß
Blueberry63
FHEM auf BBB mit Wheezy: 1x CUL_HM_HM_SCI_3_FM, 1x INSTAR CAM3010, 1x HM-LC-SW1-PL2, 1x HM-LC-Bl1PBU-FM, 1x HM-Sen-MDIR-O, Viessmann Heizung, Gaszähler via GPIO, Klingel via HM-LC-Bl1PBU-FM an FBox, Mailcheck, AVR, XBMC, NanoCUL 433+668 an Raspi per Ethernet, Funksteckdosen (Pollin, IT), Automower

blueberry63

Ich habe die Umrechnung der "Floating-Werte" hinbekommen. Hier das Beispiel für "Spannung Phase1":


attr modbustest obj-h14-reading V1
attr modbustest obj-h14-unpack f>
attr modbustest obj-h14-format %i


Ich werde in Kürze die wichtigsten Register einbinden und dann hier posten.

Gruß
Blueberry63
FHEM auf BBB mit Wheezy: 1x CUL_HM_HM_SCI_3_FM, 1x INSTAR CAM3010, 1x HM-LC-SW1-PL2, 1x HM-LC-Bl1PBU-FM, 1x HM-Sen-MDIR-O, Viessmann Heizung, Gaszähler via GPIO, Klingel via HM-LC-Bl1PBU-FM an FBox, Mailcheck, AVR, XBMC, NanoCUL 433+668 an Raspi per Ethernet, Funksteckdosen (Pollin, IT), Automower

blueberry63

Ich habe fertig! Die korrekte Definition findet Ihr im 1. Post.

Gruß
Blueberry63
FHEM auf BBB mit Wheezy: 1x CUL_HM_HM_SCI_3_FM, 1x INSTAR CAM3010, 1x HM-LC-SW1-PL2, 1x HM-LC-Bl1PBU-FM, 1x HM-Sen-MDIR-O, Viessmann Heizung, Gaszähler via GPIO, Klingel via HM-LC-Bl1PBU-FM an FBox, Mailcheck, AVR, XBMC, NanoCUL 433+668 an Raspi per Ethernet, Funksteckdosen (Pollin, IT), Automower

dman

Danke, hört sich gut an. Ich werde das in den nächsten Wochen auch versuchen.

andi11

Funktioniert ideal.
Allerdings wollte ich auf Socat verzichten, daher ist meine Defintion etwas anders:

define defmod ModbusLine Modbus /dev/ttyUSB1@9600,8,E,1
define Stromz_orwe517 ModbusAttr 1 60

laserrichi

#5
Mal eine Frage, wie bist du eigentlich mit dem Zähler zufrieden ?

Stimmen die Messwerte ? Was ich mich frage, der wird mit 0,25 - 80A angegeben, wie genau ist er dann im unteren Bereich ?
Wie hoch ist eigentlich der Eigenverbrauch von dem Teil ?
Auf Amazon Bewertung schreibt einer am 12.7. das er zwar zwei Richtungen zählen kann, aber das leider nicht in einem Register bereitstellt und das es auch vom Hersteller so bestätigt wurde.

Überlege mir ob ich so etwas einbaue damit ich mal monitoren kann was man so wirklich Verbraucht. Gibt es da noch alternativen ? Der ist halt doch recht günstig.

RaspberryPi 4 Bullseye,Homematic,Z-Wave,Rademacher Duofern,Signalduino,Fritz7590,ESPEasy,Tasmota,Robonect,Kameras,1-Wire,Modbus,Solar,Maranz,VU+,ulanzi tc001 mit awtrix light

andi11

ich bin sehr zufrieden, und habe einen 2ten gekauft.
Die Software sieht aus wie Windows uralt, aber sie läuft (hab damit die ID geändert)

Die Messwerte passen zu meinem EHZ, genauer hab ich es nicht geprüft.
Eigenverbrauch hab ich nicht gemessen, versorgt wird er über L1
Er kann 2 Richtungen und die Register werden auch beschrieben (bereits mit der Defintion von oben)
Ob er das praktisch kann, habe ich noch nicht probiert.

Aktueller Strom+ Leistung pro Phase klingt im ersten Moment super, funktoiniert auch recht gut.
Allerdings in der Verbindung mit dem Abtastintervall beim Zähler "übersiehst" du schnell Verbraucher, da es nur der aktuelle Wert ist.
Ich nehme daher mittlerweile ein userreading auf differential, was einem "Verbrauch seit letzter Änderung" entspricht. Entsprechende Nachkommastellen bei den Readings natürlich vorausgesetzt, sonst ist die Auflösung schlecht.

Man sieht damit durch die einzelnen Phasen wo die interessanten Verbraucher sind (Stichwort Standby) und kann so kontrollierter kucken.
Alternative: SDM630 ist sehr verbreitet.

laserrichi

ok Danke :-) ich hab deinen Hinweis auf den SDM630 verwirklicht... aber das war vermutlich ein zu schneller Kauf, weil der nicht saldierend ist. Aber dafür hat der wiederum das Thema Zweirichtung besser gelöst und mehr Readings eben genau dafür, ist vieleicht zur momentanmessung das bessere.
Jetzt glaube ich fast das es den perfekten Zähler wohl nicht gibt. Na wir werden sehen :-)
RaspberryPi 4 Bullseye,Homematic,Z-Wave,Rademacher Duofern,Signalduino,Fritz7590,ESPEasy,Tasmota,Robonect,Kameras,1-Wire,Modbus,Solar,Maranz,VU+,ulanzi tc001 mit awtrix light

andi11

was fehlt dir denn konkret an Messung? Das Hauptproblem beim OR-WE ist finde ich das die Anleitung schlecht ist, Register hat er ne Menge und auch noc die Möglichkeit zu verstellen ob er salidierend usw. arbeitet

sn0000py

#9
Hallo habe mal ne blöde Frage, welchen Wert verwendet ihr für anzeige und co?

Also Active.Power oder Apparent.Power oder Reactive.Power bei den energy werten gibt es noch mehr?

Ich will eigentlich nur den akteullen Stromverbrauch in Watt anzeigen, und den Verbrauch der auch vom Netzbetreiber dann verrechnet werden würde aufzeichnen (den energy Wert)

[edit]und ich musste bei einigen WErten statt dem %i auf %.3f stellen weil bei mir die Power in kwH ist, und dementsprechend 0.123kWH auf 0 gerundet wurde bei %i

andi11

bezahlen musst du nur Wirkleistung, also active power.
Ich hatte auch eine Aufzeichnung der aktuellen Leistung, Erfassungsintervall 5min. So manche Vebrauchspitze ging da aber unter.
Mittlerweile verwende ich statTotal-getLast auf die Stunde, Reading erzeugt vom StatisticsModul.

dobiwan

Hallo zusammen,

ich habe mir das Modul eingerichtet. Ich bekomme auch Werte. Nur anscheinend werden mir die aktuellen Leistungswerte nicht angezeigt.
Ich habe allerdings nicht den Zähler per serieller Schnittstelle angeschlossen, sondern einen alten Pi so konfiguriert dass er das Serielle Modbus Signal in Modbus TCP umsetzt.

Hat jemand eine Idee

andi11

welche Register kannst du erfolgreich auslesen, und welche liefern Mist? Kannst du mal deine Konfiguration mit hier reinpacken?

dobiwan

Hier die Config:

define Stromz_orwe517 ModbusAttr 103 10 192.168.xxx.xxx:502 TCP
attr Stromz_orwe517 alias Stromz_orwe517
attr Stromz_orwe517 dev-h-defLen 4
attr Stromz_orwe517 dev-h-defPoll 1
attr Stromz_orwe517 disable 0
attr Stromz_orwe517 enableControlSet 1
attr Stromz_orwe517 event-on-change-reading .*
attr Stromz_orwe517 group Zaehler
attr Stromz_orwe517 obj-h0-reading Serialnbr
attr Stromz_orwe517 obj-h00008-reading scan-h00008
attr Stromz_orwe517 obj-h00009-reading scan-h00009
attr Stromz_orwe517 obj-h00056-reading scan-h00056
attr Stromz_orwe517 obj-h00058-reading scan-h00058
attr Stromz_orwe517 obj-h00065-reading scan-h00065
attr Stromz_orwe517 obj-h13-len 1
attr Stromz_orwe517 obj-h13-reading CycleTime
attr Stromz_orwe517 obj-h14-format %i
attr Stromz_orwe517 obj-h14-reading V1
attr Stromz_orwe517 obj-h14-unpack f>
attr Stromz_orwe517 obj-h16-format %i
attr Stromz_orwe517 obj-h16-reading V2
attr Stromz_orwe517 obj-h16-unpack f>
attr Stromz_orwe517 obj-h18-format %i
attr Stromz_orwe517 obj-h18-reading V3
attr Stromz_orwe517 obj-h18-unpack f>
attr Stromz_orwe517 obj-h2-len 2
attr Stromz_orwe517 obj-h2-reading MeterID
attr Stromz_orwe517 obj-h20-format %.2f
attr Stromz_orwe517 obj-h20-reading GridFreq
attr Stromz_orwe517 obj-h20-unpack f>
attr Stromz_orwe517 obj-h22-format %i
attr Stromz_orwe517 obj-h22-reading C1
attr Stromz_orwe517 obj-h22-unpack f>
attr Stromz_orwe517 obj-h24-format %i
attr Stromz_orwe517 obj-h24-reading C2
attr Stromz_orwe517 obj-h24-unpack f>
attr Stromz_orwe517 obj-h256-format %i
attr Stromz_orwe517 obj-h256-reading E_act_tot
attr Stromz_orwe517 obj-h256-unpack f>
attr Stromz_orwe517 obj-h26-format %i
attr Stromz_orwe517 obj-h26-reading C3
attr Stromz_orwe517 obj-h26-unpack f>
attr Stromz_orwe517 obj-h264-format %i
attr Stromz_orwe517 obj-h264-reading E_forw_act_tot
attr Stromz_orwe517 obj-h264-unpack f>
attr Stromz_orwe517 obj-h272-format %i
attr Stromz_orwe517 obj-h272-reading E_rev_act_tot
attr Stromz_orwe517 obj-h272-unpack f>
attr Stromz_orwe517 obj-h28-format %i
attr Stromz_orwe517 obj-h28-reading P_act_tot
attr Stromz_orwe517 obj-h28-unpack f>
attr Stromz_orwe517 obj-h280-format %i
attr Stromz_orwe517 obj-h280-reading E_react_tot
attr Stromz_orwe517 obj-h280-unpack f>
attr Stromz_orwe517 obj-h288-format %i
attr Stromz_orwe517 obj-h288-reading E_forw_react_tot
attr Stromz_orwe517 obj-h288-unpack f>
attr Stromz_orwe517 obj-h296-format %i
attr Stromz_orwe517 obj-h296-reading E_rev_react_tot
attr Stromz_orwe517 obj-h296-unpack f>
attr Stromz_orwe517 obj-h3-len 2
attr Stromz_orwe517 obj-h3-reading BaudRate
attr Stromz_orwe517 obj-h30-format %i
attr Stromz_orwe517 obj-h30-reading P1_act
attr Stromz_orwe517 obj-h30-unpack f>
attr Stromz_orwe517 obj-h32-format %i
attr Stromz_orwe517 obj-h32-reading P2_act
attr Stromz_orwe517 obj-h32-unpack f>
attr Stromz_orwe517 obj-h34-format %i
attr Stromz_orwe517 obj-h34-reading P3_act
attr Stromz_orwe517 obj-h34-unpack f>
attr Stromz_orwe517 obj-h36-format %i
attr Stromz_orwe517 obj-h36-reading P_react_tot
attr Stromz_orwe517 obj-h36-unpack f>
attr Stromz_orwe517 obj-h38-format %i
attr Stromz_orwe517 obj-h38-reading P1_react
attr Stromz_orwe517 obj-h38-unpack f>
attr Stromz_orwe517 obj-h40-format %i
attr Stromz_orwe517 obj-h40-reading P2_react
attr Stromz_orwe517 obj-h40-unpack f>
attr Stromz_orwe517 obj-h42-format %i
attr Stromz_orwe517 obj-h42-reading P3_react
attr Stromz_orwe517 obj-h42-unpack f>
attr Stromz_orwe517 obj-h44-format %i
attr Stromz_orwe517 obj-h44-reading P_app_tot
attr Stromz_orwe517 obj-h44-unpack f>
attr Stromz_orwe517 obj-h46-format %i
attr Stromz_orwe517 obj-h46-reading P1_app
attr Stromz_orwe517 obj-h46-unpack f>
attr Stromz_orwe517 obj-h48-format %i
attr Stromz_orwe517 obj-h48-reading P2_app
attr Stromz_orwe517 obj-h48-unpack f>
attr Stromz_orwe517 obj-h50-format %i
attr Stromz_orwe517 obj-h50-reading P3_app
attr Stromz_orwe517 obj-h50-unpack f>
attr Stromz_orwe517 obj-h52-format %i
attr Stromz_orwe517 obj-h52-reading P_fact_tot
attr Stromz_orwe517 obj-h52-unpack f>
attr Stromz_orwe517 obj-h66-reading CombinedCode
attr Stromz_orwe517 room Strom
attr Stromz_orwe517 stateFormat E_forw_act_tot
attr Stromz_orwe517 verbose 2

setstate Stromz_orwe517 63
setstate Stromz_orwe517 2022-02-08 08:14:56 BaudRate 9600
setstate Stromz_orwe517 2022-02-08 08:14:58 C1 0
setstate Stromz_orwe517 2022-02-08 08:14:58 C2 0
setstate Stromz_orwe517 2022-02-08 08:14:59 C3 0
setstate Stromz_orwe517 2022-02-08 01:11:02 CombinedCode 0
setstate Stromz_orwe517 2022-02-08 08:14:46 CycleTime 5
setstate Stromz_orwe517 2022-02-08 08:14:42 E_act_tot 63
setstate Stromz_orwe517 2022-02-08 08:10:46 E_forw_act_tot 63
setstate Stromz_orwe517 2022-02-08 08:13:25 E_forw_react_tot 46
setstate Stromz_orwe517 2022-02-08 08:14:43 E_react_tot 46
setstate Stromz_orwe517 2022-02-08 08:13:59 E_rev_act_tot 0
setstate Stromz_orwe517 2022-02-08 08:14:44 E_rev_react_tot 0
setstate Stromz_orwe517 2022-02-08 08:14:57 GridFreq 50.03
setstate Stromz_orwe517 2022-02-08 08:15:06 MeterID 103
setstate Stromz_orwe517 2022-02-08 08:14:59 P1_act 0
setstate Stromz_orwe517 2022-02-08 08:15:01 P1_app 0
setstate Stromz_orwe517 2022-02-08 08:15:00 P1_react 0
setstate Stromz_orwe517 2022-02-08 08:14:59 P2_act 0
setstate Stromz_orwe517 2022-02-08 08:15:01 P2_app 0
setstate Stromz_orwe517 2022-02-08 08:15:00 P2_react 0
setstate Stromz_orwe517 2022-02-08 08:14:59 P3_act 0
setstate Stromz_orwe517 2022-02-08 08:15:01 P3_app 0
setstate Stromz_orwe517 2022-02-08 08:15:01 P3_react 0
setstate Stromz_orwe517 2022-02-08 08:14:59 P_act_tot 0
setstate Stromz_orwe517 2022-02-08 08:15:01 P_app_tot 0
setstate Stromz_orwe517 2022-02-08 08:15:02 P_fact_tot 0
setstate Stromz_orwe517 2022-02-08 08:15:00 P_react_tot 0
setstate Stromz_orwe517 2022-02-08 08:15:06 Serialnbr 0
setstate Stromz_orwe517 2022-02-08 08:14:46 V1 235
setstate Stromz_orwe517 2022-02-08 08:14:46 V2 0
setstate Stromz_orwe517 2022-02-08 08:14:57 V3 0
setstate Stromz_orwe517 2022-02-08 08:15:06 scan-h00008 0
setstate Stromz_orwe517 2022-02-08 08:14:57 scan-h00009 17530
setstate Stromz_orwe517 2022-02-08 08:15:02 scan-h00056 0
setstate Stromz_orwe517 2022-02-08 08:15:02 scan-h00058 0
setstate Stromz_orwe517 2022-02-08 08:15:02 scan-h00065 30115
setstate Stromz_orwe517 2022-02-07 13:59:30 state opened


Und hier die Readings:

BaudRate
9600
2022-02-08 08:14:56
C1
0
2022-02-08 08:14:58
C2
0
2022-02-08 08:14:58
C3
0
2022-02-08 08:14:59
CombinedCode
0
2022-02-08 01:11:02
CycleTime
5
2022-02-08 08:14:46
E_act_tot
63
2022-02-08 08:14:42
E_forw_act_tot
63
2022-02-08 08:10:46
E_forw_react_tot
46
2022-02-08 08:13:25
E_react_tot
46
2022-02-08 08:14:43
E_rev_act_tot
0
2022-02-08 08:13:59
E_rev_react_tot
0
2022-02-08 08:14:44
GridFreq
50.03
2022-02-08 08:14:57
MeterID
103
2022-02-08 08:14:56
P1_act
0
2022-02-08 08:14:59
P1_app
0
2022-02-08 08:15:01
P1_react
0
2022-02-08 08:15:00
P2_act
0
2022-02-08 08:14:59
P2_app
0
2022-02-08 08:15:01
P2_react
0
2022-02-08 08:15:00
P3_act
0
2022-02-08 08:14:59
P3_app
0
2022-02-08 08:15:01
P3_react
0
2022-02-08 08:15:01
P_act_tot
0
2022-02-08 08:14:59
P_app_tot
0
2022-02-08 08:15:01
P_fact_tot
0
2022-02-08 08:15:02
P_react_tot
0
2022-02-08 08:15:00
Serialnbr
0
2022-02-08 08:13:25
V1
235
2022-02-08 08:14:46
V2
0
2022-02-08 08:14:46
V3
0
2022-02-08 08:14:57
scan-h00008
0
2022-02-08 08:14:57
scan-h00009
17530
2022-02-08 08:14:57
scan-h00056
0
2022-02-08 08:15:02
scan-h00058
0
2022-02-08 08:14:50
scan-h00065
30115
2022-02-08 08:14:51
state
opened
2022-02-07 13:59:30

Wie schon geschrieben habe ich eine Raspi B als serial to TCP Wandler benutzt: siehe https://medium.com/@boonsanti/raspberry-pi-3-model-b-modbus-rs-485-to-modbus-tcp-ip-gateway-9ed14ce2c08e

andi11

zeigt dein Zähler beim durchdrücken plausible Werte an?

Das hier ist für mich das komischte:
setstate Stromz_orwe517 2022-02-08 08:14:46 V1 235
setstate Stromz_orwe517 2022-02-08 08:14:46 V2 0
setstate Stromz_orwe517 2022-02-08 08:14:57 V3 0

V1 geht, aber V2 und V3 nicht? Hast du an L2 und L3 was angeschlossen?