OH2.1 Rules saying item undefined

I have this item:

Number   gf_cupboard1_temperature  "Cupboard Temperature [%.1f °C]" <temperature>   (g_cupboard, g_temperature)

Which is fed from (gets a raw value which is filtered):

Number   gf_cupboard1_temperature_sensor  {mqtt="<[frodo:cupboard/temperature1:state:default]"}

And the filter rule is:

rule "TemperatureFilter_gf_cupboard1 filter rule"
when
	Item gf_cupboard1_temperature_sensor changed
then
  var Number difference
  if (gf_cupboard1_temperature.state != NULL) {
	difference = Math::abs((gf_cupboard1_temperature.state as DecimalType).floatValue - (gf_cupboard1_temperature_sensor.state as DecimalType).floatValue)
	logDebug("gf_cupboard1_temperature", "sensor value difference = "+  difference)
	if (difference < diffThreshold) {
		logInfo("gf_cupboard1_temperature", "Posting update as difference < " + diffThreshold + ":  Sensor: " + gf_cupboard1_temperature_sensor.state + " Stored: " + gf_cupboard1_temperature.state + " Difference: " + difference )
	        gf_cupboard1_temperature.postUpdate(gf_cupboard1_temperature_sensor.state)
	}
	else
		logWarn("gf_cupboard1_temperature", "Discarding Difference as > " + diffThreshold + ": Sensor: " + gf_cupboard1_temperature_sensor.state + " Stored: " + gf_cupboard1_temperature.state + " Difference: " + difference )
  }
  else {
        logInfo("gf_cupboard1_temperature", "gf_cupboard1_temperature.state is null, posting  " + gf_cupboard1_temperature_sensor.state)
        gf_cupboard1_temperature.postUpdate(gf_cupboard1_temperature_sensor.state)
  }
end

But the designer (just started using that) is complaining that The method or field gf_cupboard1_temperature is undefined

Is there something I have to import into my rules for it to pick up items? I just looked at another rule, and it’s complaining about something similar with a different item.

Which version of ESH Designer are you using? If it 0.9 then that version is hopelessly broken and it will not recognize any of your Items. Tou should use version 0.8 instead. And even that version has some things that it doesn’t recognize, such as Channel triggers, Items defined in PaperUI, and non-core Actions.

Try closing and opening the .rules file in Designer to force a reparse of the file. It might be a stale error that is no longer the case.

Do you see errors when running this in OH?

How do I see the version? I think it.s 0.8 (I only see that from the zip file I extracted it from).

And no I don’t see any runtime issues.

If the zip file says 0.8 then you are running with the right verison.

If everything works as expected then this is a false error being reported by Designer. Sadly, there are a lot of problems with Designer and not a lot is being done to fix it with the main focus being on the new rules engine which will make it obsolete.