How can I define item (name) with variable? I would like to use variable instead of item, to simplify the reuse of my code in different “rules” files.
This doesnt work:
var ItemName = “hum11” (this doesn’t show any error in openhab log but doesnt work)
var ItemName = hum11 (This shows error: Cannot reference the field ‘hum11’ before it is defined)
How should i do this?
Thanks in advance!