presence_simulation icon indicating copy to clipboard operation
presence_simulation copied to clipboard

Add attribution for logbook

Open zacs opened this issue 1 year ago • 1 comments

I switched phones recently, which broke my "turn off Presence Simulation when I get home" automation. Lights started turning off on their own and it took me a while to figure out why.

In the attached screenshot the red box is the time Presence Simulation was acting. Is it possible to add attribution to the logbook similar to the homekit entry a bit further up the log?

image

zacs avatar Nov 12 '24 08:11 zacs

I really don't know how to do that 🤪

slashback100 avatar Dec 26 '24 19:12 slashback100

This would be incredibly useful.

DaveTSG avatar Sep 04 '25 06:09 DaveTSG

@slashback100 I think you need to pass a Context when you call services for this.

ChatGPT suggests using async_create_system_user to create a system user for your custom integration that you use for the Context object.

Image

codemunkie15 avatar Sep 30 '25 11:09 codemunkie15

@codemunkie15 thanks for the pointer. I tried to make the changes (pretty straightforward, but used Claude to do the work) in my fork here: https://github.com/zacs/presence_simulation. I am in the process of re-setting up HA, so can't test with real devices. Would you mind giving it a try?

edit: Stood up a test server with a couple lights and seems to work fine. Will submit a PR for review.

zacs avatar Sep 30 '25 13:09 zacs

After the fix of @zacs Image

slashback100 avatar Sep 30 '25 18:09 slashback100