OH3 Rule error for email

So, do those rules actually send a mail? (It’s like pulling teeth here sometimes.)

I ask in case the battery Items are of voltage or percent type,meaning they would never pass a purely numeric if() like this
if (ZWaveN22_4InOne_BatteryLevel.state <= 10){

both rules send a mail, yes. however on start-up i get the error on the rule version without the IF statement

Sorry it’s like pulling teeth - your help is massively appreciated.
Colin.

This looks like the key factor. Your zwave device must be triggering the rule at start up, which is fair enough.
But the mail binding has not yet prepared the Action. Might even be that it’s overwhelmed with a flurry of requests.
It should be possible to test if you got a valid Action before sending mail. That would avoid the nuisance report, assuming you don’t actually need emails at start up.

Assuming rossko is on to the solution, a common thing to do in changed triggered rules is to test to see if oldState was NULL and UNDEF first and only run the rest of the rule if it wasn’t. That prevents the rule from running on that very first update to the Item which often comes from restoreOnStartup.

if(previousState == NULL || previousState == UNDEF){
    return;
}

That could be a solution.

In your second rule it might be worth checking that battery level Item for NULL and UNDEF too. And assuming that this is a percentage it’s probably either going to be a Dimmer Item or a Number:Dimensionless. And if it’s a Number:Dimensionless you need to compare it to a compatible unit, not just a naked 10. That’s what rossko is saying.

if(ZWaveN22_4InOne_BatteryLevel.state == NULL ||
   ZWaveN22_4InOne_BatteryLevel.state == UNDEF ||
   ZWaveN22_4InOne_BatteryLevel.state <= 10 |%%) {

I think percent needs the double %% there but if that causes problems try just one.