Rule crashing openhab after update

Hi,i run latest openhabian with latest openhab on a Rpi4.After recent update during bootup i got hundreds lines of log error like these:

2022-03-24 14:42:57.175 [ERROR] [xbase.resource.BatchLinkableResource] - resolution of uriFragment '|::0.2.0.2.0.0.1.0.0::0::/2' failed.
java.lang.UnsupportedOperationException: Missing type computation for expression type: QuantityLiteral / ExpressionTypeComputationState: ExpressionAwareStackedResolvedTypes: [
  parent: [
    expressionTypes:
      <XFeatureCallImplCustom>.state ->
        TypeData [expectation=TypeExpectation [expectation=Object], type=State, flags=[SUCCESS, SUBTYPE, CHECKED], returnType=false]
    featureLinking:
      <XMemberFeatureCallImplCustom> == <QuantityLiteralImpl> ->  [==:org.eclipse.xtext.xbase.lib.ObjectExtensions.operator_equals(java.lang.Object,java.lang.Object) [key: operator_equals(java.lang.Object,java.lang.Object)+]]
    parent: [
      expressionTypes:
        DwasherPlug_Watt ->
          TypeData [expectation=TypeExpectation [expectation=NumberItem], type=NumberItem, flags=[UNCHECKED], returnType=false]
        <XFeatureCallImplCustom>.state ->
          TypeData [expectation=TypeExpectation [expectation=<void not allowed>], type=State, flags=[UNCHECKED], returnType=false]
      featureLinking:
        DwasherPlug_Watt -> FeatureLinkingCandidate [DwasherPlug_Watt:Tmp_dishwasherRules.DwasherPlug_Watt [key: DwasherPlug_Watt+]]
        <XFeatureCallImplCustom>.state ->  [state:org.openhab.core.items.GenericItem.getState() [key: getState()+]]
      parent: [
        parent: [
          parent: [
            parent: [
              parent: [
                parent: [
                  types:
                    JvmOperation: Tmp_dishwasherRules._dishwasher(org.openhab.core.items.Item,java.lang.String,org.openhab.core.types.State,org.openhab.core.types.State) (visibility: PUBLIC, simpleName: _dishwasher, identifier: Tmp_dishwasherRules._dishwasher(org.openhab.core.items.Item,java.lang.String,org.openhab.core.types.State,org.openhab.core.types.State), deprecated: <unset>) (varArgs: false) (static: true, final: false, abstract: false, synchronized: false, default: false, native: false, strictFloatingPoint: false) -> void
                  declaredTypeParameters:
                    
                  parent: [
                    types:
                      JvmField: Tmp_dishwasherRules.dish_timer (visibility: PRIVATE, simpleName: dish_timer, identifier: Tmp_dishwasherRules.dish_timer, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> Timer
                      JvmField: Tmp_dishwasherRules.finish_timer (visibility: PRIVATE, simpleName: finish_timer, identifier: Tmp_dishwasherRules.finish_timer, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> Timer
                      JvmField: Tmp_dishwasherRules.DOWN (visibility: PRIVATE, simpleName: DOWN, identifier: Tmp_dishwasherRules.DOWN, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> UpDownType
                      JvmField: Tmp_dishwasherRules.PLAY (visibility: PRIVATE, simpleName: PLAY, identifier: Tmp_dishwasherRules.PLAY, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> PlayPauseType
                      JvmField: Tmp_dishwasherRules.OFF (visibility: PRIVATE, simpleName: OFF, identifier: Tmp_dishwasherRules.OFF, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> OnOffType
                      JvmField: Tmp_dishwasherRules.FASTFORWARD (visibility: PRIVATE, simpleName: FASTFORWARD, identifier: Tmp_dishwasherRules.FASTFORWARD, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> RewindFastforwardType
                      JvmField: Tmp_dishwasherRules.REFRESH (visibility: PRIVATE, simpleName: REFRESH, identifier: Tmp_dishwasherRules.REFRESH, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> RefreshType
                      JvmField: Tmp_dishwasherRules.UNDEF (visibility: PRIVATE, simpleName: UNDEF, identifier: Tmp_dishwasherRules.UNDEF, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> UnDefType
                      JvmField: Tmp_dishwasherRules.ON (visibility: PRIVATE, simpleName: ON, identifier: Tmp_dishwasherRules.ON, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> OnOffType
                      JvmField: Tmp_dishwasherRules.DECREASE (visibility: PRIVATE, simpleName: DECREASE, identifier: Tmp_dishwasherRules.DECREASE, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> IncreaseDecreaseType
                      JvmField: Tmp_dishwasherRules.PAUSE (visibility: PRIVATE, simpleName: PAUSE, identifier: Tmp_dishwasherRules.PAUSE, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> PlayPauseType
                      JvmField: Tmp_dishwasherRules.REWIND (visibility: PRIVATE, simpleName: REWIND, identifier: Tmp_dishwasherRules.REWIND, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> RewindFastforwardType
                      JvmField: Tmp_dishwasherRules.STOP (visibility: PRIVATE, simpleName: STOP, identifier: Tmp_dishwasherRules.STOP, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> StopMoveType
                      JvmField: Tmp_dishwasherRules.CLOSED (visibility: PRIVATE, simpleName: CLOSED, identifier: Tmp_dishwasherRules.CLOSED, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> OpenClosedType
                      JvmField: Tmp_dishwasherRules.PREVIOUS (visibility: PRIVATE, simpleName: PREVIOUS, identifier: Tmp_dishwasherRules.PREVIOUS, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> NextPreviousType
                      JvmField: Tmp_dishwasherRules.NULL (visibility: PRIVATE, simpleName: NULL, identifier: Tmp_dishwasherRules.NULL, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> UnDefType
                      JvmField: Tmp_dishwasherRules.UP (visibility: PRIVATE, simpleName: UP, identifier: Tmp_dishwasherRules.UP, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> UpDownType
                      JvmField: Tmp_dishwasherRules.OPEN (visibility: PRIVATE, simpleName: OPEN, identifier: Tmp_dishwasherRules.OPEN, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> OpenClosedType
                      JvmField: Tmp_dishwasherRules.INCREASE (visibility: PRIVATE, simpleName: INCREASE, identifier: Tmp_dishwasherRules.INCREASE, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> IncreaseDecreaseType
                      JvmField: Tmp_dishwasherRules.MOVE (visibility: PRIVATE, simpleName: MOVE, identifier: Tmp_dishwasherRules.MOVE, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> StopMoveType
                      JvmField: Tmp_dishwasherRules.NEXT (visibility: PRIVATE, simpleName: NEXT, identifier: Tmp_dishwasherRules.NEXT, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> NextPreviousType
                      JvmField: Tmp_dishwasherRules.GPSTrackerGK_Location (visibility: PRIVATE, simpleName: GPSTrackerGK_Location, identifier: Tmp_dishwasherRules.GPSTrackerGK_Location, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> LocationItem
                      JvmField: Tmp_dishwasherRules.Tarantula_TimeLeft (visibility: PRIVATE, simpleName: Tarantula_TimeLeft, identifier: Tmp_dishwasherRules.Tarantula_TimeLeft, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> NumberItem
                      JvmField: Tmp_dishwasherRules.MiRobotVacuumV2_Actions_ControlVacuum (visibility: PRIVATE, simpleName: MiRobotVacuumV2_Actions_ControlVacuum, identifier: Tmp_dishwasherRules.MiRobotVacuumV2_Actions_ControlVacuum, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> StringItem
                      JvmField: Tmp_dishwasherRules.YeelightColorBulb1_ColorMode (visibility: PRIVATE, simpleName: YeelightColorBulb1_ColorMode, identifier: Tmp_dishwasherRules.YeelightColorBulb1_ColorMode, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> StringItem
                      JvmField: Tmp_dishwasherRules.GPSTrackerKM_RegionTrigger (visibility: PRIVATE, simpleName: GPSTrackerKM_RegionTrigger, identifier: Tmp_dishwasherRules.GPSTrackerKM_RegionTrigger, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> SwitchItem
                      JvmField: Tmp_dishwasherRules.DiningRoomLedStrip_Program (visibility: PRIVATE, simpleName: DiningRoomLedStrip_Program, identifier: Tmp_dishwasherRules.DiningRoomLedStrip_Program, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> StringItem
                      JvmField: Tmp_dishwasherRules.Night_Time (visibility: PRIVATE, simpleName: Night_Time, identifier: Tmp_dishwasherRules.Night_Time, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> SwitchItem
                      JvmField: Tmp_dishwasherRules.MbedroomTv (visibility: PRIVATE, simpleName: MbedroomTv, identifier: Tmp_dishwasherRules.MbedroomTv, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> SwitchItem
                      JvmField: Tmp_dishwasherRules.MirrorStrip_Brightness (visibility: PRIVATE, simpleName: MirrorStrip_Brightness, identifier: Tmp_dishwasherRules.MirrorStrip_Brightness, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> SwitchItem
                      JvmField: Tmp_dishwasherRules.Tarantula_Event (visibility: PRIVATE, simpleName: Tarantula_Event, identifier: Tmp_dishwasherRules.Tarantula_Event, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> StringItem
                      JvmField: Tmp_dishwasherRules.bedhallsensor_MotionStatus (visibility: PRIVATE, simpleName: bedhallsensor_MotionStatus, identifier: Tmp_dishwasherRules.bedhallsensor_MotionStatus, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> SwitchItem
                      JvmField: Tmp_dishwasherRules.wledcolor (visibility: PRIVATE, simpleName: wledcolor, identifier: Tmp_dishwasherRules.wledcolor, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> ColorItem
                      JvmField: Tmp_dishwasherRules.MiAirPurifier3_FilterFilterLifeLevel (visibility: PRIVATE, simpleName: MiAirPurifier3_FilterFilterLifeLevel, identifier: Tmp_dishwasherRules.MiAirPurifier3_FilterFilterLifeLevel, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> NumberItem
                      JvmField: Tmp_dishwasherRules.YeelightColorBulb1_ColorTemperature (visibility: PRIVATE, simpleName: YeelightColorBulb1_ColorTemperature, identifier: Tmp_dishwasherRules.YeelightColorBulb1_ColorTemperature, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> NumberItem
                      JvmField: Tmp_dishwasherRules.GPSTrackerKM_LastSeen (visibility: PRIVATE, simpleName: GPSTrackerKM_LastSeen, identifier: Tmp_dishwasherRules.GPSTrackerKM_LastSeen, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> DateTimeItem
                      JvmField: Tmp_dishwasherRules.controlPi (visibility: PRIVATE, simpleName: controlPi, identifier: Tmp_dishwasherRules.controlPi, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> StringItem
                      JvmField: Tmp_dishwasherRules.MbedroomSwitch1_BatteryLevel (visibility: PRIVATE, simpleName: MbedroomSwitch1_BatteryLevel, identifier: Tmp_dishwasherRules.MbedroomSwitch1_BatteryLevel, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> NumberItem
                      JvmField: Tmp_dishwasherRules.wled4color (visibility: PRIVATE, simpleName: wled4color, identifier: Tmp_dishwasherRules.wled4color, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> ColorItem
                      JvmField: Tmp_dishwasherRules.MbedroomSwitch2_LowBattery (visibility: PRIVATE, simpleName: MbedroomSwitch2_LowBattery, identifier: Tmp_dishwasherRules.MbedroomSwitch2_LowBattery, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> SwitchItem
                      JvmField: Tmp_dishwasherRules.MasterBedroomSpeaker_Stop (visibility: PRIVATE, simpleName: MasterBedroomSpeaker_Stop, identifier: Tmp_dishwasherRules.MasterBedroomSpeaker_Stop, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> SwitchItem
                      JvmField: Tmp_dishwasherRules.Bright (visibility: PRIVATE, simpleName: Bright, identifier: Tmp_dishwasherRules.Bright, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> SwitchItem
                      JvmField: Tmp_dishwasherRules.NFCtrigger (visibility: PRIVATE, simpleName: NFCtrigger, identifier: Tmp_dishwasherRules.NFCtrigger, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> SwitchItem
                      JvmField: Tmp_dishwasherRules.livLights (visibility: PRIVATE, simpleName: livLights, identifier: Tmp_dishwasherRules.livLights, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> GroupItem
                      JvmField: Tmp_dishwasherRules.Total_Day_kWh (visibility: PRIVATE, simpleName: Total_Day_kWh, identifier: Tmp_dishwasherRules.Total_Day_kWh, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> NumberItem
                      JvmField: Tmp_dishwasherRules.XiaomiMiSmartHomeGateway_SoundVolume (visibility: PRIVATE, simpleName: XiaomiMiSmartHomeGateway_SoundVolume, identifier: Tmp_dishwasherRules.XiaomiMiSmartHomeGateway_SoundVolume, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> DimmerItem
                      JvmField: Tmp_dishwasherRules.HallwaySensor_MotionStatus (visibility: PRIVATE, simpleName: HallwaySensor_MotionStatus, identifier: Tmp_dishwasherRules.HallwaySensor_MotionStatus, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> SwitchItem
                      JvmField: Tmp_dishwasherRules.doorupbutton (visibility: PRIVATE, simpleName: doorupbutton, identifier: Tmp_dishwasherRules.doorupbutton, deprecated: <unset>) (static: true, final: false, volatile: false, transient: false, constant: <unset>, constantValue: null) -> SwitchItem

for example.
I thought that a rule called “dishwasherRules” was causing that so i removed it and reboot.After reboot openhab worked and booted up like normal.If i try to add that rule again i get the same errors.The rule goes like this:

var Timer dish_timer = null
var Timer finish_timer = null
rule "dishwasher"
when 
    Item DwasherPlug_Watt changed
then
    if (DwasherPlug_Watt.state == 0.0 | W && DishwasherState.state == ("FINISHED")) {
        DishwasherState.postUpdate("OFF")	
    } 
    else if (DwasherPlug_Watt.state > 30.0 | W ) {
        DishwasherState.postUpdate("RUNNING")
    }
	else if (DwasherPlug_Watt.state <= 2.0 | W && DishwasherState.state == ("RUNNING")) {
        finish_timer = createTimer(now.plusMinutes(20)) [|
		    if (DwasherPlug_Watt.state <= 2.0 | W && DishwasherState.state == ("RUNNING")) {
		        DishwasherState.postUpdate("FINISHED")
		        val Integer currentHour = now.getHour()
                if ((8..23).contains(currentHour)){
                    LivingRoomspeaker_Volume.sendCommand(60)
	                Thread::sleep(2000)	
                    say(" The dishwasher is done , please open the dishwasher's door . ","googletts:enAUWavenetC","chromecast:chromecast:79f0e335e57a6cbd5a68e5905c0eaaff")
	            }
                val mailActions = getActions("mail","mail:smtp:mailserver")
	            mailActions.sendMail("xxxxxxxxx@gmail.com, xxxxxxxx@yahoo.co.uk", "Laundry", "The Dishwasher is done.")
		        if (finish_timer !== null) {
	                finish_timer.cancel
		            finish_timer = null
                }
		    }   
	    ]		
    }
end
rule "Dwasher_meter"
when
    Item DishwasherState changed to RUNNING
then
    DishRunningTime.postUpdate(0)
    dish_timer = createTimer(now.plusSeconds(60))  [|
	    var Number result = DishRunningTime.state as Number + 1
        DishRunningTime.postUpdate(result)
		if (DishwasherState.state==("RUNNING")) {
            dish_timer.reschedule(now.plusSeconds(60))
        }
        else {
            dish_timer.cancel
		    dish_timer = null				 
        }
    ]
end

and i use it just fine for over a year now…Any ideas?

It seems to be complaining about this operation, or one of several similar comparisons. What is the state of that Item, is it a well-formed quantity (e.g. “350 W”)? Not the usual message you see if it is NULL or UNDEF though, so suspicious there is an underlying change.

Yes its a well-formed quantity like e.g “0 W” so i removed the “.0 | W” part and now it seems stable.I used this rule for a long time and never had this errors.I think it has something to do with Quantity units?Cleaning cashe i lost all the units i have set for counter items i use to do math for calculating daily and monthly energy and gas consumptions…Anyway thnx for your help.

Yes, that’s what I hinted at. This looks like a bug, don’t go changing everything. You’d best be explicit about what openHAB version though, todays “latest” is different from tomorrows, and openhabian has nothing to do with this.

here is a ss from my PuTTY now


is there another way to see what version i run?

Execute: dpkg -l openhab

or: via MainUI ( openHAB webpage ) : Help & About => Technical Information => View Details

1 Like

thnx

runtimeInfo:
  version: 3.2.0
  buildString: Release Build
locale: en-GR
systemInfo:
  configFolder: /etc/openhab
  userdataFolder: /var/lib/openhab
  logFolder: /var/log/openhab
  javaVersion: 11.0.14
  javaVendor: Raspbian
  osName: Linux
  osVersion: 5.10.103-v7l+
  osArchitecture: arm
  availableProcessors: 4
  freeMemory: 45211944
  totalMemory: 201326592
bindings:
  - astro
  - broadlink
  - chromecast
  - exec
  - gpstracker
  - harmonyhub
  - hpprinter
  - http
  - lgthinq
  - mail
  - mihome
  - miio
  - mqtt
  - nest
  - network
  - onkyo
  - openweathermap
  - shelly
  - systeminfo
  - wifiled
  - wled
  - zigbee

That is ordinary enough, not a snapshot version, and in use by many people with Items with units, so we can rule out a general bug.

So it looks like something odd about your Item DwasherPlug_Watt. Tell us more about that, what exact type is it?


it is just a Number:Power item linked to a mqtt Power channel of a wifi tasmota plug.Now the rule is like that

var Timer dish_timer = null
var Timer finish_timer = null
rule "dishwasher"
when 
    Item DwasherPlug_Watt changed
then
    if (DwasherPlug_Watt.state == (0|W) && DishwasherState.state == ("FINISHED")) {
        DishwasherState.postUpdate("OFF")	
    } 
    else if (DwasherPlug_Watt.state > (30|W) ) {
        DishwasherState.postUpdate("RUNNING")
    }
	else if (DwasherPlug_Watt.state <= (2|W) && DishwasherState.state == ("RUNNING")) {
        finish_timer = createTimer(now.plusMinutes(30)) [|
		    if (DwasherPlug_Watt.state <= (2|W) && DishwasherState.state == ("RUNNING")) {
		        DishwasherState.postUpdate("FINISHED")
		        val Integer currentHour = now.getHour()
                if ((8..23).contains(currentHour)){
                    LivingRoomspeaker_Volume.sendCommand(60)
	                Thread::sleep(2000)	
                    say(" The dishwasher is done , please open the dishwasher's door . ","googletts:enAUWavenetC","chromecast:chromecast:79f0e335e57a6cbd5a68e5905c0eaaff")
	            }
                val mailActions = getActions("mail","mail:smtp:mailserver")
	            mailActions.sendMail("costascontis@gmail.com, oxlagogi@yahoo.co.uk", "Laundry", "The Dishwasher is done.")
		        if (finish_timer !== null) {
	                finish_timer.cancel
		            finish_timer = null
                }
		    }   
	    ]		
    }
end

and its working fine .My guess is that problem begun when i cleared cashe and all my “virtual” items lost the quantity units i had set on them.Then upon restarting something went wrong and this rule messed things up.