Apologies if this is possible or has already been discussed and I’m just missing something, but I’d really like to know which automation or state change has, for example, turned on a light.
As an example, I have an led strip in the kitchen that is only triggered by a single night time automation ( It operates between 23:59 and 07:00). It’s 17:30 and the light strip has just turned on. The log book and device information tells me the light has been switched on but not by what or why - I don’t know how to troubleshoot if the logs are only telling me when the entity was turned on. Could it be possible to have device XXX has been turned on by YYY
How do you know it isn’t a spontaneous noise on the switch? Random RF interference? A failing switch? Does it only happen between 23:59 and 07:00? No? Then what else happens at the same time? Does Alexa see the light?
Hi Steve - Totally agree about how tricky it can be to track issues, but that’s kind of my point. Odd things do happen from time to time and improving the reporting of events would make it easier to track down the causes of odd / errant behaviours.
Logbook already provides this information. If the light was turned on by an automation, this is written in the logbook. If it just says the light was turned on, it wasn’t automation, unless the automation target is not the light specifically, but a group this light is in. And if the light was turn on through dashboard, the logbook will show the user names of who did it.
So if it just says the light was turned on, most likely it was turned on by something outside of HA, HA just noted the state change.
I just remember one detail. For my lights with native Hue integration, using Hue hub and the light groups it created, automation changing the state of that group does not show as context for the individual lights. I guess this is because it’s the hub that’s switching the individual lights, so technically it happens outside of HA, even though HA automation initiated it.