Identify which device is using the UI

Is there a way to identify which device a user is using teh MAin UI on?

For example, I wish to set up wall panels it would be useful to know if the panel is in the living room or a bedroom so that the widgets could display shortcuts to specific lighting or heating options for the location without having to choose from a menu. If I am using my phone then I could be anywhere so I woudl be presented with more general choices.

I can get information about the screen in use (gives me a clue about phones) but it appears not about the specific device. An IP address would do, or some unique identifier for the hardware.

Any thoughts gratefully received

There is no default way to do this. However you can do this fairly easily if you create specific users for each of the devices you want to identify. There is a user object that is available in the widget expressions that corresponds to the logged in user:

So, if you create a user with the name kitchen-tablet and log in with that user only on that device you can customize what the MainUI displays on that device using expressions such as:

visible: =user.name == 'kitchen-tablet'
1 Like

Thanks Justin. That’ll probably do the job for what I need.

It would be nice if we could define different home pages for different users or clients but I’m assuming that’s not possible with the current UI

Nope, the best you can do is populate different widgets on the overview page based on that user object.

You can create different pages for each device and launch that page by shortcut from the home screen of your device.

That’s a good idea but I think I can only do that in a browser yes? I can’t open a specific page in the app, which is what I’d want to do on a tablet or phone. Actually, that’s a thought; perhaps a kiosk broswer is the way to go on a tablet that is meant to be a permanent Openhab display. I hadn’t thought of that.

Anyone got any experience of one over the other?

You can launch individual sites in the app, too.
And no, no need for kiosk browsers.
See also here:

1 Like

Thanks Oliver - I’ll look into that