Error in rules file - "cannot be resolved to an item or type"

Hi I’m a noob at openhab. Trying to configure a rule that will turn on the heating at a preset temperature I get the following error message in the openhab.log,

2015-11-11 00:22:14.971 [ERROR] [o.o.c.s.ScriptExecutionThread ] - Error during the execution of rule 'Control Kitchen heater': The name '<XFeatureCallImplCustom> < <XNumberLiteralImpl>' cannot be resolved to an item or type.

I don’t seem to be able to figure out what is causing this.

My rules file is,

import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*
import org.joda.time.*


/* Turn on Kitchen heater when temp is below 21 degrees */

rule "Control Kitchen heater"
        Item Temperature_GF_Kitchen received update
        if (Temperature_GF_Kitchen < 27)
                postUpdate(Heating_GF_Kitchen, ON)
                postUpdate(Heating_GF_Kitchen, OFF)

Any help would be really appreciated.

Thank you.


what is the line for Temperature_GF_Kitchen in your ITEMS file ?

Three possibilities: (1) you do not have an item defined, (2) you have one defined but it is the wrong type and/or a type mismatch (Number (in ITEMS) vs integer (in rule-cf 27 not 27.0), or (3) at the time the rule executes (and I think received update would trigger at startup - might be wrong ) the update is to “Uninitialized” rather than a number–so the comparison in the THEN clause would fail on a type mismatch. Add a logDebug message as first line in THEN clause to print current value of the Temperature_GF_Kitchen when rule executes

You have to access the state of the Item. So you have to write

if (Temperature_GF_Kitchen.state < 27)


1 Like

Also true @gersilex

Hi gersilex,

Thanks your advice worked.


The Items entry looks like this,
Number Temperature_GF_Kitchen "Temperature Kitchen [%.1f °C]" <temperature> (GF_Kitchen,Temperature_Chart) { mqtt="<[mosquitto:/myhouse/kitchen/temperature:state:default]" }