Doif oder if else finde den fehler im code nicht

Begonnen von Ascoban, 25 Februar 2017, 15:49:30

Vorheriges Thema - Nächstes Thema

Ascoban

Hallo im Log steht:

PERL WARNING: Use of uninitialized value in numeric lt (<) at (eval 5105) line 1.

Meine definition sieht so aus:


([GrowBoxDHT22:Tempature]< 27 and [GrowBoxDHT22:Humidty]< 60) (set Abluft off) DOELSE (set Abluft on)

Oder ich versuche das mit einem notify und bekomme dann auch eine Fehler meldung aber das notify wird ausgeführt.

GrowBoxDHT22:Humidity:.* {
   my $hum = ReadingsVal("GrowBoxDHT22","Humidity","0");;
   my $temp = ReadingsVal("GrowBoxDHT22","Temperature","0");;
   if ($hum < 40, $temp < 20) {
         fhem("set Abluft off");;}
   else {
         fhem(" set Abluft on");;}

  }

2017.02.25 16:02:13 1: PERL WARNING: Useless use of numeric lt (<) in void context at (eval 6093) line 7.
2017.02.25 16:02:13 3: eval: my $EVENT='Humidity: 46.3';my $NAME='GrowBoxDHT22';my $EVTPART1='46.3';my $EVTPART0='Humidity:';my $SELF='Abluft_N';my $TYPE='ESPEasy';{
   my $hum = ReadingsVal("GrowBoxDHT22","Humidity","0");;
   my $temp = ReadingsVal("GrowBoxDHT22","Temperature","0");;
   if ($hum < 40, $temp < 20) {
         fhem("set Abluft off");;}
   else {
         fhem(" set Abluft on");;}



hckoe

# CT mit Debian Buster / FHEM aktuell / EnOcean TCM310 / Eltako FSA12, FUD12NPN, FSB12, FRW, FSRP-230V
# Permundo PCS234, Nodon NO-SIN-2-2-00, GTAGS

CoolTux

Und beim Notify nimmst Du ReadingsNum statt ReadingsVal.
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

Ascoban