Automation state change: event condition

Here’s another way to do it using a template sensor. It’s only useful if you use the context a lot and don’t want to keep writing out all the conditions: