I agree [Item i | is not working, but when I try to reproduce your case I do not get these errors.
https://community.openhab.org/t/text-rules-are-randomly-not-loaded-in-openhab-5-1/ suggests using [GenericItem i | instead of [ i |.
Independent of the other information, I think the brackets in (i.state as Number) <= minTemp are not necessery. You can use now.hour instead of now.getHour().
For
if(((Temperaturen_all.members.filter[NumberItem i|(i.state as Number) <= minTemp]).size > 0) && (nNotifications == 0))
the error is
Type mismatch: cannot convert from (NumberItem)=>boolean to Function1<? super Item, Boolean>
because you had this snippet
[i|(i.state as Number) <= minTemp]
on two places, I proposed to you how to replace it, and you replaced it only on one of the places.
For
Temperaturen_all.members.exists[ Boolean.valueOf((it.state as Number) <= minTemp) ].forEach[j|
the error
DSL model ‘notification2.rules’ has errors, therefore ignoring it: There is no context to infer the closure’s argument types from. Consider typing the arguments or put the closures into a typed context.
is not because of exitst[…], but because of forEach[j |. Also I suggested replacing .filter[…].size > 0 with exits[…]. But you have tried in Temperaturen_all.members.filter[i|(i.state as Number) <= minTemp].forEach[j| to replace also filter[…] with exists[…], which changes the logic.
All that said, in your original snippet replace [ j | ` with `[GenericItem j | ` and replace twice `[ i |` with `[GeneraicItem i |`. That’s all.
As an alternative replace [i | and [j | with just [, and in the lambda body instead of i or j use it (it is highlighted : use the letter i followed by letter t, as if [it | were present):
if(Temperaturen_all.members.exists[it.state as Number <= minTemp] && nNotifications == 0)
{
nNotifications = 1
if(now.hour >= 22 || now.hour < 7) // keine Nachricht zwischen 22 Uhr und 07 Uhr versenden
logInfo("Raumtemperatur","Nachricht nicht gesendet, da es Nacht ist")
else if(Kontakte.state as Number == 0)
logInfo("Raumtemperatur","Nachricht nicht gesendet, da kein Fenster mehr offen ist")
else
Temperaturen_all.members.forEach[
val tempvalue = it.state as Number
if (tempValue <= minTemp) return;
meldeText = 'Die Temperatur im Raum ' + it.name.replaceAll('KG_','Kellergeschoß_').replaceAll('EG_','Erdgeschoß ').replaceAll('OG_','Obergeschoß ').replaceAll('_Temp',' ').replaceAll('Kind2_XTemp','Theo ').replaceAll('SpeisXTemp','Speis ') + 'ist kleiner als ' + minTemp.toString + ' °C! Aktuell: ' + tempvalue.toString + ' °C'
val actions = getActions("pushover", "pushover:pushover-account:***") //Pushover
actions.sendMessage("Information", meldeText)
]
tFenstertemp = createTimer(now.plusMinutes(15)) [ nNotifications = 0 ]
}