I’m trying to keep my rules rather generic.
This means that I don’t always refer to item by their direct name. E.g. something like
But sometimes the item name is composed out of some other variables. An example:
val itemName = gAllecontacten.allMembers.filter[sw|sw.name.contains(in_UDPmsg.substring(1, 5))].head
If I created my items correctly, this should not be a problem. But I just want to have a check if there really is an item meeting the conditions defined in “itemName”.
If the itemname exists => proceed with the code.
If the itemname does not exist => loginfo + execute alternative code.
So how do I check if e.g. item abcd really exists in my OpenHAB setup?