From 0efdd771844b9d840d3db6018971bb03cb0a0d60 Mon Sep 17 00:00:00 2001 From: delmar <> Date: Sun, 9 Jan 2022 12:37:31 +0000 Subject: [PATCH] 71_COE_Node: fix for negative temparatures by thor3 git-svn-id: https://svn.fhem.de/fhem/trunk@25442 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/71_COE_Node.pm | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/fhem/CHANGED b/fhem/CHANGED index 78ee0c24e..d903ccf0d 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: 71_COE_Node: fix for negative temparatures by thor3 - bugfix: 47_OBIS: remove control characters in strings - feature: 10_KNX: KNX_scan Utility function - bugfix: 82_LGTV_WebOS: rewrite and change code, fix bugs of older version diff --git a/fhem/FHEM/71_COE_Node.pm b/fhem/FHEM/71_COE_Node.pm index d2e4d20d0..0361749f2 100644 --- a/fhem/FHEM/71_COE_Node.pm +++ b/fhem/FHEM/71_COE_Node.pm @@ -167,6 +167,7 @@ sub COE_Node_HandleAnalogValues { my $existingConfig = exists $readingsMapping[$entryId]; my $value = $values[$i]; my $type = $types[$i]; + my $vorz = (substr $value, 0,1); if ($existingConfig) { @@ -176,6 +177,9 @@ sub COE_Node_HandleAnalogValues { $value = (substr $value, 0, (length $value)-2) . "." . (substr $value, -2); } + if ( COE_Node_BeginsWith($value, '-.') ) { + $value = "-0." . (substr $value, 2, (length $value)); + } if ( COE_Node_BeginsWith($value, '.') ) { $value = "0$value"; }