[OBIS V2] - Jetzt auch mit SML-Unterstützung

Begonnen von Icinger, 08 April 2016, 19:54:44

Vorheriges Thema - Nächstes Thema

gvzdus

Das ist ja ziemlich verrückt!

FHEM erhält im Select die Nachricht: "Da sind Daten da!". Und dann wird direkt 2-mal hintereinander gelesen. Beim ersten Mal gibt es Daten, beim 2. Mal nicht, und das wird als "disappeared" interpretiert.

Also, Verdacht #1 ist wirklich: Du hast 2 Geräte auf /dev/ttyUSB1 konfiguriert. Mit "grep /dev/ttyUSB1 /opt/fhem/fhem.cfg" gäbe es zumindest mehrere Zeilen, wenn Du es auch unter dem Namen /dev/ttyUSB1 gemacht hast.

Wenn Du magst, erweitere mal den Code ab Zeile 333 um 2 Logzeilen (die Zeilen mit "Log3" einfügen):

    if( $init_done ) {
        my $name = $hash->{NAME};

        Log3 $hash, 5, "OBIS ($name) - OBIS_Read called, hash is " . $hash;
        my $buf = DevIo_SimpleRead($hash);
        Log3 $hash, 5, "OBIS ($name) - OBIS_Read gave " . (defined($buf) ? length($buf) : "null");
        return if(!defined($buf));


Neustarten oder Reloaden, und dann für ein paar Sekunden auf "verbose 5" gehen. Bei mir sieht das dann so im Logfile aus:

2021.03.26 21:00:55 5: OBIS (MT175) - OBIS_Read called, hash is HASH(0x3a85de0)
2021.03.26 21:00:55 5: OBIS (MT175) - OBIS_Read gave 16
2021.03.26 21:00:55 5: OBIS (MT175) - OBIS_Read called, hash is HASH(0x3a85de0)
2021.03.26 21:00:55 5: OBIS (MT175) - OBIS_Read gave 14
2021.03.26 21:00:55 5: OBIS (MT175) - OBIS_Read called, hash is HASH(0x3a85de0)
2021.03.26 21:00:55 5: OBIS (MT175) - OBIS_Read gave 16
2021.03.26 21:00:55 5: OBIS (MT175) - OBIS_Read called, hash is HASH(0x3a85de0)
2021.03.26 21:00:55 5: OBIS (MT175) - OBIS_Read gave 16
2021.03.26 21:00:55 5: OBIS (MT175) - OBIS_Read called, hash is HASH(0x3a85de0)
2021.03.26 21:00:55 5: OBIS (MT175) - OBIS_Read gave 14
2021.03.26 21:00:55 5: OBIS (MT175) - OBIS_Read called, hash is HASH(0x3a85de0)
2021.03.26 21:00:55 5: OBIS (MT175) - OBIS_Read gave 16
2021.03.26 21:00:55 5: OBIS (MT175) - OBIS_Read called, hash is HASH(0x3a85de0)
2021.03.26 21:00:55 5: OBIS (MT175) - OBIS_Read gave 16
2021.03.26 21:00:55 5: OBIS (MT175) - OBIS_Read called, hash is HASH(0x3a85de0)
2021.03.26 21:00:55 5: OBIS (MT175) - OBIS_Read gave 14
2021.03.26 21:00:55 5: OBIS (MT175) - OBIS_Read called, hash is HASH(0x3a85de0)
2021.03.26 21:00:55 5: OBIS (MT175) - OBIS_Read gave 12
2021.03.26 21:00:55 5: OBIS (MT175) - SML-Parse 1B1B1B1B010101017605021D835B62006200726301017601010500B4811F0B090149534B00047FE6A10101631569007605021D835C620062007263070177010B090149534B00047FE6A1070100620AFFFF7262016501352D527D77078181C78203FF010101010449534B0177070100000009F

gvzdus

P.S.:
attr initialUsbCheck disable 1
ist gesetzt?

Chris46

initialUsbCheck habe ich von Anfang an schon gelöscht. Das Notify existiert bei mir also nicht. Das grep liefert wie erwartet ausschließlich:
root@home:/opt/fhem/FHEM# grep /dev/ttyUSB1 /opt/fhem/fhem.cfg
define zaehler OBIS /dev/ttyUSB1@9600,8,N,1 SML


Die Log3 Zeilen habe ich im Modul mal ergänzt. Mit pollingmode on und interval 5 kommt folgendes:
2021.03.27 10:20:00 4: OBIS (zaehler) - Wrote
2021.03.27 10:20:00 5: OBIS (zaehler) - Internal timer set to 2021-03-27 10:20:05
2021.03.27 10:20:01 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:01 5: OBIS (zaehler) - OBIS_Read gave 255
2021.03.27 10:20:01 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:01 5: OBIS (zaehler) - OBIS_Read gave 109
2021.03.27 10:20:01 5: OBIS (zaehler) - SML-Parse 1B1B1B1B010101017605028BF3126200620072630101760107FFFFFFFFFFFF0500D951070B0A014546522003B2AA3072620164F687570163DCD7007605028BF31362006200726307017707FFFFFFFFFFFF0B0A014546522003B2AA30070100620AFFFF72620164F6875779770701006032010101010101044546520177070100600100FF010101010B0A014546522003B2AA300177070100010800FF641C010472620164F68757621E52FF65019961440177070100010801FF641C010472620164F68757621E52FF64EAF4D40177070100010802FF641C010472620164F68757621E52FF64AE6C700177070100020800FF0172620164F68757621E52FF65028CDA9E0177070100020801FF0172620164F68757621E52FF65021F05680177070100020802FF0172620164F68757621E52FF646DD5360177070100100700FF0101621B520053032201010163FBFD007605028BF3146200620072630201710163C46F0000001B1B1B1B1A02340B
2021.03.27 10:20:01 5: OBIS (zaehler) - Full message-> 1B1B1B1B010101017605028BF3126200620072630101760107FFFFFFFFFFFF0500D951070B0A014546522003B2AA3072620164F687570163DCD7007605028BF31362006200726307017707FFFFFFFFFFFF0B0A014546522003B2AA30070100620AFFFF72620164F6875779770701006032010101010101044546520177070100600100FF010101010B0A014546522003B2AA300177070100010800FF641C010472620164F68757621E52FF65019961440177070100010801FF641C010472620164F68757621E52FF64EAF4D40177070100010802FF641C010472620164F68757621E52FF64AE6C700177070100020800FF0172620164F68757621E52FF65028CDA9E0177070100020801FF0172620164F68757621E52FF65021F05680177070100020802FF0172620164F68757621E52FF646DD5360177070100100700FF0101621B520053032201010163FBFD007605028BF3146200620072630201710163C46F0000001B1B1B1B1A02340B
2021.03.27 10:20:01 4: OBIS (zaehler) - MSG IS:
/
1-0:96.50.1*1(EFR)
1-0:96.1.0*255(
EFR 0)
1-0:1.8.0*255(2682912.4*Wh)
1-0:1.8.1*255(1539810*Wh)
1-0:1.8.2*255(1143102.4*Wh)
1-0:2.8.0*255(4278543.8*Wh)
1-0:2.8.1*255(3558743.2*Wh)
1-0:2.8.2*255(719800.6*Wh)
1-0:16.7.0*255(802*W)
255-255:255.255.255*255()
!

2021.03.27 10:20:01 5: OBIS (zaehler) - Msg-Parse: /
2021.03.27 10:20:01 5: OBIS (zaehler) - Msg-Parse: 1-0:96.50.1*1(EFR)
2021.03.27 10:20:01 5: OBIS (zaehler) - Msg 1-0:96.50.1*1(EFR) is of type ManufID2
2021.03.27 10:20:01 5: OBIS (zaehler) - Msg-Parse: 1-0:96.1.0*255(
EFR 0)
2021.03.27 10:20:01 5: OBIS (zaehler) - Msg-Parse: 1-0:1.8.0*255(2682912.4*Wh)
2021.03.27 10:20:01 5: OBIS (zaehler) - Msg 1-0:1.8.0*255(2682912.4*Wh) is of type Counter
2021.03.27 10:20:01 4: OBIS (zaehler) - Set total_consumption to 2682912.4
2021.03.27 10:20:01 5: OBIS (zaehler) - Msg-Parse: 1-0:1.8.1*255(1539810*Wh)
2021.03.27 10:20:01 5: OBIS (zaehler) - Msg 1-0:1.8.1*255(1539810*Wh) is of type Counter
2021.03.27 10:20:01 4: OBIS (zaehler) - Set total_consumption_Ch1 to 1539810
2021.03.27 10:20:01 5: OBIS (zaehler) - Msg-Parse: 1-0:1.8.2*255(1143102.4*Wh)
2021.03.27 10:20:01 5: OBIS (zaehler) - Msg 1-0:1.8.2*255(1143102.4*Wh) is of type Counter
2021.03.27 10:20:01 4: OBIS (zaehler) - Set total_consumption_Ch2 to 1143102.4
2021.03.27 10:20:01 5: OBIS (zaehler) - Msg-Parse: 1-0:2.8.0*255(4278543.8*Wh)
2021.03.27 10:20:01 5: OBIS (zaehler) - Msg 1-0:2.8.0*255(4278543.8*Wh) is of type Counter
2021.03.27 10:20:01 5: OBIS (zaehler) - Msg-Parse: 1-0:2.8.1*255(3558743.2*Wh)
2021.03.27 10:20:01 5: OBIS (zaehler) - Msg 1-0:2.8.1*255(3558743.2*Wh) is of type Counter
2021.03.27 10:20:01 5: OBIS (zaehler) - Msg-Parse: 1-0:2.8.2*255(719800.6*Wh)
2021.03.27 10:20:01 5: OBIS (zaehler) - Msg 1-0:2.8.2*255(719800.6*Wh) is of type Counter
2021.03.27 10:20:01 5: OBIS (zaehler) - Msg-Parse: 1-0:16.7.0*255(802*W)
2021.03.27 10:20:01 5: OBIS (zaehler) - Msg 1-0:16.7.0*255(802*W) is of type Channels
2021.03.27 10:20:01 5: OBIS (zaehler) - Msg-Parse: 255-255:255.255.255*255()
2021.03.27 10:20:01 5: OBIS (zaehler) - Msg-Parse: !
2021.03.27 10:20:01 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:01 5: OBIS (zaehler) - OBIS_Read gave 55
2021.03.27 10:20:04 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:04 5: OBIS (zaehler) - OBIS_Read gave 255
2021.03.27 10:20:04 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:04 5: OBIS (zaehler) - OBIS_Read gave 255
2021.03.27 10:20:04 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:04 5: OBIS (zaehler) - OBIS_Read gave 255
2021.03.27 10:20:04 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:04 5: OBIS (zaehler) - OBIS_Read gave 255
2021.03.27 10:20:04 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:04 5: OBIS (zaehler) - OBIS_Read gave 17
2021.03.27 10:20:04 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:04 5: OBIS (zaehler) - OBIS_Read gave 59
2021.03.27 10:20:04 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:04 5: OBIS (zaehler) - OBIS_Read gave 15
2021.03.27 10:20:04 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:04 5: OBIS (zaehler) - OBIS_Read gave 14
2021.03.27 10:20:04 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:04 5: OBIS (zaehler) - OBIS_Read gave 61
2021.03.27 10:20:04 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:04 5: OBIS (zaehler) - OBIS_Read gave 90
2021.03.27 10:20:04 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:04 5: OBIS (zaehler) - OBIS_Read gave 30
2021.03.27 10:20:04 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:04 5: OBIS (zaehler) - OBIS_Read gave 75
2021.03.27 10:20:04 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:04 5: OBIS (zaehler) - OBIS_Read gave 20
2021.03.27 10:20:05 5: SW:
2021.03.27 10:20:05 4: OBIS (zaehler) - Wrote
2021.03.27 10:20:05 5: OBIS (zaehler) - Internal timer set to 2021-03-27 10:20:10
2021.03.27 10:20:05 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:05 5: OBIS (zaehler) - OBIS_Read gave 20
2021.03.27 10:20:05 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:05 5: OBIS (zaehler) - OBIS_Read gave 15
2021.03.27 10:20:06 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:06 5: OBIS (zaehler) - OBIS_Read gave 255
2021.03.27 10:20:06 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:06 5: OBIS (zaehler) - OBIS_Read gave 74
2021.03.27 10:20:06 5: OBIS (zaehler) - SML-Parse 1B1B1B1B010101017605028BF3216200620072630101760107FFFFFFFFFFFF0500D9510C0B0A014546522003B2AA3072620164F6875C016312F1007605028BF32262006200726307017707FFFFFFFFFFFF0B0A014546522003B2AA30070100620AFFFF72620164F6875C79770701006032010101010101044546520177070100600100FF010101010B0A014546522003B2AA300177070100010800FF641C010472620164F6875C621E52FF65019961500177070100010801FF641C010472620164F6875C621E52FF64EAF4E00177070100010802FF641C010472620164F6875C621E52FF64AE6C700177070100020800FF0172620164F6875C621E52FF65028CDA9E0177070100020801FF0172620164F6875C621E52FF65021F05680177070100020802FF0172620164F6875C621E52FF646DD5360177070100100700FF0101621B520053033E01010163C873007605028BF3236200620072630201710163ED5C0000001B1B1B1B1A02E591
2021.03.27 10:20:06 5: OBIS (zaehler) - Full message-> 1B1B1B1B010101017605028BF3216200620072630101760107FFFFFFFFFFFF0500D9510C0B0A014546522003B2AA3072620164F6875C016312F1007605028BF32262006200726307017707FFFFFFFFFFFF0B0A014546522003B2AA30070100620AFFFF72620164F6875C79770701006032010101010101044546520177070100600100FF010101010B0A014546522003B2AA300177070100010800FF641C010472620164F6875C621E52FF65019961500177070100010801FF641C010472620164F6875C621E52FF64EAF4E00177070100010802FF641C010472620164F6875C621E52FF64AE6C700177070100020800FF0172620164F6875C621E52FF65028CDA9E0177070100020801FF0172620164F6875C621E52FF65021F05680177070100020802FF0172620164F6875C621E52FF646DD5360177070100100700FF0101621B520053033E01010163C873007605028BF3236200620072630201710163ED5C0000001B1B1B1B1A02E591
2021.03.27 10:20:06 4: OBIS (zaehler) - MSG IS:
/
1-0:96.50.1*1(EFR)
1-0:96.1.0*255(
EFR 0)
1-0:1.8.0*255(2682913.6*Wh)
1-0:1.8.1*255(1539811.2*Wh)
1-0:1.8.2*255(1143102.4*Wh)
1-0:2.8.0*255(4278543.8*Wh)
1-0:2.8.1*255(3558743.2*Wh)
1-0:2.8.2*255(719800.6*Wh)
1-0:16.7.0*255(830*W)
255-255:255.255.255*255()
!

2021.03.27 10:20:06 5: OBIS (zaehler) - Msg-Parse: /
2021.03.27 10:20:06 5: OBIS (zaehler) - Msg-Parse: 1-0:96.50.1*1(EFR)
2021.03.27 10:20:06 5: OBIS (zaehler) - Msg 1-0:96.50.1*1(EFR) is of type ManufID2
2021.03.27 10:20:06 5: OBIS (zaehler) - Msg-Parse: 1-0:96.1.0*255(
EFR 0)
2021.03.27 10:20:06 5: OBIS (zaehler) - Msg-Parse: 1-0:1.8.0*255(2682913.6*Wh)
2021.03.27 10:20:06 5: OBIS (zaehler) - Msg 1-0:1.8.0*255(2682913.6*Wh) is of type Counter
2021.03.27 10:20:06 4: OBIS (zaehler) - Set total_consumption to 2682913.6
2021.03.27 10:20:06 5: OBIS (zaehler) - Msg-Parse: 1-0:1.8.1*255(1539811.2*Wh)
2021.03.27 10:20:06 5: OBIS (zaehler) - Msg 1-0:1.8.1*255(1539811.2*Wh) is of type Counter
2021.03.27 10:20:06 4: OBIS (zaehler) - Set total_consumption_Ch1 to 1539811.2
2021.03.27 10:20:06 5: OBIS (zaehler) - Msg-Parse: 1-0:1.8.2*255(1143102.4*Wh)
2021.03.27 10:20:06 5: OBIS (zaehler) - Msg 1-0:1.8.2*255(1143102.4*Wh) is of type Counter
2021.03.27 10:20:06 4: OBIS (zaehler) - Set total_consumption_Ch2 to 1143102.4
2021.03.27 10:20:06 5: OBIS (zaehler) - Msg-Parse: 1-0:2.8.0*255(4278543.8*Wh)
2021.03.27 10:20:06 5: OBIS (zaehler) - Msg 1-0:2.8.0*255(4278543.8*Wh) is of type Counter
2021.03.27 10:20:06 5: OBIS (zaehler) - Msg-Parse: 1-0:2.8.1*255(3558743.2*Wh)
2021.03.27 10:20:06 5: OBIS (zaehler) - Msg 1-0:2.8.1*255(3558743.2*Wh) is of type Counter
2021.03.27 10:20:06 5: OBIS (zaehler) - Msg-Parse: 1-0:2.8.2*255(719800.6*Wh)
2021.03.27 10:20:06 5: OBIS (zaehler) - Msg 1-0:2.8.2*255(719800.6*Wh) is of type Counter
2021.03.27 10:20:06 5: OBIS (zaehler) - Msg-Parse: 1-0:16.7.0*255(830*W)
2021.03.27 10:20:06 5: OBIS (zaehler) - Msg 1-0:16.7.0*255(830*W) is of type Channels
2021.03.27 10:20:06 5: OBIS (zaehler) - Msg-Parse: 255-255:255.255.255*255()
2021.03.27 10:20:06 5: OBIS (zaehler) - Msg-Parse: !
2021.03.27 10:20:06 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:06 5: OBIS (zaehler) - OBIS_Read gave 255
2021.03.27 10:20:06 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:06 5: OBIS (zaehler) - OBIS_Read gave 102
2021.03.27 10:20:07 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:07 5: OBIS (zaehler) - OBIS_Read gave 7
2021.03.27 10:20:07 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:07 5: OBIS (zaehler) - OBIS_Read gave 153
2021.03.27 10:20:08 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:08 5: OBIS (zaehler) - OBIS_Read gave 211
2021.03.27 10:20:08 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:08 5: OBIS (zaehler) - OBIS_Read gave 176
2021.03.27 10:20:09 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:09 5: OBIS (zaehler) - OBIS_Read gave 188
2021.03.27 10:20:09 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:09 5: OBIS (zaehler) - OBIS_Read gave 62
2021.03.27 10:20:09 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:09 5: OBIS (zaehler) - OBIS_Read gave 15
2021.03.27 10:20:09 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:09 5: OBIS (zaehler) - OBIS_Read gave 14
2021.03.27 10:20:09 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:09 5: OBIS (zaehler) - OBIS_Read gave 60
2021.03.27 10:20:09 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:09 5: OBIS (zaehler) - OBIS_Read gave 89
2021.03.27 10:20:09 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:09 5: OBIS (zaehler) - OBIS_Read gave 30
2021.03.27 10:20:09 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:09 5: OBIS (zaehler) - OBIS_Read gave 74
2021.03.27 10:20:09 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:20:09 5: OBIS (zaehler) - OBIS_Read gave 20
2021.03.27 10:20:10 5: SW:


Mit gelöschtem pollingmode und interval kommt folgendes:
021.03.27 10:24:11 3: Opening zaehler device /dev/ttyUSB1
2021.03.27 10:24:11 3: Setting zaehler serial parameters to 9600,8,N,1
2021.03.27 10:24:11 3: OBIS (zaehler) - Init done
2021.03.27 10:24:11 3: zaehler device opened
2021.03.27 10:24:12 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:12 5: OBIS (zaehler) - OBIS_Read gave 6
2021.03.27 10:24:12 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:12 1: /dev/ttyUSB1 disconnected, waiting to reappear (zaehler)
2021.03.27 10:24:12 5: OBIS (zaehler) - OBIS_Read gave null
2021.03.27 10:24:12 3: Setting zaehler serial parameters to 9600,8,N,1
2021.03.27 10:24:12 3: OBIS (zaehler) - Init done
2021.03.27 10:24:12 1: /dev/ttyUSB1 reappeared (zaehler)
2021.03.27 10:24:12 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:12 5: OBIS (zaehler) - OBIS_Read gave 16
2021.03.27 10:24:12 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:12 1: /dev/ttyUSB1 disconnected, waiting to reappear (zaehler)
2021.03.27 10:24:12 5: OBIS (zaehler) - OBIS_Read gave null
2021.03.27 10:24:14 3: Setting zaehler serial parameters to 9600,8,N,1
2021.03.27 10:24:14 3: OBIS (zaehler) - Init done
2021.03.27 10:24:14 1: /dev/ttyUSB1 reappeared (zaehler)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read gave 2
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:14 1: /dev/ttyUSB1 disconnected, waiting to reappear (zaehler)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read gave null
2021.03.27 10:24:14 3: Setting zaehler serial parameters to 9600,8,N,1
2021.03.27 10:24:14 3: OBIS (zaehler) - Init done
2021.03.27 10:24:14 1: /dev/ttyUSB1 reappeared (zaehler)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read gave 3
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:14 1: /dev/ttyUSB1 disconnected, waiting to reappear (zaehler)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read gave null
2021.03.27 10:24:14 3: Setting zaehler serial parameters to 9600,8,N,1
2021.03.27 10:24:14 3: OBIS (zaehler) - Init done
2021.03.27 10:24:14 1: /dev/ttyUSB1 reappeared (zaehler)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read gave 3
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read gave 15
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read gave 15
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:14 1: /dev/ttyUSB1 disconnected, waiting to reappear (zaehler)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read gave null
2021.03.27 10:24:14 3: Setting zaehler serial parameters to 9600,8,N,1
2021.03.27 10:24:14 3: OBIS (zaehler) - Init done
2021.03.27 10:24:14 1: /dev/ttyUSB1 reappeared (zaehler)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read gave 10
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read gave 15
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read gave 15
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:14 1: /dev/ttyUSB1 disconnected, waiting to reappear (zaehler)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read gave null
2021.03.27 10:24:14 3: Setting zaehler serial parameters to 9600,8,N,1
2021.03.27 10:24:14 3: OBIS (zaehler) - Init done
2021.03.27 10:24:14 1: /dev/ttyUSB1 reappeared (zaehler)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read gave 3
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read gave 15
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read gave 15
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:14 1: /dev/ttyUSB1 disconnected, waiting to reappear (zaehler)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read gave null
2021.03.27 10:24:14 3: Setting zaehler serial parameters to 9600,8,N,1
2021.03.27 10:24:14 3: OBIS (zaehler) - Init done
2021.03.27 10:24:14 1: /dev/ttyUSB1 reappeared (zaehler)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read gave 6
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read gave 15
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read gave 15
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:14 1: /dev/ttyUSB1 disconnected, waiting to reappear (zaehler)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read gave null
2021.03.27 10:24:14 3: Setting zaehler serial parameters to 9600,8,N,1
2021.03.27 10:24:14 3: OBIS (zaehler) - Init done
2021.03.27 10:24:14 1: /dev/ttyUSB1 reappeared (zaehler)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read gave 8
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read gave 15
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read gave 15
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:14 1: /dev/ttyUSB1 disconnected, waiting to reappear (zaehler)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read gave null
2021.03.27 10:24:14 3: Setting zaehler serial parameters to 9600,8,N,1
2021.03.27 10:24:14 3: OBIS (zaehler) - Init done
2021.03.27 10:24:14 1: /dev/ttyUSB1 reappeared (zaehler)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read gave 7
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:14 5: OBIS (zaehler) - OBIS_Read gave 2
2021.03.27 10:24:15 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:15 5: OBIS (zaehler) - OBIS_Read gave 10
2021.03.27 10:24:15 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:15 1: /dev/ttyUSB1 disconnected, waiting to reappear (zaehler)
2021.03.27 10:24:15 5: OBIS (zaehler) - OBIS_Read gave null
2021.03.27 10:24:15 3: Setting zaehler serial parameters to 9600,8,N,1
2021.03.27 10:24:15 3: OBIS (zaehler) - Init done
2021.03.27 10:24:15 1: /dev/ttyUSB1 reappeared (zaehler)
2021.03.27 10:24:15 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:15 5: OBIS (zaehler) - OBIS_Read gave 123
2021.03.27 10:24:15 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:15 5: OBIS (zaehler) - OBIS_Read gave 15
2021.03.27 10:24:15 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:15 5: OBIS (zaehler) - OBIS_Read gave 15
2021.03.27 10:24:15 5: OBIS (zaehler) - OBIS_Read called, hash is HASH(0x559c9f968970)
2021.03.27 10:24:15 1: /dev/ttyUSB1 disconnected, waiting to reappear (zaehler)
2021.03.27 10:24:15 5: OBIS (zaehler) - OBIS_Read gave null

gvzdus

Okay. Könntest Du bei gelöschtem Polling-Mode einmal folgendes eingeben:

{ join (" ", map { $_ . "->" . $selectlist{$_}->{FD}} ( keys %selectlist ) ) }

Dabei kommt raus, welche Funktionen auf welchem Filedeskriptor lauschen, und zwar in der Syntax
"Eintrag -> <FileDescriptor>". Mein Verdacht: Du findest 2 Einträge (einer davon bei Dir vermutlich "Zaehler./dev/usb.."), die auf die gleiche Zahl zeigen.

gvzdus

Leckomio! Ich kann's reproduzieren!

Und zwar mit explizitem Polling-Mode off. Dann erhalte ich bei meinem Kommando:

MT175./dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A106Q3OW-if00-port0->107
MT175./dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A106Q3OW-if00-port0@9600,8,N,1->107

Dies führt zum doppelten Read-Aufruf, der dann einen vermeintlichen Fehler liefert. Bis zum Bugfix probier' doch bitte mal:

Attribute interval und pollingMode komplett löschen, Config speichern, "shutdown restart". Dann ist bei mir wieder Ruhe.

Chris46

#1205
Damit kommen wir der Sache wahrscheinlich näher:
zaehler./dev/ttyUSB1->19
zaehler./dev/ttyUSB1@9600,8,N,1->19


ich kann mir allerdings nicht erklären, warum er das ohne Baudrate probiert?

Bei pollmode on sieht es so aus:
zaehler./dev/ttyUSB1->

EDIT: Ah hat sich überschnitten. Probiere ich dann gleich aus. Muss erst mal los. Melde mich heute Nachmittag. Vielen Dank für deine Hilfe.  :)

