Issues with boolean "null" value

hello everyone, and first of all thanks for all the hard work you do with this fantastic project!

i’ve recently installed OH3 and i’m recreating rules in UI but i’m stuck on this issue:

var boolean Wecken
var int Minuti
var int Ore

if (gUSER1Week.members.filter[s | == "USER1"].head.state == ON) 
    Minuti  = (gUSER1Week.members.filter[s | == "USER1"+"M"].head.state as Number).intValue
    Ore     = (gUSER1Week.members.filter[s | == "USER1"+"H"].head.state as Number).intValue
    Wecken  = true

if (Minuti == now.getMinute() && Ore == now.getHour() && Wecken == true)
    logInfo("Lockdown_Rule", "Tapparelle in chiusura!") 

in log i get this error:

2021-09-17 16:15:02.927 [ERROR] [ernal.handler.ScriptConditionHandler] - Script did not return a boolean value, but 'null'

how can i solve this? this rule is to set manually on sitemap a schedule of when rollershutters have to go down each day of the week.

thanks to anyone who can help me :slight_smile:

forgot: this is a DSL.rule created in rules page of UI. thx.

Add some logging to see which if statement it’s failing on. Log out the value of Minuti and Ore. I suspect you will find one or both of them are null meaning your search for those Items in gUSER1Week failed to find the Item.

iafter the post, i’ve found the f****ing issue: i placed this rule under “but only if” section instead of “then”.
damn, 4 hour under this issue…

thx allot!