Rule not firing on item change, it just stopped working

Hi folks,

I’ve struck a simple problem that I just can’t solve. I’ve checked all similar forum posts I can find.

  • Problem Description:

  • Platform information:

    • Hardware:
      | Model Name: Mac mini
      | Model Identifier: Macmini6,1
      | Processor Name: Intel Core i5
      | Processor Speed: 2.5 GHz
      | Number of Processors: 1
      | Total Number of Cores: 2
      | L2 Cache (per Core):256 KB
      | L3 Cache: 3 MB
      | Memory: 16 GB

    • OS: Apple OS X
      System Version: macOS 10.13.6

    • Java Runtime Environment: Oracle Java version 8 release 181

    • openHAB version: 2.3 stable

  • Issue of the topic:
    A rule that should fire when any button on a zwave Wallmote is pressed has just stopped firing. I have a CRON based rule to check heater status on a nightly basis which does fire. I have tried restarting openHAB and rebooting the system. No change. I have tried refreshing both the item and rule files to try and restart the rule. There are no errors relating to this issue that I can see in the logs. I do get an intermittent error:

22:55:54.147 [ERROR] [ng.nest.handler.NestThermostatHandler] - Unsupported channelId 'time_to_target_mins'
  • However I’ve had this issue for some time, I know what this error is and how to fix it, and it hasn;t caused an issue so far. Attached is the item configuration for the Wallmote (WM01_scene). When a button is pressed, log entries show “WM01_scene changed from…” but the rule “wallmote01_scenes” doesn’t fire. It used to. I had changed nothing on this system, it has been running openHAB, Splunk and pi-hole (in a docker container) successfully for some time. It is only used as a server for these applications.

Any assistance would be greatly appreciated. Thanks.

  • Item configurations relating to wallmote and controlled devices:
Number WM01_scene "WallMote 01 Scene: [%s]" <contact> {channel="zwave:device:0c63a48b:node13:scene_number"}
Switch lamp_right_upstairs "Right Upstairs Lamp" <light> ["Lighting"] {channel="zwave:device:0c63a48b:node11:switch_binary"}
Switch lamp_left_upstairs "Left Upstairs Lamp" <light> ["Lighting"] {channel="wemo:insight:Insight-1_0-221520K12003B7:state"}
  • Rules code related to the issue
var String FRU_last_dim_state
var Number dimmer_offset = null
//FRU = Family Room Upper
	