gvzdus

Jo, siehe mein Posting eins drüber. Probier' bitte mal meinen Workaround oben, jetzt muss ich mich erst mal um die Family kümmern.

Chris46

Es funktioniert!  8) Dabei war ich der festen Meinung, dass ich schon mal ein shutdown restart gemacht hatte, aber ggf. nur mit einem pollingmode off und nicht mit gelöschtem Attribut. Jetzt fliegen die Events nur so rein, durch PV und dem heute minütlich wechselndem Wetter. Dafür muss ich mir noch einen sinnvollen event-aggregator einfallen lassen. ;) Nochmals vielen Dank und ein schönes Wochenende. Falls ich für den Bugfix noch etwas testen soll, dann lass es mich wissen.

gvzdus

event-aggregator power:5:linear:mean

sollte z.B. "richtig" über 5 Sekunden mitteln. Aber die Nachkommastellen nerven :-)
Das Kernproblem habe ich gefixt, aber ich möchte es noch ganz sauber bekommen, mit den Übergängen polling on/off.

gvzdus

Morgen kommt eine neue Version per update - wer schon einmal testen (und HALT schreien möchte), unten hängt sie an.

Vor allem habe ich die Übergänge "pollingMode an / aus" etc. getestet. Neue Regel: "Polling" ist nur, wenn interval und pollMode gesetzt sind, sonst wird dauerhaft gelesen.

