From 19b2ff2d45c57057a90fb3b113f7a0fff3f81ce9 Mon Sep 17 00:00:00 2001 From: gvzdus <> Date: Sun, 5 Nov 2023 14:40:42 +0000 Subject: [PATCH] 47_OBIS: Implement nohacks attribute git-svn-id: https://svn.fhem.de/fhem/trunk@28127 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/47_OBIS.pm | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index a561bcfde..775278155 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - bugfix: 47_OBIS: Implement "nohacks" attribute - bugfix: 36_Shelly: undefinded values on restart - bugfix: 36_Shelly: Refresh: removed fixed name of FHEMWEB device Gen.2: on/off-for-timer diff --git a/fhem/FHEM/47_OBIS.pm b/fhem/FHEM/47_OBIS.pm index 6bfc0d4d9..39760cede 100644 --- a/fhem/FHEM/47_OBIS.pm +++ b/fhem/FHEM/47_OBIS.pm @@ -112,7 +112,7 @@ sub OBIS_Initialize($) $hash->{SetFn} = "OBIS_Set"; $hash->{UndefFn} = "OBIS_Undef"; $hash->{AttrFn} = "OBIS_Attr"; - $hash->{AttrList}= "do_not_notify:1,0 interval offset_feed offset_energy IODev channels directions alignTime pollingMode:on,off extChannels:on,off,auto unitReadings:on,off ignoreUnknown:on,off valueBracket:first,second,both resetAfterNoDataTime createPreValues:on,off httpAuthorization ". + $hash->{AttrList}= "do_not_notify:1,0 interval offset_feed offset_energy IODev channels directions alignTime pollingMode:on,off extChannels:on,off,auto unitReadings:on,off ignoreUnknown:on,off valueBracket:first,second,both resetAfterNoDataTime createPreValues:on,off httpAuthorization nohacks ". $readingFnAttributes; } @@ -500,7 +500,7 @@ sub OBIS_Parse_List } my $line = $result[0] . "(" . $result[5] . ($result[3] eq "" ? "" : "*".$result[3]) . ")\r\n"; if ($line=~/^1-0:96\.50\.1\*.*\((DZG|HLY)/) { - $hash->{helper}{$1 . "HACK"} = 1; + $hash->{helper}{$1 . "HACK"} = ! defined $hash->{helper}{NOHACKS}; } $_[1] .= $line; return undef; @@ -890,6 +890,9 @@ Log3 $name, 3, "OBIS ($name) - Attr $aName Val $aVal, dopoll = $dopoll"; if ($aVal!~/^\w+:.*$/); $hash->{helper}{HTTPAUTH} = "Authorization: Basic " . encode_base64($aVal); } + if ($aName eq "nohacks") { + $hash->{helper}{NOHACKS} = $aVal; + } } return undef; } @@ -1061,11 +1064,16 @@ sub OBIS_CRC16($$) { resetAfterNoDataTime
If on a TCP-connection no data was received for the given time, the connection is closed and reopened - +
  • httpAuthorization
    If the SML data is fetched by HTTP (Usecase: e.g. Tibber Pulse), this attribute is used to authenticate the HTTP-request. The format must be :, e.g. for Tibber Pulse something like "admin:" +
  • + nohacks
    + For DZG- and HOLY-Meters a workaround was implemented to avoid certain bugs in encoding. + Latest DZG meters seem to have fixed the bug. By setting "nohacks" to "1", the workarounds are disabled. +

  • @@ -1158,6 +1166,11 @@ sub OBIS_CRC16($$) { Werden die SML-Daten per HTTP abgefragt (Usecase: Tibber Pulse z.B.), wird hiermit die Authentifizierung für den HTTP-Request gesetzt. Das Format muss : sein, also für den Tibber Pulse i.d.R. "admin:" +
  • + nohacks
    + Für DZG- und HOLY-Zähler wurden jeweils Workarounds für Bugs im SML-Encoding implementiert. + Für neue DZG-Zähler scheint der Bug behoben zu sein. Mit "nohacks" auf "1" werden die Workarounds + abgeschaltet.