From dc5fa7e4a79ef4b9ed20115765ef120dd738b638 Mon Sep 17 00:00:00 2001 From: MarkusF <> Date: Mon, 8 Oct 2018 18:07:46 +0000 Subject: [PATCH] 51_MOBILEALERTS: Bugfix temperature MA10120PRO git-svn-id: https://svn.fhem.de/fhem/trunk@17494 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/51_MOBILEALERTS.pm | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index ba792f8d9..2a46debd7 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: 51_MOBILEALERTS: Fix temperature for MA10320PRO - change: 93_DbLog, 93_DbRep: minor fix time until DB is closed - change: 38_netatmo: changed weathermap calls to new endpoints - feature: 5.9 released diff --git a/fhem/FHEM/51_MOBILEALERTS.pm b/fhem/FHEM/51_MOBILEALERTS.pm index d4df7edba..0140bb7af 100644 --- a/fhem/FHEM/51_MOBILEALERTS.pm +++ b/fhem/FHEM/51_MOBILEALERTS.pm @@ -1015,12 +1015,15 @@ sub MOBILEALERTS_decodeTemperature($) { #Illegal value return -9999 if ( ( $temperature & 0x1000 ) == 0x1000 ); + #Clear flags + $temperature &= 0x7ff; + #Negativ Values - return ( 0x800 - ( $temperature & 0x7ff ) ) * -0.1 - if ( ( $temperature & 0x400 ) == 0x400 ); + return ( 0x800 - $temperature ) * -0.1 + if ( $temperature > 1100 ); #Positiv Values - return ( $temperature & 0x7ff ) * 0.1; + return $temperature * 0.1; } sub MOBILEALERTS_temperatureToString($) {