@Chris: Du machst wohl das Gleiche wie ich: PV-Überschuss-Steuerung. Es ist so eine Philosophie-Frage: Man könnte mit Mittelwerten über Zeit X arbeiten. Ich arbeite mit Events und Watchdogs: Z.B. wird bei 100 Watt Überschuss sofort ein Dummy "stromplus100" gesetzt, und darauf sitzt dann ein Watchdog, dass nach Zeit x Verbraucher zuschaltet.  Nach Murphy schaltet dann das Laden des E-Autos ein, kurz bevor die nächste Wolke kommt, um Auszuschalten, kurz bevor die nächste Wolke schon fast wieder vorbei ist :-)

hdgucken

#1210
Zitat von: gvzdus am 27 März 2021, 21:01:51
... Nach Murphy schaltet dann das Laden des E-Autos ein, kurz bevor die nächste Wolke kommt, um Auszuschalten, kurz bevor die nächste Wolke schon fast wieder vorbei ist :-)

Für dieses Problem gibt es beim E3DC Hauskraftwerk eine optionale Einstellung:
wenn der PV Überschuss nicht mehr zum laden des Elektrofahrzeugs reicht, wird mit der einstellbaren Mindestladeleistung für eine ebenfalls einstellbare Zeit mit Netzbezug weitergeladen.
Kommt in dieser Zeit kein PV-Überschuss mehr, wird das Laden unterbrochen, bis erneut PV-Überschuss vorhanden ist ;o)

