From abea562610e4de1f3a2c35c3571cac9e4f825af2 Mon Sep 17 00:00:00 2001 From: sidey79 Date: Tue, 12 Sep 2023 19:59:34 +0000 Subject: [PATCH] SD_Protocols.pm: Updated to v2.0.7 SD_ProtocolData.pm: Updated to v1.53 new protocols and sensors git-svn-id: https://svn.fhem.de/fhem/trunk@27949 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 5 + fhem/FHEM/lib/SD_ProtocolData.pm | 180 ++++++++++++++++++++++++++++++- fhem/FHEM/lib/SD_Protocols.pm | 42 +++++++- 3 files changed, 221 insertions(+), 6 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index acb45f4ab..2e46738cd 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,10 @@ # 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: SD_ProtocolData.pm: Protocol 122 for Temola TM 40 thermometer + Protocol 119 Basic funkbus suppors + Protocol 85 new sensor TFA 30.3251.10 + new definition 20.1 + - feature: SD_Protocols.pm: Updated to version 2.0.7 - change: 10_KNX: multiple changes, new features, see Forum #122582 - bugfix: 48_MieleAtHome: fix warning - feature: configDB.pm: show version counter in "configDB saved. (xx)" diff --git a/fhem/FHEM/lib/SD_ProtocolData.pm b/fhem/FHEM/lib/SD_ProtocolData.pm index d889aea43..39dc7021c 100644 --- a/fhem/FHEM/lib/SD_ProtocolData.pm +++ b/fhem/FHEM/lib/SD_ProtocolData.pm @@ -3,7 +3,7 @@ # All protocol definitions are contained in this file. # # 2016-2019 S.Butzek, Ralf9 -# 2019-2020 S.Butzek, HomeAutoUser, elektron-bbs +# 2019-2023 S.Butzek, HomeAutoUser, elektron-bbs # # !!! useful hints !!! # -------------------- @@ -68,9 +68,9 @@ # sync => ' ' # sync parameter of signal in hex (example, 2DD4) # ##### notice #### or #### info ############################################################################################################ -# !!! Between the keys and values ​​no tabs, please use spaces !!! +# !!! Between the keys and values no tabs, please use spaces !!! # !!! Please use first unused id for new protocols !!! -# ID´s are currently unused: 124 - +# ID´s are currently unused: 130 - # ID´s need to be revised (preamble u): 5|19|21|22|23|25|28|31|36|40|52|59|63 ########################################################################################################################################### # Please provide at least three messages for each new MU/MC/MS/MN protocol and a URL of issue in GitHub or discussion in FHEM Forum @@ -85,8 +85,7 @@ package lib::SD_ProtocolData; use strict; use warnings; - our $VERSION = '1.48'; - + our $VERSION = '1.53'; our %protocols = ( "0" => ## various weather sensors (500 | 9100) # Mebus | Id:237 Ch:1 T: 1.9 Bat:low MS;P0=-9298;P1=495;P2=-1980;P3=-4239;D=1012121312131313121313121312121212121212131212131312131212;CP=1;SP=0;R=223;O;m2; @@ -3278,6 +3277,177 @@ package lib::SD_ProtocolData; length_min => '104', length_max => '108', }, + "123" => ## Inkbird IBS-P01R Pool Thermometer, Inkbird ITH-20R (not tested) + # https://forum.fhem.de/index.php/topic,128945.0.html 2022-08-28 @ xeenon + # SD_WS_123_T_0655 T: 25 MN;D=D3910F800301005A0655FA001405140535F6;R=10; + # SD_WS_123_T_7E43 T: 25.4 H: 60 MN;D=D3910F00010301207E43FE0014055802772A;R=232; + { + name => 'IBS-P01R', + comment => 'Inkbird IBS-P01R pool phermometer, ITH-20R', + id => '123', + knownFreqs => '433.92', + datarate => '10.000', + sync => '2DD4', + modulation => '2-FSK', + regexMatch => qr/^D391/, + preamble => 'W123#', + register => ['0001','022E','0344','042D','05D4','0612','07C0','0800','0D10','0EB0','0F71','10C8','1193','1202','1322','14F8','1534','1916','1B43','1C48'], + rfmode => 'Inkbird_IBS-P01R', + clientmodule => 'SD_WS', + length_min => '36', + }, + + # "124" reserved for => ## Remote control CasaFan FB-FNK Powerboat with 5 buttons for fan + + "125" => ## Humidity and Temperaturesensor Ecowitt WH31, froggit DP50 / WH31A + # Nordamerika: 915MHz; Europa: 868MHz, andere Regionen: 433MHz + # https://github.com/RFD-FHEM/RFFHEM/pull/1161 @ sidey79 2023-04-01 + # SD_WS_125_TH_1 T: 21.0 H: 55 Battery: ok channel:1 MN;D=300282623704516C000200;R=56; + # SD_WS_125_TH_1 T: 16.7 H: 60 Battery: ok channel:2 MN;D=300292373CDA116C000200;R=229; + # SD_WS_125_TH_3 T: 5.4 H: 52 Battery: ok channel:3 MN;D=30E0A1C634FEA96C000200;R=197; + + { + name => 'WH31', + comment => 'Fine Offset | Ambient Weather WH31E Thermo-Hygrometer Sensor', + id => '125', + knownFreqs => '868.35', + datarate => '17.257', + sync => '2DD4', + modulation => '2-FSK', + regexMatch => qr/^(30|37)/, + preamble => 'W125#', + register => ['0001','022E','0343','042D','05D4','060b','0780','0800','0D21','0E65','0FE8','10A9','115C','1202','1322','14F8','1543','1916','1B43','1C68'], + rfmode => 'Fine_Offset_WH31_868', + clientmodule => 'SD_WS', + length_min => '18', + }, + "126" => ## Humidity and Temperaturesensor Ecowitt WH40, + # https://github.com/RFD-FHEM/RFFHEM/pull/1164 + # SD_WS_126 R: 0 MN;D=40011CDF8F0000976220A6802801;R=61; 14 byte ID 11CDF + # SD_WS_126 R: 0 MN;D=40013E3C900000105BA02A;R=61; 11 byte ID 13E3c + # SD_WS_126 R: 9 MN;D=40013E3C90005AB55AA0A0800408;R=61; 14 Byte ID 13E3c + { + name => 'WH40', + comment => 'Fine Offset | Ambient Weather WH40 rain gauge', + id => '125', + knownFreqs => '868.35', + datarate => '17.257', + sync => '2DD4', + modulation => '2-FSK', + regexMatch => qr/^40/, + preamble => 'W126#', + register => ['0001','022E','0343','042D','05D4','060e','0780','0800','0D21','0E65','0FE8','10A9','115C','1202','1322','14F8','1543','1916','1B43','1C68'], + rfmode => 'Fine_Offset_WH40_868', + clientmodule => 'SD_WS', + length_min => '22', + length_max => '28', + }, + "127" => ## Remote control with 14 buttons for ceiling fan + # https://forum.fhem.de/index.php?topic=134121.0 @ Kai-Alfonso 2023-06-29 + # RCnoName127_3603A fan_off MU;P0=5271;P1=-379;P2=1096;P3=368;P4=-1108;P5=-5997;D=01213434213434212121212121213434342134212121343421343434212521213434213434212121212121213434342134212121343421343434212521213434213434212121212121213434342134212121343421343434212521213434213434212121212121213434342134212121343421343434212;CP=3;R=63; + # Message is output by SIGNALduino as MU if the last bit is a 0. + { + name => 'RCnoName127', + comment => 'Remote control with 14 buttons for ceiling fan', + id => '127', + knownFreqs => '433.92', + one => [1,-3], # 370,-1110 + zero => [3,-1], # 1110, -370 + start => [-15], # -5550 (MU) + reconstructBit => '1', + clockabs => '370', + format => 'twostate', + preamble => 'P127#', + clientmodule => 'SD_UT', + modulematch => '^P127#', + length_min => '29', + length_max => '30', + }, + "127.1" => ## Remote control with 14 buttons for ceiling fan + # https://forum.fhem.de/index.php?topic=134121.0 @ Kai-Alfonso 2023-06-29 + # RCnoName127_3603A fan_1 MS;P1=-385;P2=1098;P3=372;P4=-1108;P5=-6710;D=352121343421343421212121212121343434213421212121213421343434;CP=3;SP=5;R=79;m2; + # RCnoName127_3603A light_on_off MS;P1=-372;P2=1098;P3=376;P4=-1096;P5=-6712;D=352121343421343421212121212121343434213421342134212134213421;CP=3;SP=5;R=73;m2; + # Message is output by SIGNALduino as MS if the last bit is a 1. + { + name => 'RCnoName127', + comment => 'Remote control with 14 buttons for ceiling fan', + id => '127.1', + knownFreqs => '433.92', + one => [1,-3], # 370,-1110 + zero => [3,-1], # 1110, -370 + sync => [1,-18], # 370,-6660 (MS) + clockabs => '370', + format => 'twostate', + preamble => 'P127#', + clientmodule => 'SD_UT', + modulematch => '^P127#', + length_min => '29', + length_max => '30', + }, + "128" => ## Remote control with 12 buttons for ceiling fan + # https://forum.fhem.de/index.php?msg=1281573 @ romakrau 2023-07-14 + # RCnoName128_8A7F fan_slower MU;P0=-420;P1=1207;P2=-1199;P3=424;P4=-10154;D=010101230123010123232323232323232323230123010143230101012301230101232323232323232323232301230101432301010123012301012323232323232323232323012301014323010101230123010123232323232323232323230123010143230101012301230101232323232323232323232301230101;CP=3;R=18; + # Message is output by SIGNALduino as MU if the last bit is a 0. + { + name => 'RCnoName128', + comment => 'Remote control with 12 buttons for ceiling fan', + id => '128', + knownFreqs => '433.92', + one => [-3,1], # -1218,406 + zero => [-1,3], # -406,1218 + start => [-25,1], # -10150,406 (MU) + clockabs => '406', + format => 'twostate', + preamble => 'P128#', + clientmodule => 'SD_UT', + modulematch => '^P128#', + length_min => '23', + length_max => '24', + }, + "128.1" => ## Remote control with 12 buttons for ceiling fan + # https://forum.fhem.de/index.php?msg=1281573 @ romakrau 2023-07-14 + # RCnoName128_8A7F fan_on_off MS;P2=-424;P3=432;P4=1201;P5=-1197;P6=-10133;D=36353242424532453242453535353535353535353532453535;CP=3;SP=6;R=36;m1; + # RCnoName128_8A7F fan_direction MS;P0=-10144;P4=434;P5=-415;P6=1215;P7=-1181;D=40474565656745674565674747474747474747474745656567;CP=4;SP=0;R=37;m2; + # Message is output by SIGNALduino as MS if the last bit is a 1. + { + name => 'RCnoName128', + comment => 'Remote control with 12 buttons for ceiling fan', + id => '128.1', + knownFreqs => '433.92', + one => [-3,1], # -1218,406 + zero => [-1,3], # -406,1218 + sync => [-25,1], # -10150,406 (MS) + reconstructBit => '1', + clockabs => '406', + format => 'twostate', + preamble => 'P128#', + clientmodule => 'SD_UT', + modulematch => '^P128#', + length_min => '23', + length_max => '24', + }, + "129" => ## Sainlogic FT-0835 + # https://forum.fhem.de/index.php?topic=134381.0 @ Tueftler1983 2023-07-23 + # SD_WS_129_0E T: 27.6 H: 36 W: 0.2 R: 0 MC;LL=-987;LH=970;SL=-506;SH=473;D=002B3F1FFDFCE4FFFF7B3FDB000404F9;C=489;L=128;R=60; + # SD_WS_129_0E T: 17.7 H: 70 W: 0.4 R: 0 MC;LL=-963;LH=986;SL=-491;SH=491;D=002B3F1BFBF8EDFFFF7BF0B900040413;C=488;L=128;R=92; + # https://forum.fhem.de/index.php?msg=1283414 @ Nighthawk 2023-08-05 + # SD_WS_129_BD T: 18.4 H: 90 W: 1.3 R: 1536.6 B: 115105 MC;LL=-1036;LH=918;SL=-533;SH=435;D=002B3427F2EE58C3F97BE4A53E5EB79B;C=486;L=128;R=212; + # SD_WS_129_BD T: 17.6 H: 82 W: 1.5 R: 1537.2 B: 591 MC;LL=-983;LH=962;SL=-487;SH=488;D=002B3427F0EB0BC3F3FBF3ADFDB0FA87;C=486;L=128;R=219; + { + name => 'FT-0835', + comment => 'Sainlogic weather stations', + id => '129', + knownFreqs => '433.92', + clockrange => [450,550], + format => 'manchester', + clientmodule => 'SD_WS', + modulematch => '^W129#FF.*', + preamble => 'W129#', + length_min => '128', + length_max => '128', + polarity => 'invert', + method => \&lib::SD_Protocols::mcBit2Sainlogic, # Call to process this message + }, ######################################################################## #### ### register informations from other hardware protocols #### #### diff --git a/fhem/FHEM/lib/SD_Protocols.pm b/fhem/FHEM/lib/SD_Protocols.pm index 68e4115f8..b08e80e3b 100644 --- a/fhem/FHEM/lib/SD_Protocols.pm +++ b/fhem/FHEM/lib/SD_Protocols.pm @@ -16,7 +16,7 @@ use Carp qw(croak carp); use constant HAS_DigestCRC => defined eval { require Digest::CRC; }; use constant HAS_JSON => defined eval { require JSON; }; -our $VERSION = '2.06'; +our $VERSION = '2.07'; use Storable qw(dclone); use Scalar::Util qw(blessed); @@ -543,6 +543,46 @@ sub MCRAW { return(1,binStr2hexStr($bitData)); } +=item mcBit2Sainlogic() + +This function checks the Manchester signals from a Sainlogic weather sensor. +It will check for length_max, length_min and return a hex string + +Input: $object,$name,$bitData,$id,$mcbitnum +Output: + array (1,hex string) + or array (-1,"Error message") + +=cut + +sub mcBit2Sainlogic { + my ( $self, $name, $bitData, $id, $mcbitnum ) = @_; + $self // carp 'Not called within an object'; + + $self->_logging( "$name: lib/mcBit2Sainlogic, protocol $id, lenght $mcbitnum", 5 ); + $self->_logging( "$name: lib/mcBit2Sainlogic, $bitData", 5 ); + + return (-1,' message is to long') if ($mcbitnum > $self->checkProperty($id,"length_max",0) ); + + if ($mcbitnum < 128) { + my $start = index($bitData, '010100'); + $self->_logging( "$name: lib/mcBit2Sainlogic, protocol $id, start found at pos $start", 5 ); + if ($start < 0 || $start > 10) { + $self->_logging( "$name: lib/mcBit2Sainlogic, protocol $id, start 010100 not found", 4 ); + return (-1, "$name: lib/mcBit2Sainlogic, start 010100 not found"); + } + while($start < 10) { + $bitData = q[1] . $bitData; + $start = index($bitData, '010100'); + } + $bitData = substr($bitData, 0, 128); + $mcbitnum = length($bitData); + } + $self->_logging( "$name: lib/mcBit2Sainlogic, $bitData", 5 ); + return (-1,' message is to short') if ($mcbitnum < $self->checkProperty($id,"length_min",0) ); + return(1,binStr2hexStr($bitData)); +} + ############################# package lib::SD_Protocols =item registerLogCallback()