wenn ich Udo in seinen diversen antworten und Erklärungen richtig verstanden habe, ist ein val in der Laufzeit nicht mehr zu ändern.
nur wo muss ein var deklariert werden?
in der Rule oder global wenn dort if's sind?
Code: Alles auswählen
then
if (Garagen_Tor_unten.state == ON ){
Garage_AUF_ZU.postUpdate ("0")
}
if (Garage_Automatic.state == OFF) {
val val_garage_zu = "Garage wurde mmanuell geschlossen,"
} else {
val val_garage_zu = "Garage wurde automatisch geschlossen,"
}
if (GA_DL_on_of.state==ON) {
var val_garage_licht = " Licht ist an."
d_Garage_Statussmeldung.sendCommand("Garagentor zu, Licht ist noch an!")
} else {
d_Garage_Statussmeldung.sendCommand("Das Garagentor ist zu!")
var val_garage_licht = " Licht ist aus."
logInfo("d_Garage", val_garage_zu + val_garage_licht )
}
end
2020-03-18 15:40:42.927 [INFO ] [el.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model 'garagentor.rules', using it anyway:
The value of the local variable val_garage_zu is not used
The value of the local variable val_garage_zu is not used
The value of the local variable val_garage_licht is not used
2020-03-18 15:40:42.962 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'garagentor.rules'
Rule 'Garagentor status': The name 'val_garage_zu' cannot be resolved to an item or type; line 61, column 33, length 13
Ziel:
Das Garagentor meldet zu dann soll geprüft werden ob manuell oder Automatik und ob Licht an oder aus.
Da fehlen noch schritte was passieren soll wenn Automatik an u.s.w. aber da muss ich erst meinen Fehler erkennen den ich bis hier gemacht haben.
Kann ich eventuell die If's in diesem teil auch noch anders verschachteln, alles zum erstem if?