Yes, indeed, the solution proposed does not work so would be very helpful to unmark this thread as solved.
I guess I have found the issue report on GitHub. Unfortunately, nothing seems to happen there:
The same problem annoys me regularly at restarts of OH. In my setup my 4 Philips Hue dimmers suddenly don’t work anymore because the corresponding getEvent is no longer recognized. It regularly costs me a lot of time until it runs again. The bottom line is that there is no concrete way to do this. In the end there are countless restarts until everything runs again sometime.
My (simplified) code looks likes this:
rule "Dimmer Bed"
when
Channel "hue:0820:<ID>:HueDimmer_Bed:dimmer_switch_event" triggered
then
var String ButtonEvent = receivedEvent.getEvent() // often fails after OH restart
var Number ButtonNumber = Integer.parseInt(ButtonEvent.substring(0,1)) as Number
var Number ButtonState = Integer.parseInt(ButtonEvent.substring(3,4)) as Number
// now react to different button numbers and states
// ...
end