Door Sensor state change not triggering rule

I’ve got a Z-Wave Door Sensor (Aeotec ZW120 Door/ Window Sensor Gen5) that I am wanting to use to trigger a light when the door is opened or shut.

Background:
I am also currently testing OpenHAB4. So to test migrating from 3 (OH 3.4.4), I backed up my configuration from OH3 and imported it into my OH4 instance. Fresh install in same VM. Using snapshots to move between the two.

  • Everything that I already had seemed to be working fine.
  • The rule was being added to the new instance, not migrated from the old.
  • The Script to toggle the light works. I built it in Blockly and tested it before adding it to the rule.

So I know the script is definitely not the issue.

The rule is meant to look for a change in door sensor status and fire off the rule:

	configuration: {}
	triggers:
	- id: "1"
		configuration:
		itemName: DoorSensor01frontz005_DoorSensor
		type: core.ItemStateChangeTrigger
	conditions: []
	actions:
	- inputs: {}
		id: "2"
		configuration:
		considerConditions: false
		ruleUIDs:
			- UUID_number
		type: core.RunRuleAction
	- inputs: {}
		id: "3"
		configuration:
		message: Door status changed
		type: notification.SendLogNotification

Nothing. No change of lights. No message in the logs. No state change. No commands.

I then reverted back to OH3 and copied the rule across (recreating the Script and replacing the UUID in the rule) and it works perfectly.

Which now also tells me that the rule itself works. In OH3, at least.

	2024-04-01 11:01:58.970 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'HueBulbTableLamp_Brightness' received command ON
	2024-04-01 11:01:58.971 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'HueBulbTableLamp_Brightness' predicted to become ON
	2024-04-01 11:01:58.974 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HueBulbTableLamp_Brightness' changed from OFF to ON
	2024-04-01 11:02:00.321 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'DoorSensor01frontz005_DoorSensor' changed from OPEN to CLOSED

	==> /var/log/openhab/openhab.log <==
	2024-04-01 11:02:00.323 [DEBUG] [o.openhabcloud.internal.CloudService] - Sending log message 'Door status changed'

Nothing like this shows in the OH4 logs.

I’m also noticing that the OH3 logs show other status changes too. Like Wattage numbers. These don’t show up in the OH4 logs but do get registered in InfluxDB.
The same is true for the door status. Nothing shows up in the logs but it is being updated in InfluxDB.

It also seems a motion sensor light triggering rule isn’t working. I didn’t notice that at first due to its location and the fact that I did the test upgrade outside of that room’s schedule.
Went into the room to check whilst still on OH4, light didn’t go on. Went in after switching back to OH3, light went on.

Something about status changes either isn’t triggering rules or isn’t properly registering at all. But I’m at a loss as to why.

I can’t have both running at the same time, so what should I be looking out for when I next switch it over to troubleshoot?

This could just be a difference in the logging configuration for openhab.event.ItemStateChangedEvent

Add a script action and in the script, issue a log info command. I’m guessing that the rule did trigger just fine.

Maybe your openhab cloud isn’t configured properly? (notification.SendLogNotification is related to the openhab cloud, not a plain log4j log if I’m not mistaken. I’m not familiar with this particular action)

Do you have a rule with UUID_number as its UID and what does that rule do?