I encountered an issue with the Homey.users.getUserMe() function when using it in Homey Script.
Expected Behavior:
When I run Homey.users.getUserMe() on the Homey Developer platform, it correctly returns my information (e.g., my role, name, etc.), as expected.
Actual Behavior:
However, when I execute the exact same command (Homey.users.getUserMe()) in Homey Script, it always returns the information of the owner of the Homey box (the primary account), instead of my own user information.
This seems to be inconsistent, as the function works as expected in the Developer platform but not in Homey Script.
Is this the intended behavior? If so, is there another way to retrieve the user information of the person triggering the flow or running the script?
Any help or clarification would be greatly appreciated!
I understand your logic, but I don’t think it’s intentional, because it means that someone who can create a flow will execute it as the owner.
I find that user rights at homey are very poorly managed, not only can you not create restrictions for certain guest users, but you can’t do it even via a script.
I think this is more a side-effect of the fact that homey script is run as a proprietary application than a deliberate choice during development…
In any case, it makes this command completely useless in my opinion (except perhaps for application developers).
So there’s no way of knowing who’s launching a flow or its status, which is a shame!
In fact, here’s my real problem.
I have a regular guest (my brother-in-law) who comes to my house very often and sometimes to watch the dog.
So naturally I created a guest account for him to open the gate, the front door and the alarm.
But he has access to everything and it’s quite annoying: the lights, the presence, the cameras…
So I’d like to manage his rights, but it’s not advanced enough, so I’m looking for ways to divert him via scripts, and I’m also logging door openings with the person who opened it, for example.
If anyone has a solution other than third-party software, I’d love to hear from you.
Thanks for your reply, I already know this trick but it doesn’t really interest me because it implies that the user must perform an action on an object and not on a feed.
The thing is that on android you can’t put shortcuts (widgets) on objects but only on flows.
My intention behind this post is to explore the possibilities via homey script and another application that could allow you to do this in a flow.
Sorry, it’s not “and” but “or”.
I’m looking for another application that might help me in my search, such as homey script or advanced device capabilities.
Ok. In that case you now know the restrictions from Homey and almost sure the only other option is the Device Capabilities app as mentioned by @Peter_Kawa
It doesn’t work either, several posts in the device capabilities topic were talking about it just yesterday.
I understand that you don’t have the solution to my problem but that doesn’t make it go away, thanks for taking the time to read.
Anyway, if one day someone comes up with a clue, I’d love to hear from you!
Is there any solution to retrieve the user who triggered a flow (be it from the dashboard, from the iOS widget, from Shortcuts, etc.)? My use case is that I want to send a “push confirmation” to the user who triggered the flow so that they can respond to a question before continuing the flow. The built-in “And” card requires that you specify a fixed recipient of the notification, so instead I’m using a HomeyScript to send the notification to “await Homey.users.getUserMe()”, and currently this sends the notification to the owner of the Homey Pro so it’s pretty useless…
Honestly, I don’t understand why the current user cannot be retrieved when you run a Flow explicitly (by clicking on it).