Murphy schlägt aber auch mit dieser Lösung ab und an zu  8)

mfischer-ffb

#1211
Hi,

nach dem aktuellen Update (2021-03-27 19:52:47Z) zeigt mein Zähler keine negativen werte mehr an, vorher ging das problemlos?
Also wenn z.b. L1 -100 W (Pv einspeisung) haben sollte wird nur der Wert 1,8 W bei L1 angezeigt  und auch der Wert power geht nicht auf - ?!?

bzw. vorher war L1 ja  1.0.36.7.0.255  und power_L1 bis power_L3 hatte ich vorher nicht

wäre toll wenn das wieder Klapt.

Danke
Gruß
Markus


gvzdus

Hi Markus,

kriegen wir gefixt.

Du weißt, dass Du unter /opt/fhem/restoreDir/update/<datum>/FHEM/47_OBIS.pm die alte Version für den Rollback findest?

Ich hätte gerne:
a) die alte Versionsnummer
b) ein paar Sekunden auf "verbose 5" aus dem FHEM-Log, die einen negativen Wert liefern (geht vermutlich nur tagsüber :-) ) - konkret brauche ich nur die "Full message-> 1B1B..."-Zeilen

Entweder per Privatnachricht oder hier im Forum.

gvzdus

Markus hat mir die Daten per Pmail zugeschickt.

Mit meinem neuen Parser ist ein Bug beim Parsen von 64bit Integer-Zahlen reingekommen: (1 << 64 ist bei "meinem" und sicherlich vielen anderen Perls 0).

Bugfix ist eingecheckt und morgen ab 8 Uhr live. Ich greife jetzt für 32 und 64-Bit-Zahlen auf unpack zurück (vermutlich eh schneller), bei > 64 Bit kommt eine Warnung, dass Perl hier streikt.

mfischer-ffb

#1214
eben upgedatet...

Perfekt !!! funktioniert wieder Super

Vielen Dank für die schnelle Hilfe

Gruß
Markus