Triggering automation if certain domain entities change state

Exactly this instance I’ve been experimenting with this approach. I amd doing “state_changed” event triggering, but cannot access old_state, new_state objects. Do you know what is the syntax for that? trigger.old_state.domain yelds no result…