From b58456e69f3bbf64c4c02d2c9c1aa6a6fd9fc4ab Mon Sep 17 00:00:00 2001 From: mgehre <> Date: Wed, 13 Feb 2013 23:35:10 +0000 Subject: [PATCH] MAX: Parse WallThermostatState/Control messages git-svn-id: https://svn.fhem.de/fhem/trunk@2723 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/10_MAX.pm | 14 +++++++------- fhem/FHEM/14_CUL_MAX.pm | 2 +- fhem/FHEM/MaxCommon.pm | 4 +++- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/fhem/FHEM/10_MAX.pm b/fhem/FHEM/10_MAX.pm index d709dc5a7..9ae3af3c9 100755 --- a/fhem/FHEM/10_MAX.pm +++ b/fhem/FHEM/10_MAX.pm @@ -357,7 +357,7 @@ MAX_Set($@) my $arg1 = (($arg2&0x100)>>1) | (int(2*$args[1])&0x7F); $arg2 &= 0xFF; #only take the lower 8 bits - return ($hash->{IODev}{Send})->($hash->{IODev},"WallThermostatState",$dest, + return ($hash->{IODev}{Send})->($hash->{IODev},"WallThermostatControl",$dest, sprintf("%02x%02x",$arg1,$arg2),"04",undef,undef,$hash->{addr}); } else { return "fake does not work for device type $hash->{type}"; @@ -498,7 +498,7 @@ MAX_Parse($$) $devicetype = $args[0] if($msgtype eq "define"); $devicetype = "ShutterContact" if($msgtype eq "ShutterContactState"); $devicetype = "Cube" if($msgtype eq "CubeClockState" or $msgtype eq "CubeConnectionState"); - $devicetype = "WallMountedThermostat" if($msgtype ~~ ["WallThermostatConfig","WallThermostatState"]); + $devicetype = "WallMountedThermostat" if($msgtype ~~ ["WallThermostatConfig","WallThermostatState","WallThermostatControl"]); $devicetype = "HeatingThermostat" if($msgtype ~~ ["HeatingThermostatConfig", "ThermostatState"]); if($devicetype) { return "UNDEFINED MAX_$addr MAX $devicetype $addr"; @@ -567,12 +567,12 @@ MAX_Parse($$) readingsBulkUpdate($shash, "temperature", sprintf("%2.1f",$measuredTemperature)); } - }elsif($msgtype eq "WallThermostatState"){ + }elsif($msgtype ~~ ["WallThermostatState", "WallThermostatControl" ]){ my ($bits2,$displayActualTemperature,$desiredTemperature,$null1,$heaterTemperature,$null2,$temperature); - if( length($args[0]) == 4 ) { + if( length($args[0]) == 4 ) { #WallThermostatControl #This is the message that WallMountedThermostats send to paired HeatingThermostats ($desiredTemperature,$temperature) = unpack("CC",pack("H*",$args[0])); - } elsif( length($args[0]) == 6 or length($args[0]) == 14 or length($args[0]) == 12) { + } elsif( length($args[0]) == 6 or length($args[0]) == 14 or length($args[0]) == 12) { #WallThermostatState #len=14: This is the message we get from the Cube over MAXLAN and which is probably send by WallMountedThermostats to the Cube #len=12: Payload of an Ack message, last field "temperature" is missing #len=6 : Payload of an Ack message, last four fields (especially $heaterTemperature and $temperature) are missing @@ -593,7 +593,7 @@ MAX_Parse($$) readingsBulkUpdate($shash, "battery", $batterylow ? "low" : "ok"); readingsBulkUpdate($shash, "displayActualTemperature", ($displayActualTemperature) ? 1 : 0); } else { - Log 2, "Invalid WallThermostatState packet" + Log 2, "Invalid $msgtype packet" } $desiredTemperature = ($desiredTemperature &0x7F)/2.0; #convert to degree celcius @@ -803,7 +803,7 @@ MAX_Parse($$)
set MAX_12345 weekProfile Fri 24.5,6:00,12,15:00,5 Sat 7,4:30,19,12:55,6