rule "wallmote01_scenes"

	when 
		Item WM01_scene received update
	then
		logInfo("wallmote.rules", "wallmote rule triggered")
		logInfo("wallmote.rules", "wallmote scene number: " + WM01_scene.state)
		logInfo("wallmote.rules", "wallmote right lamp state: " + lamp_right_upstairs.state)
		logInfo("wallmote.rules", "wallmote left lamp state: " + lamp_left_upstairs.state)
		logInfo("wallmote.rules", "wallmote family room upper state: " + light_family_room_upper.state)
		logInfo("wallmote.rules", "FRU_last_dim_state: " + FRU_last_dim_state)
		logInfo("wallmote.rules", "dimmer_offset: " + dimmer_offset)
	
		switch(WM01_scene.state) {

// Upstairs Left Lamp ON/OFF	
			case 1.0 : {
				if (lamp_left_upstairs.state == OFF) {
					logInfo("wallmote.rules", "scene state: 1.0 and lamp off, turn lamp ON")
					lamp_left_upstairs.sendCommand(ON)
				}
				else { 
					logInfo("wallmote.rules", "scene state: 1.0 and lamp on, turn lamp OFF")
					lamp_left_upstairs.sendCommand(OFF)
				}	
			}
			
// Upstairs Right Lamp ON/OFF						
			case 2.0 : { 
				if (lamp_right_upstairs.state == OFF) {
					logInfo("wallmote.rules", "scene state: 2.0 and lamp off, turn lamp ON")
					lamp_right_upstairs.sendCommand(ON)
				}
				else { 
					logInfo("wallmote.rules", "scene state: 2.0 and lamp on, turn lamp OFF")
					lamp_right_upstairs.sendCommand(OFF)
				}
			}

// Family Room Upper Dimmer implementation

			case 3.0 : {
				// If Off turn ON - single short press				
				if (light_family_room_upper.state == 0) {
					logInfo("wallmote.rules", "scene state: 3.0 and FRU off, turn FRU ON")
					light_family_room_upper.sendCommand(ON)
				}
				// If ON turn OFF - single short press
				else {
					logInfo("wallmote.rules", "scene state: 3.0 and FRU on, turn FRU OFF")
					light_family_room_upper.sendCommand(OFF)					
				}		
			}
			
			// set the last dim state so that next time do the opposite.
			case 3.1 : {
				if(FRU_last_dim_state == "up"){
					FRU_last_dim_state = "down"
				}
				else {
					FRU_last_dim_state = "up"
				}
				dimmer_offset = null				
			}
			
			case 3.2 : {
				//Dimmer Up - long press
				if (light_family_room_upper.state < 255 && (FRU_last_dim_state == "down" || FRU_last_dim_state === null)) {
					logInfo("wallmote.rules", "scene state: 3.2 and FRU on, dimmer light up")
					if(dimmer_offset === null){
						dimmer_offset = (255 - (light_family_room_upper.state as Number))/30
					}
					light_family_room_upper.sendCommand((light_family_room_upper.state as Number) + dimmer_offset)
					logInfo("wallmote.rules", "light_level: " + light_family_room_upper.state)			
				}
				// Dimmer down - long press				
				else {
					logInfo("wallmote.rules", "scene state: 3.2 and FRU on, dimmer light up")
					if(dimmer_offset === null){
						dimmer_offset = ((light_family_room_upper.state as Number))/30
					}					light_family_room_upper.sendCommand((light_family_room_upper.state as Number) - dimmer_offset)
					logInfo("wallmote.rules", "light_level: " + light_family_room_upper.state)					
				}		
			}
			
		}
			
		// Double short press for full brightness
			
		logInfo("wallmote.rules", "wallmote rule complete")		
end
  • Logs showing refesh of items and rules file with no errors, and the wallmote event.
22:08:07.148 [INFO ] [.internal.service.FeaturesServiceImpl] - Adding features: 
22:08:07.695 [INFO ] [.internal.service.FeaturesServiceImpl] - No deployment change.
22:08:07.699 [INFO ] [.internal.service.FeaturesServiceImpl] - Done.
22:08:24.070 [INFO ] [del.core.internal.ModelRepositoryImpl] - Refreshing model 'wallmote.items'
22:08:34.932 [INFO ] [del.core.internal.ModelRepositoryImpl] - Refreshing model 'wallmote.rules'
22:08:40.027 [INFO ] [org.quartz.core.QuartzScheduler      ] - Scheduler openHAB-job-scheduler_$_NON_CLUSTERED started.
22:08:58.569 [INFO ] [smarthome.event.ItemStateChangedEvent] - WM01_scene changed from 3.0 to 2.0
22:09:07.148 [INFO ] [.internal.service.FeaturesServiceImpl] - Adding features: 
22:09:07.773 [INFO ] [.internal.service.FeaturesServiceImpl] - No deployment change.
22:09:07.777 [INFO ] [.internal.service.FeaturesServiceImpl] - Done.

Have you tried changing the trigger to changed?
Does the rule fire with a dummy item trigger or cron trigger?

Look in events.log. Is WM01_scene changing or receiving commands?

In PaperUI, does it show the Thing for the device (Node 13) as Online?

Is it just this Rule or is it all non-cron triggered Rules?

That should fire the rule of course. I’d be suspicious of some error in the .rules file above your problem rule, preventing it from being parsed correctly, even though your log hasn’t shown that up either. Make sure the rule name is unique across all your .rules files.

thanks everyone for your suggestions. I tried a few different things, removing all rules adding them. back, created a few test rules, still didn’t resolve the issue, the wallmote scene change would appear in the logs, but the change rule would never trigger. It was weird as I hadn’t changed anything for weeks in the system. So I jumped in and have upgraded to the latest 2.4 release and it’s back working again.

Thanks again folks.

Please mark the thread as solved, thanks