-
-
Save anonymous/e6e9eb2f1617da3f02b2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main; | |
use strict; | |
use warnings; | |
sub onTimer($) { | |
# Purpose: Hilfsfunktion um Timerereignisse zu steuern | |
# Author : Dennis Gnoyke | |
# Date : 30.09.2012 | |
# Changes: --- | |
# Remarks: | |
# $_[0] = eine Zahl | |
# | |
if ($_[0] eq 1) { | |
#Lueften(,,) | |
Lueften("TS34C_Misc","AR_Lueften","55"); | |
#Platz für weitere Räume ... | |
} elsif ($_[0] eq 2) { | |
#irgendetwas anderes | |
} | |
} | |
sub Lueften($$$) { | |
# Purpose: Ermitteln ob gelüftet werden soll oder nicht | |
# Author : Dennis Gnoyke | |
# Date : 30.09.2012 | |
# Changes: --- | |
# Remarks: | |
# $_[0] = Innensensor mit Reading "Fan" | |
# $_[1] = dummy device | |
# $_[2] = Grenzwert Luftfeuchte | |
if (ReadingsVal($_[0],"fan","off") eq "on") { | |
if (ReadingsVal($_[0] ,"humidity",100) >= $_[2]) { | |
if (ReadingsVal($_[1],"state","NEIN") ne "JA") { | |
fhem("set $_[1] JA"); | |
} | |
} else { | |
if (ReadingsVal($_[1],"state","NEIN") ne "EGAL") { | |
fhem("set $_[1] EGAL"); | |
} | |
} | |
} else { | |
if (ReadingsVal($_[1],"state","JA") ne "NEIN") { | |
fhem("set $_[1] NEIN"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment