Error message after server crash

Hello,

my openhab server failed last weekend. After doing the setup again I am receiving an error in my log which was not there before. Settings are the same because it is from backuped docker volume.

Any ideas where it comes from?

2019-07-11 22:14:50.494 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Temperatur Differenz Aussen': An error occurred during the script execution: Couldn't invoke 'assignValueTo' for feature JvmVoid:  (eProxyURI: rolladen_steuerung.rules#|::0.2.0.2.0.2.1.0.0.1.0.0::0::/1)




var boolean log = true
var boolean development = false
var Number schliesswertGr = 80
var Number schliesswertKl = 75
var Number aussentempschwelle = 15

rule "Temperatur Differenz Aussen"
when 
Item HeatPump_Temperature_1 received update
or 
Item TemperatureAussenVorne received update
or
Time cron "0 */5 * * * ?" 
or
Item RolloAutomatik changed
//Item HeatPump_Temperature_1 received update
//or

then 
//Azimuth und Elevation auslesen
var Number AzimuthNow = Azimuth.state
var Number ElevationNow = Elevation.state


if ((ElevationNow <= 0 && ElevationNow >= 80) || RolloAutomatik.state == OFF || HeatPump_Temperature_1.state <= aussentempschwelle || (AzimuthNow < 100 && AzimuthNow > 285) ) {
    if (now.getHourOfDay < 8 || now.getHourOfDay > 19) {
        sonne = false
        return;
    }
    AziOGSued.postUpdate(OFF)
    AziEGSued.postUpdate(OFF)
    AziEGSuedMitte.postUpdate(OFF)
    AziWest.postUpdate(OFF)
    Sun.postUpdate(OFF)
    return;
    
}
else {
    //Temperaturdifferenz berechnen und senden 
    var Number TempAussDiff = (TemperatureAussenVorne.state as Number) - (HeatPump_Temperature_1.state as Number)
    var Number Diff = (HeatPump_Temperature_1.state as Number) - (TemperatureAussenDifferenz.state as Number)
    var Number tau = 10 // Glaettungsfaktor, 1 waere keine Glaettung
    TempAussDiff = TempAussDiff + (Diff / 10)
    TemperatureAussenDifferenz.postUpdate(TempAussDiff)

    var Boolean sonne = Sun.state
    if (sonne == ON) sonne = true
    else sonne = false

    if (TempAussDiff >= 6 && sonne == false || sonne && TempAussDiff > 3 || development ) {
        sonne = true
        Sun.postUpdate(ON)
        if (AzimuthNow > 105 && AzimuthNow < 196) {
            if (ElevationNow > 45) AziOGSued.sendCommand(OFF)
            else (AziOGSued.sendCommand(ON))
        AziEGSued.sendCommand(ON)
        AziWest.sendCommand(OFF)
        AziEGSuedMitte.sendCommand(ON)
        }
        if (AzimuthNow > 196 && AzimuthNow < 260) {
            if (ElevationNow > 45) AziOGSued.sendCommand(OFF)
            else (AziOGSued.sendCommand(ON))
        AziEGSued.sendCommand(ON)
        AziWest.sendCommand(ON)
        AziEGSuedMitte.sendCommand(ON)
        }
        if (AzimuthNow > 260 && AzimuthNow < 285) {
        AziOGSued.sendCommand(OFF)
        AziEGSued.sendCommand(OFF)
        AziWest.sendCommand(ON)
        AziEGSuedMitte.sendCommand(OFF)
        }
    }
    
    else if (TempAussDiff <= 3 && sonne) {
        createTimer(now.plusMinutes(5), [ | // schlafe 5 minuten
        if ((TemperatureAussenVorne.state as Number) - (HeatPump_Temperature_1.state as Number) + (tau * ((HeatPump_Temperature_1.state as Number) - (TemperatureAussenDifferenz.state as Number))) < 3) {
            sonne = false
            Sun.postUpdate(OFF)
            AziOGSued.sendCommand(OFF)
            AziEGSued.sendCommand(OFF)
            AziEGSuedMitte.sendCommand(OFF)
            AziWest.sendCommand(OFF)
        }
        ])
    }   
}		
end

// *********************************************
// ON RULES
// *********************************************

rule "Rolladen AziOGSued"
when
Item AziOGSued received command ON
then
if ( SchlafzimmerRollo_S_OUT.state == 1) SchlafzimmerRollo_S_IN.sendCommand(schliesswertKl)
if ( KindMaxRollo_S_OUT.state == 1) KindMaxRollo_S_IN.sendCommand(schliesswertKl)
if (log) logInfo("****RolloSteuerung****", "AziOGSued Kommandos gesendet")
end

rule "Rolladen AziWest"
when
Item AziWest received command ON
then
if (log) logInfo("****RolloSteuerung****", "AziWest Kommandos gesendet" + KindEmmiRollo_W_OUT.state)
if ( KindEmmiRollo_W_OUT.state == 1) KindEmmiRollo_W_IN.sendCommand(schliesswertGr)
if ( WohnzimmerRollo_W_OUT.state == 1) {
    WohnzimmerRollo_W_IN.sendCommand(schliesswertGr)
}
if ( BueroRollo_W_OUT.state == 1) BueroRollo_W_IN.sendCommand(schliesswertGr)
if (log) logInfo("****RolloSteuerung****", "AziWest Kommandos gesendet")
end

rule "Rolladen AziEGSued"
when
Item AziEGSued received command ON
then
if ( WohnzimmerRollo_SW_OUT.state == 1) WohnzimmerRollo_SW_IN.sendCommand(schliesswertGr)
if ( WohnzimmerRollo_SO_OUT.state == 1) WohnzimmerRollo_SO_IN.sendCommand(schliesswertGr)
if (log) logInfo("****RolloSteuerung****", "AziEGSued Kommandos gesendet")
end

rule "Rolladen AziEGSuedMitte"
when
Item AziEGSuedMitte received command ON
then
var aussperrschutz = WohnzimmerFenster_S.state
if (log) logInfo("****RolloSteuerung****", "Aussperrschutz" + aussperrschutz)
if (aussperrschutz == NULL) aussperrschutz = 'OPEN'
if (log) logInfo("****RolloSteuerung****", "Aussperrschutz" + aussperrschutz)
if (aussperrschutz == 'CLOSED' && WohnzimmerRollo_S_OUT.state == 1 ) WohnzimmerRollo_S_IN.sendCommand(schliesswertGr)
else AziEGSuedMitte.postUpdate(OFF)
if (log) logInfo("****RolloSteuerung****", "AziEGSuedMitte Kommandos gesendet")
end

// *********************************************
// OFF RULES
// *********************************************

rule "Rolladen AziOGSued"
when
Item AziOGSued received command OFF
then
SchlafzimmerRollo_S_IN.sendCommand(1)
KindMaxRollo_S_IN.sendCommand(1)
if (log) logInfo("****RolloSteuerung****", "AziOGSued Kommandos gesendet")
end

rule "Rolladen AziWest"
when
Item AziWest received command OFF
then
KindEmmiRollo_W_IN.sendCommand(1)
//KindMaxRollo_W_IN.sendCommand(1)
WohnzimmerRollo_W_IN.sendCommand(1)
BueroRollo_W_IN.sendCommand(1)
if (log) logInfo("****RolloSteuerung****", "AziWest Kommandos gesendet")
end

rule "Rolladen AziEGSued"
when
Item AziEGSued received command OFF
then
WohnzimmerRollo_SW_IN.sendCommand(1)
WohnzimmerRollo_SO_IN.sendCommand(1)
if (log) logInfo("****RolloSteuerung****", "AziEGSued Kommandos gesendet")
end

rule "Rolladen AziEGSuedMitte"
when
Item AziEGSuedMitte received command OFF
then
WohnzimmerRollo_S_IN.sendCommand(1)
if (log) logInfo("****RolloSteuerung****", "AziEGSuedMitte Kommandos gesendet")
end

Typically this happens when you just assume that the state of an Item is, for example, a DecimalType or OnOffType or whatever but the Item is actually NULL or UNDEF.

The error tells you exactly which Rule to look in, I don’t understand why you posted them all.

First thing to check is whether Azimuth and Elevation are not NULL or UNDEF.

Not sure how this ever can result in true. :grin:

I notice you don’t use () for the now.getHourOfDay() function. To my knowledge that is the correct syntax, since it is a method.
Are you sure your backup contained the latest status from before the crash?

Rules DSL is a little less strict about this than most languages. If you have a method that doesn’t take any arguments you are not required to use the (). Similarly, if you want to call the getSomething() method, you can just use something, e.g. MyItem.something.

1 Like

Learn something new every day… :grin:

Thanks will check right now

FOUND IT!!!
first use of sonne is not defining boolean format …