WTH logbook entries `turned X triggered by service homeassistant.turn_X` without details

Logbook still has a lot of entries like turned on/off triggered by service homeassistant.turn_on/off without additional information about who did cause the change.

For instance automation name is visible but changes by the thermostat do not show what called the service.

I’m not sure if it is a Generic Thermostat or broader issue. When I change thermostat preset then it goes to the log but when thermostat just runs, changes are without that info (the first and last entry in this example)

Because it’s updating based on itself. This is akin to a physical switch.

If I turn it on through the UI, HA knows who turned it on.
If an automation turns it on, HA knows the automation turned it on.
If I physically press the switch, who’s turning it on? The integration? A person? Was it an automation from some other connected service? Who knows, HA doesn’t, it just see’s the state change from whatever API it’s using.

Thermostat is very specific integration and even has a unique id. How is it so difficult to log it? It is not the same that I switch heater on manually from switch.

If you’re referring to generic thermostat and the actions it performs, it most likely doesn’t pass or receive context.

In general, HA will not know who or what influenced hardware. It can only know what it does or what it’s users do. Anything that comes from an outside source will be treated as context-less because you can’t determine the source.

If HA doesn’t know it now, then this is a valid WTH. HA does this switch. Generic Thermostat is part of HA.

If you look at my screenshot then you can see that thermostat preset change will be logged. It is without the link to the thermostat (and doesn’t show what preset was selected) but at least I know that it was a thermostat integration (and I hope that I don’t assign multiple thermostats to the same switch). I don’t know why the preset change service does this switch directly and not via turn_on/turn_off service but I like that way much more

So, it shouldn’t be impossible to add thermostat as a source for every switching.

The title implies they’re all bad when it’s just an integration :wink: I’m just clarifying the behavior behind the logbook entries.