Direct reference to items state in expressions of metadata

After having a running system under OH 2.5 I am starting from scratch with OH3. I believe this way I can make better use of new features.

Maybe I have missed it in the documentation:
When using expression in an items metadata, is there any way to get the items own state directly or is the only way the items dictionary (=items.<item_name>.state)?

I have a couple of items where I want to show the status by displaying changing f7 icons. It’s a bit tedious and error prone to always put in the items name in the expression while the rest of the expression is the same.

Thanks
Rainer

That’s the only way to get the Items state. Or if you want to get the “formatted” state you can use .displayState instead of .state. But you have to use the items dict. Note, in JavaScript, Python and Groovy rules, you also usually have to use the items dict unless you explicitly pull the Item from the Item registry. But the item registry only exists on the server side, not on the client side.

Thank you for making that clear. Just don’t want to start in the wron direction.