2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-04 05:16:45 +00:00

MAX: various changes by J. Isleib

git-svn-id: https://svn.fhem.de/fhem/trunk@4156 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
mgehre 2013-11-05 23:03:16 +00:00
parent de30a1332b
commit ebcc7dff26

View File

@ -2,6 +2,8 @@
# $Id$ # $Id$
# Written by Matthias Gehre, M.Gehre@gmx.de, 2012-2013 # Written by Matthias Gehre, M.Gehre@gmx.de, 2012-2013
# #
# Dutycycle included by J. Isleib 2013-09-26
#
package main; package main;
use v5.10.1; use v5.10.1;
@ -572,7 +574,7 @@ MAX_Parse($$)
my $devicetype = undef; my $devicetype = undef;
$devicetype = $args[0] if($msgtype eq "define"); $devicetype = $args[0] if($msgtype eq "define");
$devicetype = "ShutterContact" if($msgtype eq "ShutterContactState"); $devicetype = "ShutterContact" if($msgtype eq "ShutterContactState");
$devicetype = "Cube" if($msgtype eq "CubeClockState" or $msgtype eq "CubeConnectionState"); $devicetype = "Cube" if($msgtype eq "CubeClockState" or $msgtype eq "CubeConnectionState" or $msgtype eq "CubeDutyCycleState");
$devicetype = "WallMountedThermostat" if(grep /^$msgtype$/, ("WallThermostatConfig","WallThermostatState","WallThermostatControl")); $devicetype = "WallMountedThermostat" if(grep /^$msgtype$/, ("WallThermostatConfig","WallThermostatState","WallThermostatControl"));
$devicetype = "HeatingThermostat" if(grep /^$msgtype$/, ("HeatingThermostatConfig", "ThermostatState")); $devicetype = "HeatingThermostat" if(grep /^$msgtype$/, ("HeatingThermostatConfig", "ThermostatState"));
if($devicetype) { if($devicetype) {
@ -643,11 +645,11 @@ MAX_Parse($$)
readingsBulkUpdate($shash, "desiredTemperature", MAX_SerializeTemperature($desiredTemperature)) if($desiredTemperature != 0); readingsBulkUpdate($shash, "desiredTemperature", MAX_SerializeTemperature($desiredTemperature)) if($desiredTemperature != 0);
if($measuredTemperature ne "") { if($measuredTemperature ne "") {
readingsBulkUpdate($shash, "temperature", MAX_SerializeTemperature($measuredTemperature)); readingsBulkUpdate($shash, "temperature", MAX_SerializeTemperature($measuredTemperature));
if($shash->{type} =~ /HeatingThermostatPlus/ and $hash->{TYPE} eq "MAXLAN") { }
readingsBulkUpdate($shash, "valveposition", int($valveposition*MAX_ReadingsVal($shash,"maxValveSetting")/100)); if($shash->{type} =~ /HeatingThermostatPlus/ and $hash->{TYPE} eq "MAXLAN") {
} else { readingsBulkUpdate($shash, "valveposition", int($valveposition*MAX_ReadingsVal($shash,"maxValveSetting")/100));
readingsBulkUpdate($shash, "valveposition", $valveposition); } else {
} readingsBulkUpdate($shash, "valveposition", $valveposition);
} }
}elsif(grep /^$msgtype$/, ("WallThermostatState", "WallThermostatControl" )){ }elsif(grep /^$msgtype$/, ("WallThermostatState", "WallThermostatControl" )){
@ -721,6 +723,7 @@ MAX_Parse($$)
readingsBulkUpdate($shash, "battery", $batterylow ? "low" : "ok"); readingsBulkUpdate($shash, "battery", $batterylow ? "low" : "ok");
readingsBulkUpdate($shash, "onoff", $onoff); readingsBulkUpdate($shash, "onoff", $onoff);
readingsBulkUpdate($shash, "connection", $gateway);
}elsif($msgtype eq "CubeClockState"){ }elsif($msgtype eq "CubeClockState"){
my $clockset = $args[0]; my $clockset = $args[0];
@ -731,6 +734,10 @@ MAX_Parse($$)
readingsBulkUpdate($shash, "connection", $connected); readingsBulkUpdate($shash, "connection", $connected);
} elsif($msgtype eq "CubeDutyCycleState") {
my $dutycycle = $args[0];
readingsBulkUpdate($shash, "dutycycle", $dutycycle);
} elsif(grep /^$msgtype$/, ("HeatingThermostatConfig", "WallThermostatConfig")) { } elsif(grep /^$msgtype$/, ("HeatingThermostatConfig", "WallThermostatConfig")) {
readingsBulkUpdate($shash, "ecoTemperature", MAX_SerializeTemperature($args[0])); readingsBulkUpdate($shash, "ecoTemperature", MAX_SerializeTemperature($args[0]));
readingsBulkUpdate($shash, "comfortTemperature", MAX_SerializeTemperature($args[1])); readingsBulkUpdate($shash, "comfortTemperature", MAX_SerializeTemperature($args[1]));