How do I find out who or what changed a light?

I have a bunch of Zigbee lights and one of them regularly changes apparently without reason. Sometimes it changes color temperature, sometimes it turns off… According to Zigbee2MQTT there is a command coming from HA. Is there any way to figure out what integration does that?

If you go to the “Device Info” for the device sensor, it should have a list of automations that are controlling the device.
The “History” for the device should show what triggered the device as well and then troubleshoot why from there.

Well, it only says “Turned off”…

Sounds like the bulb itself changed state from an on device action then.

Does that color temp change to the default color temp from something else perhaps?

Some manufacturers zigbee bulbs return to default status after a firmware attempt (good or bad). A bad firmware attempt therefore results in the bulb sometimes popping on full brightness in the middle of the night with nothing in the log other than ‘turned on’?

I had one of my bulbs failing a year or so ago and it kept trying to ‘get firmware’ - from where I don’t know. It was already up to date. Every time it did it would be all by itself on, cool white full brightness… Hey look at me! At 2am.

Yeah, I have been thinking about that but I haven’t found anything in the Zigbee2MQTT logs so far.
I have set up an event listener which show all event aimed at that light and what puzzles me that when the quirk happens, no event seems to come up on the event bus but there seems to be an MQTT message commanding Z2M to change the light. I still have to analyze that closer but at the moment it looks like something else is sending an MQTT message for that light?!