Item.state not working after reinstall

i had to completely reinstall openhab2 on a new sd card yesterday.
I used the raspberry pi distribution.

It seems that after the reinstall some rules are not working anymore.

For example:
Item definition:
Switch lightOffice "Office" (gOG,gOffice) {knx="1/2/4"}

[ome.event.ItemCommandEvent] - Item 'lightOffice' received command ON

The rules with
Item lightOffice changed
are not triggering anymore.

When i change the trigger to “received command” the rule is triggered but the state is always null:

rule "test"
	Item lightOffice received command
	logInfo("Test", "State of ligthOffice " + lightOffice.state)

[.eclipse.smarthome.model.script.Test] - State of ligthOffice NULL

What am i doing wrong? Before the reinstall everything was working fine.

In my Android openhab app the switch states are also not being updated. The switches are alway shown of, until i switch them in the app itself. Switching lights on and off in the app works. Only the states are not being updated when i hit the physical switch.

change to

logInfo("Test", "State of ligthOffice " + lightOffice.state.toString)

Thank you for your reply, Harry.
I added .toString and changed the text so that i can see that the rule was reloaded.
Unfortunately the output doesn’t change. It’s still NULL

Check with BasicUI or ClassicUI.
Sometimes a restart helps.

1 Like

Don’t think it is your rules. NULL means that your item did not get initialized and is not talking to your knx system. Maybe you want to check from the start: is you binding installed, do you have the right things definitions, etc.

Hi Markus,
thank you for your reply!

As i said: i can switch the light via BasicUi and via App. The light goes on and off. If i change the rule from “state changed” to “received command” the rule is triggered.
So i think the communication is working and the setup is right.

It’s just the damn “state” and “state changed” which ist not working.

Sometimes the simplest solutions… I restarted openhab2 with
sudo systemctl restart openhab2.service

After the reboot the state changes are detected and the rules are triggered even via “state changed”.

Thanks for the help!