Find the device or user which issued the command

  • Platform information:
    • Hardware: Raspberry Pi

Is it possible in rules to know what user issued a command? In my case when a user pushes a button on the openhab mobile App, I wish to respond to that s user by sending a them specifically a notification using sendNotification(emailAddress, message)

So the question is, in the event handler " Item received command " in the rule can I find out the user/email address of the user who clicked the button.

The short answer is “no”, at least not without some work around. See Design Pattern: Manual Trigger Detection for ways to detect whether the change was caused by the device or a Rule or the sitemap, but that won’t tell you which logged in user initiated the change. That’s largely because from openHAB’s perspective there is not concept of a logged in user.

You could potentially expand the DP above and create a separate sitemap for each user so there are proxy Items for each device for each user. It’s going to get complicated and become a lot of work though.