From 9d4dc0c0c51664ed550347e168be5eb02d228bc0 Mon Sep 17 00:00:00 2001
From: kaihs <>
Date: Mon, 30 Dec 2024 15:58:31 +0000
Subject: [PATCH] WMBus.pm: support for smoke detector IE6500-OMS

git-svn-id: https://svn.fhem.de/fhem/trunk@29463 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
 fhem/CHANGED       |  1 +
 fhem/FHEM/WMBus.pm | 24 +++++++++++++++++++++++-
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/fhem/CHANGED b/fhem/CHANGED
index e2beba6a5..f4c58c595 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
+ - feature: WMBus.pm: support for smoke detector IE6500-OMS: #1326558
  - change:  76_SolarForecast: more preparation for multi batteries
  - change:  70_PylonLowVoltage: internal code change (use random time delay)
  - feature: 76_SolarForecast: change Attr setupBatteryDev to setupBatteryDev01, 
diff --git a/fhem/FHEM/WMBus.pm b/fhem/FHEM/WMBus.pm
index 450c9aba4..66eaddc1c 100644
--- a/fhem/FHEM/WMBus.pm
+++ b/fhem/FHEM/WMBus.pm
@@ -724,7 +724,23 @@ my %VIFInfo_FD = (
     unit         => '',
     calcFunc     => \&valueCalcNumeric,
   },
-  VIF_SPECIAL_SUPPLIER_INFORMATION => {     #  Special supplier information
+  VIF_DURATION_IN_MINUTES => {            # DURATION_IN_MINUTES information
+    typeMask     => 0b01111111,
+    expMask      => 0b00000000,
+    type         => 0b00110001,
+    bias         => 0,
+    unit         => 'minutes',
+    calcFunc     => \&valueCalcNumeric,
+  },
+  VIF_CUMULATION_COUNTER => {             #  Cumulated Value
+    typeMask     => 0b01111111,
+    expMask      => 0b00000000,
+    type         => 0b01100001,
+    bias         => 0,
+    unit         => '',
+    calcFunc     => \&valueCalcNumeric,
+  },
+  VIF_SPECIAL_SUPPLIER_INFORMATION => {   #  Special supplier information
     typeMask     => 0b01111111,
     expMask      => 0b00000000,
     type         => 0b01100111,
@@ -1451,6 +1467,12 @@ sub decodeValueInformationBlock($$$) {
         # Kamstrup
         $vif = unpack('C', substr($vib,$offset++,1));
         $vifInfoRef = \%VIFInfo_KAM;       
+      } elsif ($self->{manufacturer} eq 'EIE') {
+        # EIE
+	$offset++; # Ignore next byte
+        $dataBlockRef->{type} = VIF_TYPE_MANUFACTURER_SPECIFIC;
+        $dataBlockRef->{unit} = "";
+        $analyzeVIF = 0;
       } else {
         # manufacturer specific data, can't be interpreted