presence_simulation
presence_simulation copied to clipboard
Add attribution for logbook
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?
I really don't know how to do that 🤪
This would be incredibly useful.
@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.
@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.
After the fix of @zacs