How to know which UI has triggered a command


OpenHAB Web UI is for me one of its great feature as it is portable and quickly configurable. But a found a downside I don’t know how to deal with.

I would like OH to know from which UI the commands received are sent from. The idea is OH to process differently the commands depending on which UI triggered the command.
Examples of usage:
1) prevent some commands to be executed if run “from outside” ( from an Internet access)
2) determine in which room to play TTS depending on which interface was triggered

The only solution I see at the moment is to maintain duplicated sitemaps with duplicated items which name would include the name of the UI. For example, item gFloor_livingdimmer would have duplicated gFloor_livingdimmer_UI1, gFloor_livingdimmer_UI2 for each of the tablets (UI1, UI2) found in the house.

Of course, this is not a smart implementation (multiplying uselessly number of items) nor maintainable.

Any idea of how to achieve such behaviour in OH?

Of course you know, that this is not the way openHAB works.

In question of preventing some commands to be executed from outside, you should use another sitemap with readonly widgets (set text wigdets instead of switch widgets)
Or completely omit the Items which shouldn’t be switched.

As far as I know, there is no way to determine which source caused an item to change it’s state.