SenCommand, can't find item

Hi,
I have 2 items in demo.items

Switch Light_GF_EZ_Schrank    		"Licht EZ Schrank"    <light>         {channel="zway:zwayDevice:192_168_178_38:8:switchPowerOutlet-ZWayVDev_zway_8-0-37", autoupdate="true" }
Switch Light_GF_Vitrine           "Licht EZ Vitrine"    <light>         {channel="zway:zwayDevice:192_168_178_38:9:switchPowerOutlet-ZWayVDev_zway_9-0-37", autoupdate="true" }

I have a simple rule which should switch the second light on when the first one is turned on.

rule LightsOnEZ
when
	Item Light_GF_EZ_Schrank changed
then
  logInfo("Light", "Licht EZ Schrank " + Light_GF_EZ_Schrank.state)
  sendCommand(Light_GF_Vitrine, Light_GF_EZ_Schrank.state)
end

But the rule can’t find the second item, although it shows the correct state of the first item.

Rule 'LightsOnEZ': An error occured during the script execution: The name 'Light_GF_Vitrine' cannot be resolved to an item or type.

Any idea what’s wrong?

Update: I also tried

  Light_GF_Vitrine.sendCommand(Light_GF_EZ_Schrank.state)

but same result

This is weird. It may be a red herring error though, I’m pretty sure your rule name must be in quotes which may be confusing the runtime.

Don’t know how/why, but it’s solved.

I removed the things and added them again, now everything works as expected.