Add ability to log Triggered By for external services

Right now, Logbook is pretty good at figuring out what triggered something to come on.

Personally though, a lot of my automations are quite complex, and I much prefer having a flow in Node Red over multiple different automations in HA to achieve the same thing.

Unfortunately, though, this makes debugging rather difficult. Where I’m triggering scenes, I get triggered by service Scenes: Activate and where I use the API to control devices, I get turned on

I spent the best part of an hour this morning, trying to figure out why a single light was turning on. Logbook in HA becomes useless at this point as all it tells me is the light turned on…

What would be ideal, is if every API call to trigger something included a trigger reference field. This way, when calling HA via the API, we can identify exactly what called the API via the trigger reference field.