Who triggered this?

Yesterday something strange happened.

My bulb went on, at 3:12AM, right at my face while I was sleeping. There are no automations defined, but a lot of people have the app on their phones, so it could have been anyone.

My question is:

Is there a way to log who triggered a light or a switch. Optimal would be the username of the logged in account.

If that’s not possible, it definitively would be massive improvement adding this :slight_smile:

Thanks in advance

Try to turn on something on their faces (one by one) and look to the reaction. I think that is the only way for now to figure it out :slight_smile:
I might be wrong by the way

3 Likes

There is no possibility to do this (yet), I think I remember having read somewhere that they are working on it.

I hope so.

I was thinking something along the lines as:

image

The context should be logged, in the database, but it doesn’t directly say Oliver, instead you get something like:

Context(user_id='deadbeefcafe4fd08e9573ffe2f1a33c', parent_id=None, id='6853f275e6c03b98c0ed0826ad82af30')

That user_id will link to the user_id attribute of a person entity (assuming you’ve linked the user and the person).

None of this is currently exposed in the UI though.

2 Likes

Wow. It being logged in the database and the action itself being shown in the logbook, from my perspective, it shouldn’t be too hard to show both in the logbook.

I hope someone implements that soon :crossed_fingers:

Thank you for the information!

Bump.

I think this should be seen more, as it is an important feature.

Bumping a thread will not help. You should open a feature request and if a lot of people vote on the feature request and if you are lucky, this might get the attention of the developers. However this still doesn’t mean that it gets implemented.

You can get this info yourself. But remember, if an automation triggered it, it will not contain a user_id. Also, user ID’s are only populated with non-custom lovelace cards, and only populated when someone uses the UI. In most cases, the context is empty.